-
Notifications
You must be signed in to change notification settings - Fork 66
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
[JENKINS-51183] - Introduce Integration testing flow with BOM #20
Changes from 1 commit
f5d5968
c9eee6c
76c5e0c
11bdec7
410f446
42771f3
3dc7ccc
fc7af4b
a8a9bdc
7efa8fd
3159cd4
772444c
7356475
23084cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
metadata: | ||
# labels and annotations are key: value string attributes | ||
labels: | ||
name: bom-it | ||
# Needed to make PCT happy | ||
groupId: org.jenkins-ci.main | ||
artifactId: jenkins-war | ||
version: 2.118-artifact-manager-s3-SNAPSHOT | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need to specify a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Current BOM specification seems to require this field. jenkins-infra/pipeline-library#57 actually runs without it, but it will set |
||
spec: | ||
core: | ||
version: 2.118 | ||
plugins: | ||
- groupId: "org.jenkins-ci.plugins.workflow" | ||
artifactId: "workflow-api" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So this is duplicating information: the I think this is a fundamental flaw in the idea of using a BOM in individual repos for integration tests (as opposed to the overall To me it seems more comfortable for the POM to specify details of artifacts and their versions, and for the BOM to express additional information, if any—perhaps just delete the And that would also bypass the “filesystem ref” problem mentioned below. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I could create a "POM to BOM" tool which dumps a YAML with all HPI dependencies in the plugin and adds them to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
My point is that there would be nothing in such a template! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Of course we can do it if needed, in the most of the cases |
||
version: 2.28-rc333.0675e9e9cb4c | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. jenkinsci/jep#92 (comment) FTR: branch: jglick:VirtualFile-JENKINS-49635 would be useful here in addition to the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only for cosmetic reasons, right? When |
||
- groupId: "org.jenkins-ci.plugins" | ||
artifactId: "copyartifact" | ||
version: 1.40-rc298.60da56cfabea | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1.40 |
||
# Maven HPI Plugin improperly resolves dependency trees, needs upper bounds check | ||
- groupId: "org.jenkins-ci.plugins" | ||
artifactId: "structs" | ||
version: 1.14 | ||
- groupId: "org.jenkins-ci.plugins.workflow" | ||
artifactId: "workflow-step-api" | ||
version: 2.14 | ||
- groupId: "org.jenkins-ci.plugins.workflow" | ||
artifactId: "workflow-job" | ||
version: 2.20 | ||
- groupId: "org.jenkins-ci.plugins.workflow" | ||
artifactId: "workflow-basic-steps" | ||
version: 2.7 | ||
- groupId: "org.jenkins-ci.plugins.workflow" | ||
artifactId: "workflow-support" | ||
version: 2.18 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently have an incremental version of this one actually. |
||
- groupId: "org.jenkins-ci.plugins" | ||
artifactId: "junit" | ||
version: 1.24 | ||
- groupId: "org.jenkins-ci.plugins" | ||
artifactId: "mailer" | ||
version: 1.21 | ||
- groupId: "org.jenkins-ci.plugins" | ||
artifactId: "scm-api" | ||
version: 2.2.7 | ||
- groupId: "org.jenkins-ci.plugins" | ||
artifactId: "script-security" | ||
version: 1.44 | ||
- groupId: "org.jenkins-ci.plugins" | ||
artifactId: "aws-java-sdk" | ||
version: 1.11.264 | ||
environments: | ||
- name: aws | ||
plugins: | ||
#TODO: BOM does not support FileSystem REFs, so somebody needs to add BOM auto-update logic here | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Uh, no, updating the BOM would not make sense here, because presumably you wish for the integration tests to be run as part of this plugin’s PR builds. So to verify some change in the plugin against these other tests, you would need to commit the change, then update the version here and commit again, before filing the PR! Does not make sense. We could allow version: 1.0-alpha-1${changelist} but this would need to be updated after every MRP usage, which is still awkward. Filesystem path references could help, but it needs some exploration what they would look like. One option is versionFrom: ../../../.flattened-pom.xml assuming the local versionFrom: ../../.. where the version is inferred from the output of mvn -Dset.changelist -Dexpression=project.version -Doutput=version help:evaluate
version=`cat version`
rm version
echo $version There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, whatever works. I could easily do it in the custom WAR packager spec, but BOM would require a whatever standardized definition in jenkinsci/jep#92 |
||
- groupId: "io.jenkins.plugins" | ||
artifactId: "artifact-manager-s3" | ||
version: 1.0-alpha-1-rc20.60688a35a736 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
packaging: | ||
bom: bom.yml | ||
environment: aws | ||
config: | ||
bundle: | ||
vendor: "Jenkins project" | ||
title: "Jenkins WAR - Artifact Manager S3 Integration Tests" | ||
description: "Demo build, which includes Artifact Manager S3 and plugins using ArtifactManager API for testing" | ||
groovyHooks: | ||
- type: "init" | ||
id: "initScripts" | ||
source: | ||
dir: src/main/groovy | ||
ath: | ||
disabled: true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does this attribute need to exist? Why not just comment out the whole There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, you can do that if you want |
||
useLocalSnapshots: false | ||
tests: | ||
- "core.ArtifactsTest" | ||
- "plugins.CopyArtifactPluginTest" | ||
- "plugins.CompressArtifactsPluginTest" | ||
- "plugins.WorkflowPluginTest" | ||
- "plugins.WorkflowMultibranchTest" | ||
categories: | ||
- "org.jenkinsci.test.acceptance.junit.SmokeTest" | ||
pct: | ||
disabled: true | ||
useLocalSnapshots: false | ||
jth: | ||
version: 2.38 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Delete. |
||
passCustomJenkinsWAR: true | ||
plugins: | ||
- "copyartifact" | ||
- "workflow-job" | ||
- "workflow-basic-steps" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import jenkins.model.ArtifactManagerConfiguration | ||
import io.jenkins.plugins.artifact_manager_s3.JCloudsArtifactManager | ||
import io.jenkins.plugins.artifact_manager_s3.JCloudsArtifactManagerFactory | ||
|
||
// Predefine storage and prefix when run in test on AWS | ||
if (Boolean.getBoolean("artifact-manager-s3.enabled")) { | ||
println("--- Enabling default artifact storage: ${factory.descriptor.displayName}") | ||
|
||
def factory = new JCloudsArtifactManagerFactory(); | ||
ArtifactManagerConfiguration.get().artifactManagerFactories.add(factory) | ||
JCloudsArtifactManager.@BLOB_CONTAINER = "artifact-manager-s3" | ||
JCloudsArtifactManager.@PREFIX = "integration-tests/" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this
baseDir
could just be the default?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure. In some cases essentials.yml is located in the root (e.g. Core or Git Plugin). CC @raul-arabaolaza . Currently I use root dir as a default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also use root dir as the default (and is the default location used by pipeline-library) but there is no strong technical reason for that, note that in any case any path can be used as is a param of the step itself