Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

MockUpdateCenter should only be installed if the current UC is the default #636

Merged
merged 2 commits into from
Feb 3, 2021

Conversation

fcojfernandez
Copy link
Member

MockUpdateCenter should check that the default Update Site is configured in the Update Center page in a similar way that it's already checking that only one Update Site is configured.

@jtnord @amuniz

@jtnord jtnord added the bug label Feb 1, 2021
@jtnord jtnord changed the title Mock only default UC MockUpdateCenter should only be installed if the current UC is the default Feb 1, 2021
@jtnord jtnord requested a review from jglick February 1, 2021 16:09
@jtnord jtnord closed this Feb 1, 2021
@jtnord jtnord reopened this Feb 1, 2021
Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe? I have little recollection now of how this stuff works (it has gone back and forth a bunch of times), and certainly no knowledge of how it would or would not work with a nondefault (or multiple) UC definition.

@jglick
Copy link
Member

jglick commented Feb 1, 2021

@jtnord jtnord reopened this 1 minute ago

BTW you can request a rerun from the Checks tab.

@fcojfernandez
Copy link
Member Author

Analysis of the failing tests:

  • They are the same 99 failures that I had in jenkins.getCurrentUser() can use an incorrect context #632
  • Stacktraces from the tests are not showing any line related to PluginManager, WithPlugins or MockUpdateCenter classes except on WorkflowPluginTest.parallelTests
  • A local execution of WorkflowPluginTest.parallelTests reproduces the test failure and it's got nothing to do with this PR:
    • The mention of WithPlugins class in the Stacktrace is because that test method is annotated with @WithPlugins
    • The same execution with master branch instead of this PR throws the same error

The stacktrace in case someone wants to

java.lang.AssertionError: 
Expected: Build result UNSTABLE
     but: was FAILURE. Console output:
Started by user unknown or anonymous
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in /home/fcojfernandez/Desarrollo/Repositorios/acceptance-test-harness/target/jenkins1319395064987007676home/workspace/violent_estimate
[Pipeline] {
[Pipeline] git
The recommended git tool is: NONE
No credentials specified
Cloning the remote Git repository
Cloning repository https://github.com/jenkinsci/parallel-test-executor-plugin-sample.git
 > git init /home/fcojfernandez/Desarrollo/Repositorios/acceptance-test-harness/target/jenkins1319395064987007676home/workspace/violent_estimate # timeout=10
Fetching upstream changes from https://github.com/jenkinsci/parallel-test-executor-plugin-sample.git
 > git --version # timeout=10
 > git --version # 'git version 2.17.1'
 > git fetch --tags --progress -- https://github.com/jenkinsci/parallel-test-executor-plugin-sample.git +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git config remote.origin.url https://github.com/jenkinsci/parallel-test-executor-plugin-sample.git # timeout=10
 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
Avoid second fetch
 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
Checking out Revision b18ad9b7a06d278bb17b2d6bc5c3bb8a259c720d (refs/remotes/origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f b18ad9b7a06d278bb17b2d6bc5c3bb8a259c720d # timeout=10
 > git branch -a -v --no-abbrev # timeout=10
 > git checkout -b master b18ad9b7a06d278bb17b2d6bc5c3bb8a259c720d # timeout=10
Commit message: "Merge pull request #2 from olivergondza/bump-java-version"
First time build. Skipping changelog.
[Pipeline] stash
Stashed 170 file(s)
[Pipeline] }
[Pipeline] // node
[Pipeline] splitTests
No record available, try to find test classes
No test classes was found, so executing everything in one place
[Pipeline] parallel
[Pipeline] { (Branch: split0)
[Pipeline] node
Running on express_shop in /tmp/express_shop/workspace/violent_estimate
[Pipeline] {
[Pipeline] sh
+ rm -rf *
[Pipeline] unstash
[Pipeline] writeFile
[Pipeline] sh
+ mvn -B -Dmaven.test.failure.ignore test
/tmp/express_shop/workspace/violent_estimate@tmp/durable-1e0fcfec/script.sh: 1: /tmp/express_shop/workspace/violent_estimate@tmp/durable-1e0fcfec/script.sh: mvn: not found
[Pipeline] }
[Pipeline] // node
[Pipeline] }
Failed in branch split0
[Pipeline] // parallel
[Pipeline] End of Pipeline
ERROR: script returned exit code 127
Finished: FAILURE
<Click to see difference>


	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:8)
	at org.jenkinsci.test.acceptance.po.Build.shouldBeUnstable(Build.java:231)
	at plugins.WorkflowPluginTest.parallelTests(WorkflowPluginTest.java:203)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.jenkinsci.test.acceptance.junit.WithPlugins$RuleImpl$1.evaluate(WithPlugins.java:164)
	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
	at org.jenkinsci.test.acceptance.junit.JenkinsAcceptanceTestRule$1$2$1.evaluate(JenkinsAcceptanceTestRule.java:168)
	at org.jenkinsci.test.acceptance.junit.FilterRule$1.evaluate(FilterRule.java:63)
	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:61)
	at org.jenkinsci.test.acceptance.junit.JenkinsAcceptanceTestRule$1.evaluate(JenkinsAcceptanceTestRule.java:58)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)

and the code causing the error:

        Build build = job.startBuild();
        try {
            build.shouldSucceed();
        } catch (AssertionError x) { // cf. linearFlow
            build.shouldBeUnstable();
        }

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should do the job. A better warning message could be useful, but totally optional

…UpdateCenter.java

Co-authored-by: Oleg Nenashev <o.v.nenashev@gmail.com>
@jtnord jtnord merged commit 6f2ae61 into jenkinsci:master Feb 3, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants