[JAVA-4145] Slow tests not running as expected Created: 07/May/21  Updated: 28/Oct/23  Resolved: 10/Aug/21

Status: Closed
Project: Java Driver
Component/s: Test Coverage
Affects Version/s: None
Fix Version/s: 4.4.0

Type: Improvement Priority: Unknown
Reporter: Ross Lawley Assignee: Ross Lawley
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
  • Junit4
    The 3 Junit4 tests using @Tag("Slow") are always run (as @Tag is a junit5 annotation)
  • Spock
    The gradle configuration currently only runs "normal" tests for spock.
    Looks to using a single system property to determine which tests to include / exclude


 Comments   
Comment by Githook User [ 10/Aug/21 ]

Author:

{'name': 'Ross Lawley', 'email': 'ross.lawley@gmail.com', 'username': 'rozza'}

Message: Build: Fix slow tests (#773)

JAVA-4145
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/fb6388caac5b7cd7e451012be91a7eb02d7db76f

Comment by Ross Lawley [ 05/Aug/21 ]

PR: https://github.com/mongodb/mongo-java-driver/pull/773

Comment by Valentin Kavalenka [ 23/Jul/21 ]

Of all slow tests, only those marked with JUnit 5 @org.junit.jupiter.api.Tag("Slow") are run: https://spruce.mongodb.com/task/mongo_java_driver_tests_slow__version~4.2_os~linux_topology~replicaset_auth~noauth_ssl~nossl_jdk~jdk8_slow_test_patch_1b02a9dcf0ab357c26f5e938808a11a6d5604407_60f8ed54a4cf472373ac0e58_21_07_22_04_00_21/tests?execution=0&page=0

No Spock tests marked with @util.spock.annotations.Slow are run by the Gradle :testSlowOnly task, but they are correctly excluded by the Gradle :test task. This is weird, given that the OnlySlow.groovy Spock config is clearly picked up, as we can see its "Only including Slow Spock tests" message in the logs. This may be related to this bug report which was closed as "works as designed" with a link to https://github.com/spockframework/spock/issues/1288#issuecomment-791901698, where eventually people suggest to have two different tasks for running Spock and JUnit tests.

Generated at Thu Feb 08 09:01:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.