Skip to content
CodeKruPro

Read the Jenkins log: "No tests matching pattern"

QuizMediumAsked in: Capgemini, Google, Salesforce, TCS, Zupee

Read the log of a Jenkins job that takes parameters (settings chosen before the run).

console.log

+ mvn -B test -Dtest=LogInTest
[INFO] --- maven-surefire-plugin:3.5.4:test (default-test) @ ui-tests ---
[INFO] BUILD FAILURE
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.4:test (default-test) on project ui-tests: No tests matching pattern "LogInTest" were executed! (Set -Dsurefire.failIfNoSpecifiedTests=false to ignore this error.) -> [Help 1]
ERROR: script returned exit code 1
Finished: FAILURE

What is the most likely cause?

  • The test name passed to -Dtest is wrong (the class is called LoginTest), so no test matched and Surefire failed the build on purpose
  • All tests passed, but Jenkins is broken
  • Maven is not installed on the agent
  • The test class has a compilation error

This question is part of Pro+

Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.

See Pro+

Already have Pro+? Sign in