Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java_test: Restore resource_strip_prefix attribute #18206

Conversation

davido
Copy link
Contributor

@davido davido commented Apr 25, 2023

Fixes: #18205

Closes: #18206.

Change-Id: I34b811d83bfc54f2dc8ef920aa43a7371b7064f1

@github-actions github-actions bot added the awaiting-review PR is awaiting review from an assigned reviewer label Apr 25, 2023
Fixes: bazelbuild#18205

Closes: bazelbuild#18206.

Change-Id: I34b811d83bfc54f2dc8ef920aa43a7371b7064f1
@davido davido force-pushed the java_test_restore_resource_strip_prefix branch from e55000a to 4ff6743 Compare April 25, 2023 05:01
@davido
Copy link
Contributor Author

davido commented Apr 25, 2023

@hvadehra @meteorcloudy @fweikert

Could you please review it?
Also, could the fix be cherry-picked to the upcoming release 7.x (or where is the right place to ask it)?

@keertk keertk added the team-Rules-Java Issues for Java rules label Apr 25, 2023
@davido
Copy link
Contributor Author

davido commented May 2, 2023

@comius @hvadehra Any chance this can be reviewed?

@meteorcloudy @philwo I also don't understand, why gerrit build is still green on Bazel-CI,
given that the tests are failing on upcoming Bazel 7.x release? I only see gerrit is building on 6.1.2 release: [1].

If I try to run gerrit tests on latest 7.x snapshot release:

diff --git a/.bazelversion b/.bazelversion
index 5e3254243a..db63b31bdd 100644
--- a/.bazelversion
+++ b/.bazelversion
@@ -1 +1 @@
-6.1.2
+7.0.0-pre.20230420.2

I am getting this breakage, that this PR is fixing:

  $ bazelisk test //javatests/com/google/gerrit/server/rules/prolog:prolog_tests
[...]
ERROR: /home/davido/projects/gerrit/javatests/com/google/gerrit/server/rules/prolog/BUILD:3:12: //javatests/com/google/gerrit/server/rules/prolog:prolog_tests: no such attribute 'resource_strip_prefix' in 'java_test' rule
ERROR: Skipping '//javatests/com/google/gerrit/server/rules/prolog:prolog_tests': Error evaluating '//javatests/com/google/gerrit/server/rules/prolog:prolog_tests': error loading package 'javatests/com/google/gerrit/server/rules/prolog': Package 'javatests/com/google/gerrit/server/rules/prolog' contains errors
ERROR: Error evaluating '//javatests/com/google/gerrit/server/rules/prolog:prolog_tests': error loading package 'javatests/com/google/gerrit/server/rules/prolog': Package 'javatests/com/google/gerrit/server/rules/prolog' contains errors
INFO: Elapsed time: 17.624s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
ERROR: Couldn't start the build. Unable to run tests

Or is there no Bazel-CI for gerrit project that is running from Bazel@HEAD, or for upcoming 7.x release?

Update: See also this issue upstream: [2].

[1] https://buildkite.com/bazel/gerrit/builds/11463#0187daa3-f119-4282-9e41-83616937872f
[2] https://crbug.com/gerrit/16898

@meteorcloudy
Copy link
Member

Gerrit was disabled in Bazel's downstream pipeline: https://github.com/bazelbuild/continuous-integration/blob/master/buildkite/bazelci.py#L203

@davido
Copy link
Contributor Author

davido commented May 2, 2023

Gerrit was disabled in Bazel's downstream pipeline: https://github.com/bazelbuild/continuous-integration/blob/master/buildkite/bazelci.py#L203
https://crbug.com/gerrit/16632

Thanks for the pointer. I missed that issue.

Looking at your latest comment:

Gerrit still fails with Bazel@HEAD: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/2980#0187b696-f59a-4d77-9c22-5913603a06ca

Looking at the log this is exactly the breakage this PR is fixing: [1].

(04:15:46) ERROR: /var/lib/buildkite-agent/builds/bk-docker-pr70/bazel-downstream-projects/gerrit/javatests/com/google/gerrit/auth/BUILD:4:12: //javatests/com/google/gerrit/auth:auth_tests: no such attribute 'resource_strip_prefix' in 'java_test' rule
(04:15:46) ERROR: package contains errors: javatests/com/google/gerrit/auth
(04:15:46) ERROR: /var/lib/buildkite-agent/builds/bk-docker-pr70/bazel-downstream-projects/gerrit/javatests/com/google/gerrit/server/rules/BUILD:3:12: //javatests/com/google/gerrit/server/rules:prolog_tests: no such attribute 'resource_strip_prefix' in 'java_test' rule
(04:15:46) ERROR: package contains errors: javatests/com/google/gerrit/server/rules
(04:15:46) ERROR: /var/lib/buildkite-agent/builds/bk-docker-pr70/bazel-downstream-projects/gerrit/javatests/com/google/gerrit/server/ioutil/BUILD:3:12: //javatests/com/google/gerrit/server/ioutil:ioutil_tests: no such attribute 'resource_strip_prefix' in 'java_test' rule
(04:15:46) ERROR: package contains errors: javatests/com/google/gerrit/server/ioutil
(04:15:46) ERROR: /var/lib/buildkite-agent/builds/bk-docker-pr70/bazel-downstream-projects/gerrit/javatests/com/google/gerrit/server/BUILD:21:12: //javatests/com/google/gerrit/server:server_tests: no such attribute 'resource_strip_prefix' in 'java_test' rule
(04:15:46) ERROR: package contains errors: javatests/com/google/gerrit/server
(04:15:46) ERROR: Error evaluating '//...': error loading package 'javatests/com/google/gerrit/auth': Package 'javatests/com/google/gerrit/auth' contains errors
(04:15:46) INFO: Elapsed time: 0.530s
(04:15:46) INFO: 0 processes.
(04:15:46) ERROR: Build did NOT complete successfully
(04:15:46) ERROR: Couldn't start the build. Unable to run tests
(04:15:46) INFO: Build Event Protocol files produced successfully.
bazel test failed with exit code 1
🚨 Error: The command exited with status 1

@meteorcloudy What is your suggestion to address that?
Should I open another bazel issue, or should I wait until his PR is reviewed, or should I Look for alternative implementation how to provide resources to java_test rule?

[1] https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/2980#0187b696-f59a-4d77-9c22-5913603a06ca

@meteorcloudy
Copy link
Member

Looks like this PR can fix the issue, but I'll leave it to be decided by @hvadehra and @comius if this is what we want.

Copy link
Member

@hvadehra hvadehra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, sorry for the trouble.

@hvadehra hvadehra added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels May 2, 2023
@copybara-service copybara-service bot closed this in 7f4eb60 May 2, 2023
@sgowroji sgowroji removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label May 2, 2023
fweikert pushed a commit to fweikert/bazel that referenced this pull request May 25, 2023
Fixes: bazelbuild#18205

Closes: bazelbuild#18206.

Change-Id: I34b811d83bfc54f2dc8ef920aa43a7371b7064f1

Closes bazelbuild#18206.

Change-Id: I34b811d83bfc54f2dc8ef920aa43a7371b7064f1
PiperOrigin-RevId: 528758180
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Rules-Java Issues for Java rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bazel@HEAD: rules:prolog_tests: no such attribute 'resource_strip_prefix' in 'java_test' rule
5 participants