Skip to content

Commit b1a05c7

Browse files
committed
testing jenkins file handling in CSD
1 parent 633fa62 commit b1a05c7

1 file changed

Lines changed: 72 additions & 0 deletions

File tree

testHeadlessComponents.jenkins

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
properties([
2+
parameters([
3+
string(name: 'executionId', defaultValue: UUID.randomUUID().toString(), description: 'Unique execution ID'),
4+
string(name: 'ebcShortlist', defaultValue: 'rh-openjdk-qe-jenkins.yml',
5+
description: 'This controls the EBC shortlist to use when provisioning a Jenkins node.'),
6+
string(name: 'ecosystemTracking', defaultValue: "",
7+
description: 'Tracking Map as string often containing information about CI Orchestrator pipeline'),
8+
string(name: 'JENKINS_JOBS_BRANCH', defaultValue: 'dev', description: 'Branch of Jenkins jobs to use for scripts execution'),
9+
string(name: 'JENKINS_JOBS_ORG', defaultValue: 'cognitive-software-delivery', description: 'GitHub Org of Jenkins jobs to use for scripts execution'),
10+
string(name: 'TEST_SUITE_BRANCH', defaultValue: 'main', description: 'Branch to test'),
11+
string(name: 'TEST_SUITE_URL',
12+
defaultValue: 'git@github.com:rh-openjdk/TestHeadlessComponents.git',
13+
description: 'URL to download for prepared suites'),
14+
string(name: 'OJDK_VERSION_NUMBER'
15+
defaultValue: '21',
16+
description: 'Numerical value of JDK to be tested.'),
17+
string(name: 'JREJDK',
18+
defaultValue: 'jdk',
19+
description: 'Determines whether we test jre or jdk installation.'),
20+
string(name: 'TEST_COMMAND',
21+
defaultValue: 'export TMPRESULTS=$(Q)$(REPORTDIR)$(D)report$(Q); \
22+
bash $(TEST_ROOT)$(D)functional$(D)testHeadlessComponents$(D)TestHeadlessComponents$(D)testHeadlessComponents.sh;',
23+
description: 'Test command to execute on the target machine'),
24+
string(name: 'FILE_SERVER', defaultValue: 'libertyfs.hursley.ibm.com',
25+
description: 'File server where the final results and artifacts will be stored for Cognitive UI'),
26+
string(name: 'JVM_UNDER_TEST_PATH', defaultValue: '/liberty/jvms/linux_x86_64/redhatjdk_21.0.8/java-21-openjdk-21.0.8.0.9-1.portable.jdk.x86_64.tar.xz',
27+
description: 'The location on the fileserver to find the java we want to test against'),
28+
string(name: 'REPORTING_JVM', defaultValue: 'REDHAT_JDK_21',
29+
description: 'The JVM value to report to cognitive')
30+
])
31+
])
32+
33+
timestamps {
34+
library 'jenkins-ci-websphere'
35+
36+
if (shouldSkipDueToSeedJob()) {
37+
return;
38+
}
39+
40+
try {
41+
println "Requesting node from " + params.ebcShortlist + " with demand ID " + params.executionId
42+
onEBC(
43+
demandId: params.executionId,
44+
ebcShortlist: params.ebcShortlist,
45+
ebcPriority: params.ebcPriority,
46+
autoCompleteAfterXHours: 24
47+
) {
48+
stage('testsuite-clone') {
49+
reportActivity(name: 'testsuite-clone', executionId: params.executionId) {
50+
println "Cloning the ${params.TEST_SUITE_URL} repo, branch ${params.TEST_SUITE_BRANCH}"
51+
git branch: "${params.TEST_SUITE_BRANCH}", url: "${params.TEST_SUITE_URL}"
52+
}
53+
}
54+
55+
stage('testsuite-run') {
56+
sh "git clone git@github.ibm.com:${params.JENKINS_JOBS_ORG}/rh-openjdk-qe-jenkins-config.git --branch ${params.JENKINS_JOBS_BRANCH} --single-branch --depth=1 quarkus-qe-jenkins-jobs"
57+
reportActivity(name: 'setup-jvm', executionId: params.executionId) {
58+
// Download and extract java under test
59+
withCredentials([usernamePassword(credentialsId: "intranetId", usernameVariable: 'intranetId_USR', passwordVariable: 'intranetId_PSW')]) {
60+
echo "Hi!"
61+
}
62+
}
63+
}
64+
65+
}
66+
67+
} finally {
68+
node (label: 'built-in') {
69+
cleanupWorkspace()
70+
}
71+
}
72+
}

0 commit comments

Comments
 (0)