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

"Rerun Failed Tests" causes invalid test_filter #446

Closed
aherrmann opened this issue Nov 15, 2018 · 1 comment
Closed

"Rerun Failed Tests" causes invalid test_filter #446

aherrmann opened this issue Nov 15, 2018 · 1 comment
Labels

Comments

@aherrmann
Copy link

Clicking the "Rerun Failed Tests" icon constructs an empty --test_filter= parameter to Bazel which always causes the test to fail.

Steps to Reproduce

  • Checkout this example project

  • Import into IntelliJ using this project view file

    directories:
      .
    targets:
      //:tests_test_suite_src_test_scala_org_example_hello_HelloSpec.scala
    additional_languages:
      scala
    
  • Modify the test-case to make it fail. E.g.

       it should "greet the given name" in {
    -    assert(Hello.hello("Some Name") === "Hello Some Name!")
    +    assert(Hello.hello("Some Name") === "Hello some Name!")
       }
  • Click "Run selected configuration" on the Bazel test :tests_..._HelloSpec.scala run configuration.
    run_test_case

  • Click "Rerun Failed Tests"
    run_failed_test

  • Observe the following test failue

    ...
    //:tests_test_suite_src_test_scala_org_example_hello_HelloSpec.scala     FAILED in 1.1s
    ...    
    Executed 1 out of 1 test: 1 fails locally.
    Empty test suite.
    
  • Notice how Bazel is passed an empty --test_filter= argument

    bazel test --tool_tag=ijwb:IDEA:community --curses=no --color=yes --experimental_ui=no --progress_in_terminal_title=no --runs_per_test=1 --flaky_test_attempts=1 --build_event_binary_file=/tmp/intellij-bep-1d9f67b5-e323-4392-bd49-4c2ec1464a7b --nobuild_event_binary_file_path_conversion --test_filter= -- //:tests_test_suite_src_test_scala_org_example_hello_HelloSpec.scala
    

Details

  • Executing the following command reveals the actual error
    $ bazel test --test_filter= --cache_test_results=no --test_output=errors -- //:tests_test_suite_src_test_scala_org_example_hello_HelloSpec.scala
    ...
    ==================== Test output for //:tests_test_suite_src_test_scala_org_example_hello_HelloSpec.scala:
    *** RUN ABORTED ***
      java.lang.ClassNotFoundException:
      at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    ...
    INFO: Build completed, 1 test FAILED, 2 total actions
    ...
    INFO: Build completed, 1 test FAILED, 2 total actions
    
  • Expected behavior: Call bazel with a non-empty --test_filter argument such as
    --test_filter=org.example.hello.HelloSpec
    
@jin jin added the lang: scala Scala rules integration label May 1, 2019
@sgowroji
Copy link
Member

Hi there! We're doing a clean up of old issues and will be closing this one. Please reopen if you’d like to discuss anything further. We’ll respond as soon as we have the bandwidth/resources to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants