-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
JUnit assumption violation is not reflected on Bazel UI #3476
Comments
@iirina can you take a look? seems like a useful feature, but need priority |
I will take a look this or next week and see if we can get away with a quick solution. If not, this will have to wait a bit more, as other things have higher priority right now. |
Any updates on this? Interestingly, I see that assumption violation is tested in Bazel test, both on suite and test level: Lines 118 to 168 in c7696b4
|
OK, I see now what happens. The A Birds Eye View of Bazel's UI rendering <-> JUnit Runner integration:
Given that standard JUnit text UI doesn't currently reflect assumption violations, this information is lost. How it works in Buck? From the very first commit, back in 2013, Buck's
FTR: Here is a working Buck's JUnit test example with assumption violations:
|
Testcontainers is a Java 8 library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container. This change replaces ES integration test that currently uses embedded ES mode with ES docker image using Testcontainers library. All this is done from within acceptance tests. This change removes dependency on ES server stack for the test code. As the consequence, this stack can be removed. Prerequisite for this change is installed docker service on the SUT. If docker service is not installed, assumption violation is raised so that the tests don't fail. Unfortunately, due to this missing Bazel feature, JUnit assumption violations are not reflected on the Bazel UI: [1] yet. [1] bazelbuild/bazel#3476 Change-Id: Iccf44310292cc44bff9173f2a4ea757b43f77183
@davido I would be surprised if Bazel is reading the output of JUnit's text UI. My understanding is that the output from Bazel is reporting the status of test actions, not test methods. Bazel supports many kinds of test actions, and most of them don't have a concept of assumption failures. So Bazel looks at the exit value of the test process to determine the pass/fail status of the test action. FYI: I don't work on Bazel–so I can't fix the issue–but I worked on the JUnit integration of Blaze and that code was refactored and used in Bazel. |
BTW you can get tell Bazel to provide more detailed ouput of the test (see https://docs.bazel.build/versions/master/user-manual.html#flag--test_summary). Note that from Bazel's perspective–and JUnit's–this test passed so it might not show details unless you requested verbose output. Try a test with one failing test and one assumption failure. |
Testcontainers is a Java 8 library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container. This change replaces ES integration test that currently uses embedded ES mode with ES docker image using Testcontainers library. All this is done from within acceptance tests. This change removes dependency on ES server stack for the test code. As the consequence, this stack can be removed. Prerequisite for this change is installed docker service on the SUT. If docker service is not installed, assumption violation is raised so that the tests don't fail. Unfortunately, due to this missing Bazel feature, JUnit assumption violations are not reflected on the Bazel UI: [1] yet. [1] bazelbuild/bazel#3476 Change-Id: Iccf44310292cc44bff9173f2a4ea757b43f77183
Add separate test classes to test queries with Elasticsearch version 6. The entire test classes are basically copied from the existing ones, with the only difference being the version passed into the config and into the container creation. This cannot be achieved using an abstract class due to the container being created in the @BeforeClass annotated method which is static and cannot be overridden by a derived class. The docker image for V6 testing requires this limit [1] to be secured. The test container otherwise aborts upon running V6 tests, causing an AssumptionViolatedException, which is currently ignored by Bazel ([2]). Amend the test execution documentation accordingly. Replace the V6 image used for testing with the oss one, which has no X-Pack or security defaults installed; cf. [3]. Without this change, V6 tests fail upon api usage lacking authorization. [1] https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html [2] bazelbuild/bazel#3476 [3] https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html Bug: Issue 9112 Bug: Issue 9212 Change-Id: I11ced5f811cdc078d7feba187086e803326886cb
JUnit assumption violation is not reflected on Bazel UI: [1]. As the consequence, if a test is passing it's not clear, it's skipped due to assumption violation or it is passing the actual tests. Especially for the important Gerrit features like git wire protocol v2 we must be sure that the integration tests got actually executed and were successful. Given that the git wire protocol test requires very recent git client version (2.18) add git-protocol-v2 label to the test rule and provide instructions how to skip the test in Bazel documentation. [1] bazelbuild/bazel#3476 Bug: Issue 12032 Change-Id: Icba99ab22fa7e99fb303eb79cf3df3b354ee3d77
Testcontainers is a Java 8 library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container. This change replaces ES integration test that currently uses embedded ES mode with ES docker image using Testcontainers library. All this is done from within acceptance tests. This change removes dependency on ES server stack for the test code. As the consequence, this stack can be removed. Prerequisite for this change is installed docker service on the SUT. If docker service is not installed, assumption violation is raised so that the tests don't fail. Unfortunately, due to this missing Bazel feature, JUnit assumption violations are not reflected on the Bazel UI: [1] yet. [1] bazelbuild/bazel#3476 Change-Id: Iccf44310292cc44bff9173f2a4ea757b43f77183
Testcontainers is a Java 8 library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container. This change replaces ES integration test that currently uses embedded ES mode with ES docker image using Testcontainers library. All this is done from within acceptance tests. This change removes dependency on ES server stack for the test code. As the consequence, this stack can be removed. Prerequisite for this change is installed docker service on the SUT. If docker service is not installed, assumption violation is raised so that the tests don't fail. Unfortunately, due to this missing Bazel feature, JUnit assumption violations are not reflected on the Bazel UI: [1] yet. [1] bazelbuild/bazel#3476 Change-Id: Iccf44310292cc44bff9173f2a4ea757b43f77183
Add separate test classes to test queries with Elasticsearch version 6. The entire test classes are basically copied from the existing ones, with the only difference being the version passed into the config and into the container creation. This cannot be achieved using an abstract class due to the container being created in the @BeforeClass annotated method which is static and cannot be overridden by a derived class. The docker image for V6 testing requires this limit [1] to be secured. The test container otherwise aborts upon running V6 tests, causing an AssumptionViolatedException, which is currently ignored by Bazel ([2]). Amend the test execution documentation accordingly. Replace the V6 image used for testing with the oss one, which has no X-Pack or security defaults installed; cf. [3]. Without this change, V6 tests fail upon api usage lacking authorization. [1] https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html [2] bazelbuild/bazel#3476 [3] https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html Bug: Issue 9112 Bug: Issue 9212 Change-Id: I11ced5f811cdc078d7feba187086e803326886cb
Consider this JUnit test:
Running
bazel test
produces:There was no mention of assumption violation(s) and the fact, that some tests were actually skipped.
For the record, here is the
BUILD
file:Check how the assumption violation and the fact that the test was actually skipped is reported in Buck:
For the record, here is the
.buckconfig
file:and here is the
BUCK
file:The text was updated successfully, but these errors were encountered: