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

JUnit standalone program doesn't discover tests #2140

Closed
exx8 opened this issue Dec 28, 2019 · 2 comments
Closed

JUnit standalone program doesn't discover tests #2140

exx8 opened this issue Dec 28, 2019 · 2 comments
Assignees

Comments

@exx8
Copy link

exx8 commented Dec 28, 2019

Steps to reproduce

run
java -jar ex1/lib/junit-platform-console-standalone-1.6.0-M1.jar --select-directory="./ex1/test"
with the following hierarchy

.
├── ex1
│   ├── lib
│   │   ├── apiguardian-api-1.1.0.jar
│   │   ├── junit-jupiter-api-5.6.0-M1.jar
│   │   ├── junit-platform-commons-1.6.0-M1.jar
│   │   ├── junit-platform-console-standalone-1.6.0-M1.jar
│   │   └── opentest4j-1.2.0.jar
│   ├── mavnat.iml
│   ├── out
│   │   ├── production
│   │   │   └── mavnat
│   │   │       ├── AVLTree$AVLNode.class
│   │   │       ├── AVLTree.class
│   │   │       ├── AVLTree$DeletionBalancer.class
│   │   │       ├── AVLTree$IAVLNode.class
│   │   │       ├── AVLTree$InsertionBalancer.class
│   │   │       ├── AVLTree$Rotations.class
│   │   │       └── TreePrinter.class
│   │   └── test
│   │       └── mavnat
│   │           ├── ActualAVLTree.class
│   │           ├── ActualAVLTree$IAVLNode.class
│   │           ├── AVLSanitizer.class
│   │           ├── AVLTreeTest.class
│   │           ├── AVLTreeTestExternal.class
│   │           ├── DeletionTest.class
│   │           ├── ExTester$10.class
│   │           ├── ExTester$11.class
│   │           ├── ExTester$12.class
│   │           ├── ExTester$13.class
│   │           ├── ExTester$14.class
│   │           ├── ExTester$1.class
│   │           ├── ExTester$2.class
│   │           ├── ExTester$3.class
│   │           ├── ExTester$4.class
│   │           ├── ExTester$5.class
│   │           ├── ExTester$6.class
│   │           ├── ExTester$7.class
│   │           ├── ExTester$8.class
│   │           ├── ExTester$9.class
│   │           ├── ExTester.class
│   │           ├── InsertionTest.class
│   │           ├── META-INF
│   │           │   └── mavnat.kotlin_module
│   │           ├── RotationsTest.class
│   │           ├── SplitTest.class
│   │           ├── SuccessStatus.class
│   │           ├── TesterUtils.class
│   │           ├── Tests.class
│   │           └── TestUtils.class
│   ├── pro-1.docx
│   ├── src
│   │   ├── AVLTree.java
│   │   └── TreePrinter.java
│   └── test
│       ├── AVLSanitizer.java
│       ├── AVLTreeTestExternal.java
│       ├── AVLTreeTest.java
│       ├── DeletionTest.java
│       ├── InsertionTest.java
│       ├── JoinTest.java
│       ├── RotationsTest.java
│       ├── SplitTest.java
│       └── TestUtils.java
└── ex2

Context

  • Used versions (Jupiter/Vintage/Platform): linux junit platform 1.6
  • Build Tool/IDE:
    java 11

I expect the launcher to run my tests. instead no test is run.

java -jar ex1/lib/junit-platform-console-standalone-1.6.0-M1.jar -cp ex1 --scan-classpath

Thanks for using JUnit! Support its development at https://junit.org/sponsoring

╷
├─ JUnit Jupiter ✔
└─ JUnit Vintage ✔

Test run finished after 29 ms
[         2 containers found      ]
[         0 containers skipped    ]
[         2 containers started    ]
[         0 containers aborted    ]
[         2 containers successful ]
[         0 containers failed     ]
[         0 tests found           ]
[         0 tests skipped         ]
[         0 tests started         ]
[         0 tests aborted         ]
[         0 tests successful      ]
[         0 tests failed          ]

@sormuras
Copy link
Member

This kind of question is better suited to be asked over at StackOverflow. Thus, I'm closing this issue.

Maybe this answer already contains enough information to help you: https://stackoverflow.com/questions/52373469/how-to-launch-junit-5-platform-from-the-command-line-without-maven-gradle/52373592#52373592

Feel free to re-open this issue if you still struggle to get the standalone variant running.

@sormuras sormuras self-assigned this Dec 29, 2019
@sormuras sormuras changed the title Junit doesn't discover my tests JUnit standalone program doesn't discover tests Dec 29, 2019
@sormuras
Copy link
Member

Note: this is related to #90 (#90 (comment)) as Jupiter and Vintage don't support "selecting tests from directories", which includes the --select-directory option of the console launcher.

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

No branches or pull requests

2 participants