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

"No test results found" #315

Open
corentone opened this issue Jul 23, 2015 · 18 comments
Open

"No test results found" #315

corentone opened this issue Jul 23, 2015 · 18 comments

Comments

@corentone
Copy link

Hello,
I've been successfully using ghprb and I am pretty happy with it!
One weird think I am getting is the "No test result found".

I found the correct line for where this gets used:

This test result seems like a good idea and I'd like to use it. How do I generate the correct test results?
Also, do you know if it would be possible to include the duration of the test in the first part of the message (that I was able to customize with a build-trigger for SUCCESS).

Thanks for that plugin anyway!
Co

@apexskier
Copy link

I'm having the same problem. I'm using JUnit plugin, but I did have to downgrade to version 1.0 because of another error.

I get this job console output:

<...>
Running tests...
----------------------------------------------------------------------
.......
----------------------------------------------------------------------
Ran 7 tests in 0.004s

OK

Generating XML reports...
Setting commit status on GitHub for https://github.com/<...>
Setting status of <sha> to SUCCESS with url <job url> and message: 'Build finished. No test results found.'
Using context: <context>
Finished: SUCCESS

Jenkin's server logs show this:

Aug 04, 2015 2:19:34 PM javax.jmdns.impl.DNSIncoming readAnswer
WARNING: There was an OPT answer. Not currently handled. Option code: 65002 data: 83CBF4C59F040199
Aug 04, 2015 2:19:58 PM javax.jmdns.impl.DNSIncoming readAnswer
WARNING: There was an OPT answer. Not currently handled. Option code: 65002 data: A2F59F1EC50EB515
Aug 04, 2015 2:20:17 PM hudson.model.Run execute
INFO: core_all_pull_requests #26 main build action completed: SUCCESS

(I'm pretty sure the OPT stuff is unrelated)

EDIT: My JUnit stuff is working otherwise, as the xml is being parsed correctly and spit into a graph correctly.

@mbentley
Copy link

This seems to happen for me as well with Jenkins 1.624 and GitHub Pull Request Builder 1.26.2, not sure if the Jenkins version has anything to do with it.

If I manually run a job by passing it a build parameter, it will ignore my custom Commit Status Context but it reports the build number and length of time it took to build (e.g. - default Build #4 succeeded in 2 min 26 sec). When triggered by GitHub, it uses my custom Commit Status Context but I get 'Build finished. No test results found.' instead.

@tomasfejfar
Copy link

Same here.

@jsight
Copy link

jsight commented Oct 20, 2015

This looks like a bug to me. Previously the code should have called build.getTestResultAction(), however that is now deprecated. Now the code should call build.getAction(AbstractTestResultAction.class).

The problem is that the code calls build.getAction(TestResultAction.class), but this isn't present in the build result in some cases. In my case, only a AggregatedTestResultAction is available. Thus the code for aggregated results works, but the code for the one line summary does not.

@jameschao
Copy link

Having the same problem here...

@jsight - do you know have a fix? :)

@nathantubb
Copy link

Just ran into this same issue on Jenkins 1.625 Plugin 1.29.4. Hoping there is a fix soon. @jsight - submit a pull request with the fix you mentioned?

@slaunay
Copy link
Contributor

slaunay commented Nov 25, 2015

Version 1.29.5 fixed the issue by applying @jsight suggested code change: Build finished. 132 tests run, 0 skipped, 0 failed.
I believe this ticket can be closed now.

@jameschao
Copy link

Hi @slaunay - thanks. I just tested with the new version but still seeing the issue...

@slaunay
Copy link
Contributor

slaunay commented Nov 25, 2015

@jameschao what kind of test report are you using in your job?

@jameschao
Copy link

Hm, I didn't explicitly set the report type for the job (maybe that's the problem?).

It's just a custom test runner script for the app that I run in one of the Build Steps. Previously, GHPRB would report "Test PASSed" or "Test FAILed" depending on the exit code of the script/Build Step. Is that not sufficient?

@slaunay
Copy link
Contributor

slaunay commented Nov 25, 2015

I believe the status code of your script should dictate if the build passes or fails but the test results are only available if you are using a test report facility (e.g. Maven) or at least something that populates an AbstractTestResultAction in the build object.

@jameschao
Copy link

OK I'll give that a try. Thanks.

@alfredodeza
Copy link

We are using v1.29.7 and are seeing the same thing even though we are explicitly setting the "Commit status Build result" message.

We aren't running tests that can produce JUnit xml files and we aren't using any test reporting facility because we don't need to. The script that performs this check does exit with a non-zero status code when it fails.

What, if anything, can we do to avoid having "No test results found" in the notification box?

@mrchief
Copy link

mrchief commented Jan 20, 2016

I'm using 1.29.8 and I don't see reports. I'm using mocha to run tests:

  "scripts": {
    "test": "mocha --compilers js:babel-core/register src/**/*spec.js"
  },

Given that mocha has a wide array of reporters, is there a way to use any of them for reporting the status in way that's understandable by ghprb?

@mrchief
Copy link

mrchief commented Jan 20, 2016

Ok, I tried mocha-junit-reporter which produces JUnit style xml but still no luck.

@alfredodeza
Copy link

We are now using other scripts that rely on non-zero exit codes to signal a failure and we are hitting this issue again. The plugin should not force the use of junit to report back the status on the Pull Request.

Any workarounds or suggestions to be able to not have that status as "no tests results found" would be great

alfredodeza referenced this issue in alfredodeza/ghprb Feb 1, 2016
Because otherwise it will force users to have a junit file to be able
to report on tests run/failed/skipped. This is not always available and it is
entirely optional (vs. just handling a non-zero exit status as a failure).

Fixes Issue jenkinsci#315
@DavidTanner
Copy link
Collaborator

So in order to get test results a Test action has to be present on the build. Without that it will always return the No Tests found text. I just added a PR that would turn off the test result text by default, and allows you to specify if results should be added. jenkinsci#280

mmitche referenced this issue in mmitche/ghprb Apr 12, 2016
@kartnan
Copy link

kartnan commented Mar 9, 2022

So in order to get test results a Test action has to be present on the build. Without that it will always return the No Tests found text. I just added a PR that would turn off the test result text by default, and allows you to specify if results should be added. jenkinsci#280

I use pytest to run some tests in a pipeline stage. There are some passed and failed tests. But AbstractTestResultAction returns No tests found!

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

No branches or pull requests