eclipse-xtext / eclipse-xtext/xtext

Negative MyDslParsingTest does not fail maven build (No tests found)

Open
#2,866 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help_wanted
Dominant language
Java
Stars
831
Forks
330
Avg merge
3d 7h
Merged PRs (30d)
12

Description

I created a new Xtext project using Xtext 2.33.0 with the wizard: File > New > Other ... > Xtext Project

I can run the generated MyDslParsingTest inside Eclipse sucessfully ...
org.xtext.example.mydsl.parent\org.xtext.example.mydsl.tests\src\org\xtext\example\mydsl\tests\MyDslParsingTest.xtend

Package Explorer: Right Click > Run as > Junit Plug-In Test

However, if I run the Maven build it seems that no tests are run: mvn clean verify ...

[INFO] --- tycho-surefire:2.7.5:test (default-test) @ org.xtext.example.mydsl.tests ---
[INFO] Could not find a java toolchain of type jdk, using java from JAVA_HOME instead (C:\apps\jdk\openjdk11\bin\java.exe)
[INFO] Executing Test Runtime with timeout 0, logs (if any) will be placed at: C:\dev\eclipse-workspaces\xrm-dev\mydsl_2_33\org.xtext.example.mydsl\org.xtext.example.mydsl.parent\org.xtext.example.mydsl.tests\target\work\data\.metadata\.log
[INFO] Command line:
	[C:\apps\jdk\openjdk11\bin\java.exe, -Dosgi.noShutdown=false, -Dosgi.os=win32, -Dosgi.ws=win32, -Dosgi.arch=x86_64, --add-modules=ALL-SYSTEM, -Dosgi.clean=true, -jar, C:\Users\mira\.m2\repository\p2\osgi\bundle\org.eclipse.equinox.launcher\1.6.400.v20210924-0641\org.eclipse.equinox.launcher-1.6.400.v20210924-0641.jar, -data, C:\dev\eclipse-workspaces\xrm-dev\mydsl_2_33\org.xtext.example.mydsl\org.xtext.example.mydsl.parent\org.xtext.example.mydsl.tests\target\work\data, -install, C:\dev\eclipse-workspaces\xrm-dev\mydsl_2_33\org.xtext.example.mydsl\org.xtext.example.mydsl.parent\org.xtext.example.mydsl.tests\target\work, -configuration, C:\dev\eclipse-workspaces\xrm-dev\mydsl_2_33\org.xtext.example.mydsl\org.xtext.example.mydsl.parent\org.xtext.example.mydsl.tests\target\work\configuration, -application, org.eclipse.tycho.surefire.osgibooter.headlesstest, -testproperties, C:\dev\eclipse-workspaces\xrm-dev\mydsl_2_33\org.xtext.example.mydsl\org.xtext.example.mydsl.parent\org.xtext.example.mydsl.tests\target\surefire.properties]

Results:

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[WARNING] No tests found.

Now, if I modify MyDslParsingTest to have it failing, the maven build still succeeds. Is that behavior intentional ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with mvn clean verify in the generated project and inspect the org.xtext.example.mydsl.tests module, especially src/org/xtext/example/mydsl/tests/MyDslParsingTest.xtend. Then make the test fail and rerun the Maven build. Done means the test is discovered and a failing test causes the build to fail instead of reporting zero tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.