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

Upgrade POM (parent POM, minimum jenkins version, etc) #9

Merged
merged 7 commits into from
Oct 31, 2023

Conversation

lacostej
Copy link
Contributor

Testing done

This is a work-in-progress, and an attempt to see if the CI builds are still triggered for this plugin.

The only testing done right now are the unit tests. One of them isn't passing anymore so it will have to be fixed in subsequent commit.

Submitter checklist

Preview Give feedback

@gounthar
Copy link

Could anyone please replay this PR build with the updated Jenkinsfile?

@MarkEWaite
Copy link

Could anyone please replay this PR build with the updated Jenkinsfile?

Done

Copy link

@gounthar gounthar left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks a lot for the contribution. 👍
Windows build outputs [INFO] BUILD SUCCESS but is marked as failed. 🤔

java.lang.AssertionError: 
Expected 2-1:global-property:bar:anonymous in task output: [execute] $ cmd /c call C:\Jenkins\agent\workspace\Plugins_batch-task-plugin_PR-9\target\tmp\jenkins4380962449825284861.bat

C:\Jenkins\agent\workspace\Plugins_batch-task-plugin_PR-9\target\tmp\j h11703619928117714569\workspace\execute>echo "1-1:global-property:bar:anonymous" 
"1-1:global-property:bar:anonymous"

C:\Jenkins\agent\workspace\Plugins_batch-task-plugin_PR-9\target\tmp\j h11703619928117714569\workspace\execute>exit 0 

	at org.junit.Assert.fail(Assert.java:89)
	at org.junit.Assert.assertTrue(Assert.java:42)
	at hudson.plugins.batch_task.BatchTaskTest.testExecute(BatchTaskTest.java:105)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:655)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.lang.Thread.run(Thread.java:833)

@lacostej
Copy link
Contributor Author

2-1:global-property:bar:anonymous

Well this is weird. I had to change the test expectations in 0749269 to that the expected $TASK_ID in the string would match the output (on Mac/Linux).

This is because it appears that the tests scheduled 2 builds and then the build number is increased twice.

        p.scheduleBuild2(0);
        FreeStyleBuild freeStyleBuild = p.scheduleBuild2(0).get();

Is there anything obvious that would explain why on Windows the build number is only increased once?

This test code is 15 years old.

Remove the extra call to scheduleBuild2 and adjust expectations. Unsure why the test wasn't passing on Windows
@lacostej lacostej merged commit 6b8e139 into jenkinsci:master Oct 31, 2023
@lacostej lacostej deleted the fix/upgrade_dependencies branch October 31, 2023 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants