Skip to content

Commit

Permalink
Allow comparison of other attributes in aquery differ tool.
Browse files Browse the repository at this point in the history
cmd_line_differ.py was able to compare the difference in the *command lines* run for each action in 2 different aquery results.

This commit adds the following:
- New flag --attrs, that specify the attributes of actions to be compared.
- The implementation of --attrs=inputs. Other attributes will be added in subsequent commits.
- Improved formatting for the output of the script.

RELNOTES[INC]: //tools/cmd_line_differ has been renamed to //tools/aquery_differ & can now compare (in addition to command lines) inputs of actions given 2 aquery results.

PiperOrigin-RevId: 233025799
  • Loading branch information
joeleba authored and Copybara-Service committed Feb 8, 2019
1 parent 102256f commit 3575797
Show file tree
Hide file tree
Showing 9 changed files with 428 additions and 188 deletions.
16 changes: 8 additions & 8 deletions .bazelci/postsubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ platforms:
- "//src/tools/singlejar/..."
- "//third_party/ijar/..."
- "//tools/android/..."
- "//tools/cmd_line_differ/..."
- "//tools/aquery_differ/..."
ubuntu1604:
shell_commands:
- sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^#
Expand All @@ -35,7 +35,7 @@ platforms:
- "//src/tools/singlejar/..."
- "//third_party/ijar/..."
- "//tools/android/..."
- "//tools/cmd_line_differ/..."
- "//tools/aquery_differ/..."
ubuntu1804:
shell_commands:
- sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^#
Expand All @@ -53,7 +53,7 @@ platforms:
- "//src/tools/singlejar/..."
- "//third_party/ijar/..."
- "//tools/android/..."
- "//tools/cmd_line_differ/..."
- "//tools/aquery_differ/..."
ubuntu1804_nojava:
build_flags:
- "--javabase=@openjdk_linux_archive//:runtime"
Expand All @@ -69,7 +69,7 @@ platforms:
- "//src/test/..."
- "//src/tools/singlejar/..."
- "//third_party/ijar/..."
- "//tools/cmd_line_differ/..."
- "//tools/aquery_differ/..."
# We can't run Android tests without an installed Android SDK / NDK.
- "-//src/test/java/com/google/devtools/build/android/..."
- "-//src/test/shell/bazel/android/..."
Expand Down Expand Up @@ -127,7 +127,7 @@ platforms:
- "//src/tools/singlejar/..."
- "//third_party/ijar/..."
- "//tools/android/..."
- "//tools/cmd_line_differ/..."
- "//tools/aquery_differ/..."
ubuntu1804_java10:
shell_commands:
- sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^#
Expand All @@ -145,7 +145,7 @@ platforms:
- "//src/tools/singlejar/..."
- "//third_party/ijar/..."
- "//tools/android/..."
- "//tools/cmd_line_differ/..."
- "//tools/aquery_differ/..."
ubuntu1804_java11:
shell_commands:
- sed -i.bak -e 's/^# android_sdk_repository/android_sdk_repository/' -e 's/^#
Expand All @@ -163,7 +163,7 @@ platforms:
- "//src/tools/singlejar/..."
- "//third_party/ijar/..."
- "//tools/android/..."
- "//tools/cmd_line_differ/..."
- "//tools/aquery_differ/..."
# Some prebuilt jars doesn't run with Java 11
- "-//src/test/shell/bazel:external_integration_test"
- "-//src/test/shell/bazel:maven_test"
Expand Down Expand Up @@ -192,7 +192,7 @@ platforms:
- "//src/tools/singlejar/..."
- "//third_party/ijar/..."
- "//tools/android/..."
- "//tools/cmd_line_differ/..."
- "//tools/aquery_differ/..."
- "-//src/test/shell/integration:minimal_jdk_test"
windows:
batch_commands:
Expand Down
16 changes: 8 additions & 8 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ platforms:
- "//src/tools/workspacelog/..."
- "//third_party/ijar/..."
- "//tools/android/..."
- "//tools/cmd_line_differ/..."
- "//tools/aquery_differ/..."
# Disable Slow Tests
- "-//src/test/shell/bazel:bazel_determinism_test"
# Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/4663
Expand All @@ -43,7 +43,7 @@ platforms:
- "//src/tools/workspacelog/..."
- "//third_party/ijar/..."
- "//tools/android/..."
- "//tools/cmd_line_differ/..."
- "//tools/aquery_differ/..."
# Disable Slow Tests
- "-//src/test/shell/bazel:bazel_determinism_test"
# Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/4663
Expand All @@ -67,7 +67,7 @@ platforms:
- "//src/tools/workspacelog/..."
- "//third_party/ijar/..."
- "//tools/android/..."
- "//tools/cmd_line_differ/..."
- "//tools/aquery_differ/..."
# Disable Slow Tests
- "-//src/test/shell/bazel:bazel_determinism_test"
# Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/4663
Expand All @@ -89,7 +89,7 @@ platforms:
- "//src/tools/singlejar/..."
- "//src/tools/workspacelog/..."
- "//third_party/ijar/..."
- "//tools/cmd_line_differ/..."
- "//tools/aquery_differ/..."
# Disable Slow Tests
- "-//src/test/shell/bazel:bazel_determinism_test"
# We can't run Android tests without an installed Android SDK / NDK.
Expand Down Expand Up @@ -151,7 +151,7 @@ platforms:
- "//src/tools/workspacelog/..."
- "//third_party/ijar/..."
- "//tools/android/..."
- "//tools/cmd_line_differ/..."
- "//tools/aquery_differ/..."
# Disable Slow Tests
- "-//src/test/shell/bazel:bazel_determinism_test"
# Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/4663
Expand All @@ -175,7 +175,7 @@ platforms:
- "//src/tools/workspacelog/..."
- "//third_party/ijar/..."
- "//tools/android/..."
- "//tools/cmd_line_differ/..."
- "//tools/aquery_differ/..."
# Disable Slow Tests
- "-//src/test/shell/bazel:bazel_determinism_test"
# Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/4663
Expand All @@ -199,7 +199,7 @@ platforms:
- "//src/tools/workspacelog/..."
- "//third_party/ijar/..."
- "//tools/android/..."
- "//tools/cmd_line_differ/..."
- "//tools/aquery_differ/..."
# Disable Slow Tests
- "-//src/test/shell/bazel:bazel_determinism_test"
# Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/4663
Expand Down Expand Up @@ -234,7 +234,7 @@ platforms:
- "//src/tools/workspacelog/..."
- "//third_party/ijar/..."
- "//tools/android/..."
- "//tools/cmd_line_differ/..."
- "//tools/aquery_differ/..."
# Re-enable once fixed: https://github.com/bazelbuild/bazel/issues/4663
- "-//src/test/shell/bazel/android:android_ndk_integration_test"
# The below tests have been disabled because they are too slow on macOS.
Expand Down
2 changes: 1 addition & 1 deletion src/test/shell/bazel/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ filegroup(
"//src/test/shell/bazel/apple:srcs",
"//src/test/shell/bazel/remote:srcs",
"//src/test/shell/bazel/testdata:srcs",
"//tools/cmd_line_differ:srcs",
"//tools/aquery_differ:srcs",
],
visibility = ["//src/test/shell:__pkg__"],
)
Expand Down
4 changes: 2 additions & 2 deletions tools/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ filegroup(
name = "srcs",
srcs = glob(["**"]) + [
"//tools/android:srcs",
"//tools/aquery_differ:srcs",
"//tools/bash:srcs",
"//tools/buildstamp:srcs",
"//tools/build_defs:srcs",
"//tools/build_rules:srcs",
"//tools/cmd_line_differ:srcs",
"//tools/coverage:srcs",
"//tools/java:srcs",
"//tools/jdk:srcs",
Expand Down Expand Up @@ -71,9 +71,9 @@ test_suite(
name = "all_windows_tests",
tests = [
"//tools/android:all_windows_tests",
"//tools/aquery_differ:aquery_differ_test",
"//tools/bash:all_windows_tests",
"//tools/build_defs:all_windows_tests",
"//tools/cmd_line_differ:cmd_line_differ_test",
"//tools/cpp/runfiles:all_windows_tests",
"//tools/java:all_windows_tests",
"//tools/jdk:all_windows_tests",
Expand Down
18 changes: 13 additions & 5 deletions tools/cmd_line_differ/BUILD → tools/aquery_differ/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,28 @@ filegroup(
srcs = glob(["**"]),
)

py_library(
name = "aquery_differ_resolvers",
srcs = glob(
["resolvers/*.py"],
),
)

py_binary(
name = "cmd_line_differ",
srcs = ["cmd_line_differ.py"],
name = "aquery_differ",
srcs = ["aquery_differ.py"],
deps = [
":aquery_differ_resolvers",
"//src/main/protobuf:analysis_py_proto",
"//third_party/py/abseil",
],
)

py_test(
name = "cmd_line_differ_test",
srcs = ["cmd_line_differ_test.py"],
name = "aquery_differ_test",
srcs = ["aquery_differ_test.py"],
deps = [
":cmd_line_differ",
":aquery_differ",
"//src/main/protobuf:analysis_py_proto",
"//third_party/py/mock",
],
Expand Down
Loading

0 comments on commit 3575797

Please sign in to comment.