diff --git a/JenkinsJobs/AutomatedTests/I_unit_linux.groovy b/JenkinsJobs/AutomatedTests/I_unit_linux.groovy deleted file mode 100644 index 9ad88881e8c..00000000000 --- a/JenkinsJobs/AutomatedTests/I_unit_linux.groovy +++ /dev/null @@ -1,107 +0,0 @@ -def config = new groovy.json.JsonSlurper().parseText(readFileFromWorkspace('JenkinsJobs/JobDSL.json')) -def STREAMS = config.Streams -def JAVA_VERSIONS = ['21', '23'] - -def BUILD_CONFIGURATIONS = [ - [javaVersion: 21, javaHome: "tool(type:'jdk', name:'temurin-jdk21-latest')" ], - [javaVersion: 23, javaHome: "installJDK('23', 'linux', 'x86_64', 'ea')" ] -] - -for (STREAM in STREAMS){ - def MAJOR = STREAM.split('\\.')[0] - def MINOR = STREAM.split('\\.')[1] - for (BUILD_CONFIG in BUILD_CONFIGURATIONS){ - - pipelineJob('AutomatedTests/ep' + MAJOR + MINOR + 'I-unit-linux-x86_64-java' + BUILD_CONFIG.javaVersion){ - description('Run Eclipse SDK Tests for the platform implied by this job\'s name') - parameters { // Define parameters in job configuration to make them available from the very first build onwards - stringParam('buildId', null, 'Build Id to test (such as I20240611-1800, N20120716-0800).') - } - - definition { - cps { - sandbox() - script(''' -pipeline { - options { - timeout(time: 600, unit: 'MINUTES') - timestamps() - buildDiscarder(logRotator(numToKeepStr:'15', artifactNumToKeepStr:'5')) - } - agent { - label 'ubuntu-2404' - } - - stages { - stage('Run tests'){ - environment { - // Declaring a jdk and ant the usual way in the 'tools' section, because of unknown reasons, breaks the usage of system commands like xvnc, pkill and sh - JAVA_HOME = ''' + BUILD_CONFIG.javaHome + ''' - ANT_HOME = tool(type:'ant', name:'apache-ant-latest') - PATH = "${JAVA_HOME}/bin:${ANT_HOME}/bin:${PATH}" - ANT_OPTS = "-Djava.io.tmpdir=${WORKSPACE}/tmp" - } - steps { - xvnc(useXauthority: true) { - sh \'\'\'#!/bin/bash -x - - buildId=$(echo $buildId|tr -d ' ') - export LANG=en_US.UTF-8 - cat /etc/*release - echo "whoami: $(whoami)" - echo "uname -a: $(uname -a)" - - # 0002 is often the default for shell users, but it is not when ran from - # a cron job, so we set it explicitly, to be sure of value, so releng group has write access to anything - # we create on shared area. - oldumask=$(umask) - umask 0002 - echo "umask explicitly set to 0002, old value was $oldumask" - - # we want java.io.tmpdir to be in $WORKSPACE, but must already exist, for Java to use it. - mkdir -p tmp - - curl -o getEBuilder.xml https://download.eclipse.org/eclipse/relengScripts/testScripts/bootstrap/getEBuilder.xml - - echo JAVA_HOME: $JAVA_HOME - echo ANT_HOME: $ANT_HOME - echo PATH: $PATH - - env 1>envVars.txt 2>&1 - ant -diagnostics 1>antDiagnostics.txt 2>&1 - java -XshowSettings -version 1>javaSettings.txt 2>&1 - - ant -f getEBuilder.xml -DbuildId=${buildId} \\ - -Dosgi.os=linux -Dosgi.ws=gtk -Dosgi.arch=x86_64 \\ - -DtestSuite=all - # For smaller test-suites see: https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/blob/be721e33c916b03c342e7b6f334220c6124946f8/production/testScripts/configuration/sdk.tests/testScripts/test.xml#L1893-L1903 - \'\'\' - } - archiveArtifacts '**/eclipse-testing/results/**, **/eclipse-testing/directorLogs/**, *.properties, *.txt' - junit keepLongStdio: true, testResults: '**/eclipse-testing/results/xml/*.xml' - build job: 'Releng/ep-collectResults', wait: false, parameters: [ - string(name: 'triggeringJob', value: "${JOB_BASE_NAME}"), - string(name: 'buildURL', value: "${BUILD_URL}"), - string(name: 'buildID', value: "${params.buildId}") - ] - } - } - } -} - -def installJDK(String version, String os, String arch, String releaseType='ga') { - // Translate os/arch names that are different in the Adoptium API - if (arch == 'x86_64') { - arch == 'x64' - } - dir ("${WORKSPACE}/java") { - sh "curl -L https://api.adoptium.net/v3/binary/latest/${version}/${releaseType}/${os}/${arch}/jdk/hotspot/normal/eclipse | tar -xzf -" - return "${pwd()}/" + sh(script: 'ls', returnStdout: true).strip() - } -} -''') - } - } - } -} -} diff --git a/JenkinsJobs/AutomatedTests/I_unit_mac.groovy b/JenkinsJobs/AutomatedTests/I_unit_mac.groovy deleted file mode 100644 index 22106216954..00000000000 --- a/JenkinsJobs/AutomatedTests/I_unit_mac.groovy +++ /dev/null @@ -1,89 +0,0 @@ -def config = new groovy.json.JsonSlurper().parseText(readFileFromWorkspace('JenkinsJobs/JobDSL.json')) -def STREAMS = config.Streams - -def ARCHS = ['aarch64', 'x86_64'] -def ARCHS_AGENT_LABEL = ['aarch64': 'nc1ht-macos11-arm64', 'x86_64': 'nc1ht-macos11-arm64'] -def ARCHS_JAVA_HOME = ['aarch64': '/Library/Java/JavaVirtualMachines/jdk-21.0.5+11-arm64/Contents/Home', 'x86_64': '/Library/Java/JavaVirtualMachines/jdk-21.0.5+11/Contents/Home'] - -for (STREAM in STREAMS){ -for (ARCH in ARCHS){ - def MAJOR = STREAM.split('\\.')[0] - def MINOR = STREAM.split('\\.')[1] - - pipelineJob('AutomatedTests/ep' + MAJOR + MINOR + 'I-unit-macosx-' + ARCH + '-java21'){ - description('Run Eclipse SDK Tests for the platform implied by this job\'s name') - parameters { // Define parameters in job configuration to make them available from the very first build onwards - stringParam('buildId', null, 'Build Id to test (such as I20240611-1800, N20120716-0800).') - } - - definition { - cps { - sandbox() - script(''' -pipeline { - options { - timeout(time: 600, unit: 'MINUTES') - timestamps() - buildDiscarder(logRotator(numToKeepStr:'15', artifactNumToKeepStr:'5')) - } - agent { - label \'''' + ARCHS_AGENT_LABEL[ARCH] + '''' - } - - stages { - stage('Run tests'){ - environment { - // Declaring a jdk and ant the usual way in the 'tools' section, because of unknown reasons, breaks the usage of system commands like xvnc, pkill and sh - JAVA_HOME = \'''' + ARCHS_JAVA_HOME[ARCH] + '''' - ANT_HOME = tool(type:'ant', name:'apache-ant-latest') - PATH = "${JAVA_HOME}/bin:${ANT_HOME}/bin:${PATH}" - ANT_OPTS = "-Djava.io.tmpdir=${WORKSPACE}/tmp" - } - steps { - cleanWs() // workspace not cleaned by default - sh \'\'\'#!/bin/bash -x -echo " whoami: $(whoami)" -echo " uname -a: $(uname -a)" - -# 0002 is often the default for shell users, but it is not when ran from -# a cron job, so we set it explicitly, to be sure of value, so releng group has write access to anything -# we create on shared area. -oldumask=$(umask) -umask 0002 -echo "umask explicitly set to 0002, old value was $oldumask" - -# we want java.io.tmpdir to be in $WORKSPACE, but must already exist, for Java to use it. -mkdir -p tmp - -curl -o getEBuilder.xml https://download.eclipse.org/eclipse/relengScripts/testScripts/bootstrap/getEBuilder.xml - -echo JAVA_HOME: $JAVA_HOME -echo ANT_HOME: $ANT_HOME -echo PATH: $PATH - -env 1>envVars.txt 2>&1 -ant -diagnostics 1>antDiagnostics.txt 2>&1 -java -XshowSettings -version 1>javaSettings.txt 2>&1 - -ant -f getEBuilder.xml -DbuildId=${buildId} \\ - -Dosgi.os=macosx -Dosgi.ws=cocoa -Dosgi.arch=''' + ARCH + ''' \\ - -DtestSuite=all -# For smaller test-suites see: https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/blob/be721e33c916b03c342e7b6f334220c6124946f8/production/testScripts/configuration/sdk.tests/testScripts/test.xml#L1893-L1903 - \'\'\' - archiveArtifacts '**/eclipse-testing/results/**, **/eclipse-testing/directorLogs/**, *.properties, *.txt' - junit keepLongStdio: true, testResults: '**/eclipse-testing/results/xml/*.xml' - build job: 'Releng/ep-collectResults', wait: false, parameters: [ - string(name: 'triggeringJob', value: "${JOB_BASE_NAME}"), - string(name: 'buildURL', value: "${BUILD_URL}"), - string(name: 'buildID', value: "${params.buildId}") - ] - } - } - } -} - ''') - } - } - } -} -} diff --git a/JenkinsJobs/AutomatedTests/I_unit_tests.groovy b/JenkinsJobs/AutomatedTests/I_unit_tests.groovy new file mode 100644 index 00000000000..ae8b04ad4d2 --- /dev/null +++ b/JenkinsJobs/AutomatedTests/I_unit_tests.groovy @@ -0,0 +1,142 @@ +def config = new groovy.json.JsonSlurper().parseText(readFileFromWorkspace('JenkinsJobs/JobDSL.json')) +def STREAMS = config.Streams + +def TEST_CONFIGURATIONS = [ + [os: 'linux' , ws:'gtk' , arch: 'x86_64' , javaVersion: 21, agentLabel: 'ubuntu-2404' , javaHome: "tool(type:'jdk', name:'temurin-jdk21-latest')" ], + [os: 'linux' , ws:'gtk' , arch: 'x86_64' , javaVersion: 23, agentLabel: 'ubuntu-2404' , javaHome: "installTemurinJDK('23', 'linux', 'x86_64', 'ea')" ], + [os: 'macosx', ws:'cocoa', arch: 'aarch64', javaVersion: 21, agentLabel: 'nc1ht-macos11-arm64', javaHome: "'/Library/Java/JavaVirtualMachines/jdk-21.0.5+11-arm64/Contents/Home'" ], + [os: 'macosx', ws:'cocoa', arch: 'x86_64' , javaVersion: 21, agentLabel: 'nc1ht-macos11-arm64', javaHome: "'/Library/Java/JavaVirtualMachines/jdk-21.0.5+11/Contents/Home'" ], + [os: 'win32' , ws:'win32', arch: 'x86_64' , javaVersion: 21, agentLabel: 'qa6xd-win11' , javaHome: "'C:\\\\Program Files\\\\Eclipse Adoptium\\\\jdk-21.0.5.11-hotspot'" ], +] + +for (STREAM in STREAMS){ + def MAJOR = STREAM.split('\\.')[0] + def MINOR = STREAM.split('\\.')[1] + for (TEST_CONFIG in TEST_CONFIGURATIONS){ + + pipelineJob('AutomatedTests/ep' + MAJOR + MINOR + 'I-unit-' + TEST_CONFIG.os + '-' + TEST_CONFIG.arch + '-java' + TEST_CONFIG.javaVersion){ + description('Run Eclipse SDK Tests for the platform implied by this job\'s name') + parameters { // Define parameters in job configuration to make them available from the very first build onwards + stringParam('buildId', null, 'Build Id to test (such as I20240611-1800, N20120716-0800).') + } + + definition { + cps { + sandbox() + script(''' +pipeline { + options { + timeout(time: 600, unit: 'MINUTES') + timestamps() + buildDiscarder(logRotator(numToKeepStr:'15', artifactNumToKeepStr:'5')) + } + agent { + label \'''' + TEST_CONFIG.agentLabel + '''' + } + stages { + stage('Clean Workspace'){ + steps { // workspace is not always cleaned by default. Clean before custom tools are installed into workspace. + cleanWs() + } + } + stage('Run tests'){ + environment { + // Declaring a jdk and ant the usual way in the 'tools' section, because of unknown reasons, breaks the usage of system commands like xvnc, pkill and sh + JAVA_HOME = ''' + TEST_CONFIG.javaHome + ''' + ANT_HOME = tool(type:'ant', name:'apache-ant-latest') + PATH = [pathOf("${JAVA_HOME}/bin"), pathOf("${ANT_HOME}/bin"), env.PATH].join(isUnix() ? ':' : ';') + ANT_OPTS = "-Djava.io.tmpdir=${pathOf(env.WORKSPACE+'/tmp')}" + } + steps {''' + { + if(TEST_CONFIG.os == 'linux' || TEST_CONFIG.os == 'macosx') { + def runTestsScript = ''' + sh \'\'\'#!/bin/bash -x + export LANG=en_US.UTF-8 + echo " whoami: $(whoami)" + echo " uname -a: $(uname -a)" + + # 0002 is often the default for shell users, but it is not when ran from + # a cron job, so we set it explicitly, to be sure of value, so releng group has write access to anything + # we create on shared area. + oldumask=$(umask) + umask 0002 + echo "umask explicitly set to 0002, old value was $oldumask" + + # we want java.io.tmpdir to be in $WORKSPACE, but must already exist, for Java to use it. + mkdir -p tmp + + curl -o getEBuilder.xml https://download.eclipse.org/eclipse/relengScripts/testScripts/bootstrap/getEBuilder.xml + + echo JAVA_HOME: $JAVA_HOME + echo ANT_HOME: $ANT_HOME + echo PATH: $PATH + + env 1>envVars.txt 2>&1 + ant -diagnostics 1>antDiagnostics.txt 2>&1 + java -XshowSettings -version 1>javaSettings.txt 2>&1 + + ant -f getEBuilder.xml -DbuildId=${buildId} \\ + -Dosgi.os=''' + TEST_CONFIG.os + ' -Dosgi.ws=' + TEST_CONFIG.ws + ' -Dosgi.arch=' + TEST_CONFIG.arch + ''' \\ + -DtestSuite=all + \'\'\'''' + return TEST_CONFIG.os == 'linux' ? """ + xvnc(useXauthority: true) {${runTestsScript} + }""" : runTestsScript + } else if(TEST_CONFIG.os == 'win32') { + return ''' + bat \'\'\' + @REM tmp must already exist, for Java to make use of it, in subsequent steps + mkdir tmp + + curl -o getEBuilder.xml https://download.eclipse.org/eclipse/relengScripts/testScripts/bootstrap/getEBuilder.xml + + echo JAVA_HOME: %JAVA_HOME% + echo ANT_HOME: %ANT_HOME% + echo PATH: %PATH% + + env 1>envVars.txt 2>&1 + cmd /c ant -diagnostics 1>antDiagnostics.txt 2>&1 + java -XshowSettings -version 1>javaSettings.txt 2>&1 + + ant -f getEBuilder.xml -DbuildId=%buildId% ^ + -Dosgi.os=''' + TEST_CONFIG.os + ' -Dosgi.ws=' + TEST_CONFIG.ws + ' -Dosgi.arch=' + TEST_CONFIG.arch + ''' ^ + -DtestSuite=all + \'\'\'''' + }else { + throw new IllegalArgumentException('Unsupported OS: ' + TEST_CONFIG.os) + } +}() + ''' + // For smaller test-suites see: https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/blob/be721e33c916b03c342e7b6f334220c6124946f8/production/testScripts/configuration/sdk.tests/testScripts/test.xml#L1893-L1903 + archiveArtifacts '**/eclipse-testing/results/**, **/eclipse-testing/directorLogs/**, *.properties, *.txt' + junit keepLongStdio: true, testResults: '**/eclipse-testing/results/xml/*.xml' + build job: 'Releng/ep-collectResults', wait: false, parameters: [ + string(name: 'triggeringJob', value: "${JOB_BASE_NAME}"), + string(name: 'buildURL', value: "${BUILD_URL}"), + string(name: 'buildID', value: "${params.buildId}") + ] + } + } + } +} + +def pathOf(String path){ + return path.replace('/', isUnix() ? '/' : '\\\\') +} + +def installTemurinJDK(String version, String os, String arch, String releaseType='ga') { + // Translate os/arch names that are different in the Adoptium API + if (arch == 'x86_64') { + arch == 'x64' + } + dir("${WORKSPACE}/java") { + sh "curl -L https://api.adoptium.net/v3/binary/latest/${version}/${releaseType}/${os}/${arch}/jdk/hotspot/normal/eclipse | tar -xzf -" + return "${pwd()}/" + sh(script: 'ls', returnStdout: true).strip() + } +} + +''') + } + } + } + } +} diff --git a/JenkinsJobs/AutomatedTests/I_unit_win32.groovy b/JenkinsJobs/AutomatedTests/I_unit_win32.groovy deleted file mode 100644 index 296d97218c5..00000000000 --- a/JenkinsJobs/AutomatedTests/I_unit_win32.groovy +++ /dev/null @@ -1,75 +0,0 @@ -def config = new groovy.json.JsonSlurper().parseText(readFileFromWorkspace('JenkinsJobs/JobDSL.json')) -def STREAMS = config.Streams - -for (STREAM in STREAMS){ - def MAJOR = STREAM.split('\\.')[0] - def MINOR = STREAM.split('\\.')[1] - - pipelineJob('AutomatedTests/ep' + MAJOR + MINOR + 'I-unit-win32-x86_64-java21'){ - description('Run Eclipse SDK Tests for the platform implied by this job\'s name') - parameters { // Define parameters in job configuration to make them available from the very first build onwards - stringParam('buildId', null, 'Build Id to test (such as I20240611-1800, N20120716-0800).') - } - - definition { - cps { - sandbox() - script(''' -pipeline { - options { - timeout(time: 901, unit: 'MINUTES') - timestamps() - buildDiscarder(logRotator(numToKeepStr:'15', artifactNumToKeepStr:'5')) - } - agent { - label 'qa6xd-win11' - } - - stages { - stage('Run tests'){ - environment { - // Declaring a jdk and ant the usual way in the 'tools' section, because of unknown reasons, breaks the usage of system commands like xvnc, pkill and sh - JAVA_HOME = 'C:\\\\Program Files\\\\Eclipse Adoptium\\\\jdk-21.0.5.11-hotspot' - ANT_HOME = tool(type:'ant', name:'apache-ant-latest') - PATH = "${JAVA_HOME}\\\\bin;${ANT_HOME}\\\\bin;${PATH}" - ANT_OPTS = "-Djava.io.tmpdir=${WORKSPACE}\\\\tmp" - } - steps { - cleanWs() // workspace not cleaned by default - bat \'\'\' -@REM tmp must already exist, for Java to make use of it, in subsequent steps -@REM no -p (or /p) needed on Windows. It creates -mkdir tmp - -@REM Note: currently this file always comes from master, no matter what branch is being built/tested. -curl -o getEBuilder.xml https://download.eclipse.org/eclipse/relengScripts/testScripts/bootstrap/getEBuilder.xml - -set JAVA_HOME -set ANT_HOME -set PATH - -env 1>envVars.txt 2>&1 -cmd /c ant -diagnostics 1>antDiagnostics.txt 2>&1 -java -XshowSettings -version 1>javaSettings.txt 2>&1 - -ant -f getEBuilder.xml -DbuildId=%buildId% ^ - -Dosgi.os=win32 -Dosgi.ws=win32 -Dosgi.arch=x86_64 ^ - -DtestSuite=all -@REM For smaller test-suites see: https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/blob/be721e33c916b03c342e7b6f334220c6124946f8/production/testScripts/configuration/sdk.tests/testScripts/test.xml#L1893-L1903 - \'\'\' - archiveArtifacts '**/eclipse-testing/results/**, **/eclipse-testing/directorLogs/**, *.properties, *.txt' - junit keepLongStdio: true, testResults: '**/eclipse-testing/results/xml/*.xml' - build job: 'Releng/ep-collectResults', wait: false, parameters: [ - string(name: 'triggeringJob', value: "${JOB_BASE_NAME}"), - string(name: 'buildURL', value: "${BUILD_URL}"), - string(name: 'buildID', value: "${params.buildId}") - ] - } - } - } -} - ''') - } - } - } -} diff --git a/JenkinsJobs/YBuilds/Y_unit_linux.groovy b/JenkinsJobs/YBuilds/Y_unit_linux.groovy deleted file mode 100644 index bac41a66797..00000000000 --- a/JenkinsJobs/YBuilds/Y_unit_linux.groovy +++ /dev/null @@ -1,104 +0,0 @@ -def config = new groovy.json.JsonSlurper().parseText(readFileFromWorkspace('JenkinsJobs/JobDSL.json')) -def STREAMS = config.Streams - -def BUILD_CONFIGURATIONS = [ - [javaVersion: 21, javaHome: "tool(type:'jdk', name:'temurin-jdk21-latest')" ], - [javaVersion: 24, javaHome: "installTemurinJDK('24', 'linux', 'x86_64', 'ea')" ] -] - -for (STREAM in STREAMS){ - def MAJOR = STREAM.split('\\.')[0] - def MINOR = STREAM.split('\\.')[1] - for (BUILD_CONFIG in BUILD_CONFIGURATIONS){ - - pipelineJob('YPBuilds/ep' + MAJOR + MINOR + 'Y-unit-linux-x86_64-java' + BUILD_CONFIG.javaVersion){ - parameters { - stringParam('buildId', null, 'Build Id to test (such as I20240611-1800, N20120716-0800).') - } - - definition { - cps { - sandbox() - script(''' -pipeline { - options { - timeout(time: 600, unit: 'MINUTES') - timestamps() - buildDiscarder(logRotator(numToKeepStr:'5')) - } - agent { - label 'ubuntu-2404' - } - stages { - stage('Run tests'){ - environment { - // Declaring a jdk and ant the usual way in the 'tools' section, because of unknown reasons, breaks the usage of system commands like xvnc, pkill and sh - JAVA_HOME = ''' + BUILD_CONFIG.javaHome + ''' - ANT_HOME = tool(type:'ant', name:'apache-ant-latest') - PATH = "${JAVA_HOME}/bin:${ANT_HOME}/bin:${PATH}" - ANT_OPTS = "-Djava.io.tmpdir=${WORKSPACE}/tmp" - } - steps { - xvnc(useXauthority: true) { - sh \'\'\'#!/bin/bash -x - - buildId=$(echo $buildId|tr -d ' ') - export LANG=en_US.UTF-8 - cat /etc/*release - echo "whoami: $(whoami)" - echo "uname -a: $(uname -a)" - - # 0002 is often the default for shell users, but it is not when ran from - # a cron job, so we set it explicitly, to be sure of value, so releng group has write access to anything - # we create on shared area. - oldumask=$(umask) - umask 0002 - - echo "umask explicitly set to 0002, old value was $oldumask" - - # we want java.io.tmpdir to be in $WORKSPACE, but must already exist, for Java to use it. - mkdir -p ${WORKSPACE}/tmp - - curl -o getEBuilder.xml https://download.eclipse.org/eclipse/relengScripts/testScripts/bootstrap/getEBuilder.xml - - echo JAVA_HOME: $JAVA_HOME - echo ANT_HOME: $ANT_HOME - echo PATH: $PATH - - env 1>envVars.txt 2>&1 - ant -diagnostics 1>antDiagnostics.txt 2>&1 - java -XshowSettings -version 1>javaSettings.txt 2>&1 - - ant -f getEBuilder.xml -DbuildId=${buildId} \\ - -Dosgi.os=linux -Dosgi.ws=gtk -Dosgi.arch=x86_64 \\ - -DtestSuite=all - \'\'\' - } - archiveArtifacts '**/eclipse-testing/results/**, **/eclipse-testing/directorLogs/**, *.properties, *.txt' - junit keepLongStdio: true, testResults: '**/eclipse-testing/results/xml/*.xml' - build job: 'YPBuilds/ep-collectYbuildResults', wait: false, parameters: [ - string(name: 'triggeringJob', value: "${JOB_BASE_NAME}"), - string(name: 'buildURL', value: "${BUILD_URL}"), - string(name: 'buildID', value: "${params.buildId}") - ] - } - } - } -} - -def installTemurinJDK(String version, String os, String arch, String releaseType='ga') { - // Translate os/arch names that are different in the Adoptium API - if (arch == 'x86_64') { - arch == 'x64' - } - dir ("${WORKSPACE}/java") { - sh "curl -L https://api.adoptium.net/v3/binary/latest/${version}/${releaseType}/${os}/${arch}/jdk/hotspot/normal/eclipse | tar -xzf -" - return "${pwd()}/" + sh(script: 'ls', returnStdout: true).strip() - } -} -''') - } - } - } -} -} diff --git a/JenkinsJobs/YBuilds/Y_unit_mac.groovy b/JenkinsJobs/YBuilds/Y_unit_mac.groovy deleted file mode 100644 index ba830112e9f..00000000000 --- a/JenkinsJobs/YBuilds/Y_unit_mac.groovy +++ /dev/null @@ -1,87 +0,0 @@ -def config = new groovy.json.JsonSlurper().parseText(readFileFromWorkspace('JenkinsJobs/JobDSL.json')) -def STREAMS = config.Streams - -def BUILD_CONFIGURATIONS = [ - [arch: 'aarch64', agentLabel: 'nc1ht-macos11-arm64', javaHome: '/Library/Java/JavaVirtualMachines/jdk-21.0.5+11-arm64/Contents/Home' ], - [arch: 'x86_64', agentLabel: 'nc1ht-macos11-arm64', javaHome: '/Library/Java/JavaVirtualMachines/jdk-21.0.5+11/Contents/Home' ] -] - -for (STREAM in STREAMS){ - def MAJOR = STREAM.split('\\.')[0] - def MINOR = STREAM.split('\\.')[1] - for (BUILD_CONFIG in BUILD_CONFIGURATIONS){ - - pipelineJob('YPBuilds/ep' + MAJOR + MINOR + 'Y-unit-macosx-' + BUILD_CONFIG.arch + '-java21'){ - description('Run Eclipse SDK Tests for ' + BUILD_CONFIG.arch + ' Mac (and ' + BUILD_CONFIG.arch + ' VM and Eclipse)') - parameters { - stringParam('buildId', null, 'Build Id to test (such as I20240611-1800, N20120716-0800).') - } - definition { - cps { - sandbox() - script(''' -pipeline { - options { - timeout(time: 600, unit: 'MINUTES') - timestamps() - buildDiscarder(logRotator(numToKeepStr:'5')) - } - agent { - label \'''' + BUILD_CONFIG.agentLabel + '''' - } - stages { - stage('Run tests'){ - environment { - // Declaring a jdk and ant the usual way in the 'tools' section, because of unknown reasons, breaks the usage of system commands like xvnc, pkill and sh - JAVA_HOME = \'''' + BUILD_CONFIG.javaHome + '''' - ANT_HOME = tool(type:'ant', name:'apache-ant-latest') - PATH = "${JAVA_HOME}/bin:${ANT_HOME}/bin:${PATH}" - ANT_OPTS = "-Djava.io.tmpdir=${WORKSPACE}/tmp" - } - steps { - cleanWs() // workspace not cleaned by default - sh \'\'\'#!/bin/bash -x -echo "whoami: $(whoami)" -echo "uname -a: $(uname -a)" - -# 0002 is often the default for shell users, but it is not when ran from -# a cron job, so we set it explicitly, to be sure of value, so releng group has write access to anything -# we create on shared area. -oldumask=$(umask) -umask 0002 -echo "umask explicitly set to 0002, old value was $oldumask" - -# we want java.io.tmpdir to be in $WORKSPACE, but must already exist, for Java to use it. -mkdir -p tmp - -curl -o getEBuilder.xml https://download.eclipse.org/eclipse/relengScripts/testScripts/bootstrap/getEBuilder.xml - -echo JAVA_HOME: $JAVA_HOME -echo ANT_HOME: $ANT_HOME -echo PATH: $PATH - -env 1>envVars.txt 2>&1 -ant -diagnostics 1>antDiagnostics.txt 2>&1 -java -XshowSettings -version 1>javaSettings.txt 2>&1 - -ant -f getEBuilder.xml -DbuildId=${buildId} \\ - -Dosgi.os=macosx -Dosgi.ws=cocoa -Dosgi.arch=''' + BUILD_CONFIG.arch + ''' \\ - -DtestSuite=all -\'\'\' - archiveArtifacts '**/eclipse-testing/results/**, **/eclipse-testing/directorLogs/**, *.properties, *.txt' - junit keepLongStdio: true, testResults: '**/eclipse-testing/results/xml/*.xml' - build job: 'YPBuilds/ep-collectYbuildResults', wait: false, parameters: [ - string(name: 'triggeringJob', value: "${JOB_BASE_NAME}"), - string(name: 'buildURL', value: "${BUILD_URL}"), - string(name: 'buildID', value: "${params.buildId}") - ] - } - } - } -} -''') - } - } - } - } -} diff --git a/JenkinsJobs/YBuilds/Y_unit_tests.groovy b/JenkinsJobs/YBuilds/Y_unit_tests.groovy new file mode 100644 index 00000000000..4099cf6e860 --- /dev/null +++ b/JenkinsJobs/YBuilds/Y_unit_tests.groovy @@ -0,0 +1,142 @@ +def config = new groovy.json.JsonSlurper().parseText(readFileFromWorkspace('JenkinsJobs/JobDSL.json')) +def STREAMS = config.Streams + +def TEST_CONFIGURATIONS = [ + [os: 'linux' , ws:'gtk' , arch: 'x86_64' , javaVersion: 21, agentLabel: 'ubuntu-2404' , javaHome: "tool(type:'jdk', name:'temurin-jdk21-latest')" ], + [os: 'linux' , ws:'gtk' , arch: 'x86_64' , javaVersion: 24, agentLabel: 'ubuntu-2404' , javaHome: "installTemurinJDK('24', 'linux', 'x86_64', 'ea')" ], + [os: 'macosx', ws:'cocoa', arch: 'aarch64', javaVersion: 21, agentLabel: 'nc1ht-macos11-arm64', javaHome: "'/Library/Java/JavaVirtualMachines/jdk-21.0.5+11-arm64/Contents/Home'" ], + [os: 'macosx', ws:'cocoa', arch: 'x86_64' , javaVersion: 21, agentLabel: 'nc1ht-macos11-arm64', javaHome: "'/Library/Java/JavaVirtualMachines/jdk-21.0.5+11/Contents/Home'" ], + [os: 'win32' , ws:'win32', arch: 'x86_64' , javaVersion: 21, agentLabel: 'qa6xd-win11' , javaHome: "'C:\\\\Program Files\\\\Eclipse Adoptium\\\\jdk-21.0.5.11-hotspot'" ], +] + +for (STREAM in STREAMS){ + def MAJOR = STREAM.split('\\.')[0] + def MINOR = STREAM.split('\\.')[1] + for (TEST_CONFIG in TEST_CONFIGURATIONS){ + + pipelineJob('YPBuilds/ep' + MAJOR + MINOR + 'Y-unit-' + TEST_CONFIG.os + '-' + TEST_CONFIG.arch + '-java' + TEST_CONFIG.javaVersion){ + description('Run Eclipse SDK Tests for the platform implied by this job\'s name') + parameters { // Define parameters in job configuration to make them available from the very first build onwards + stringParam('buildId', null, 'Build Id to test (such as I20240611-1800, N20120716-0800).') + } + + definition { + cps { + sandbox() + script(''' +pipeline { + options { + timeout(time: 600, unit: 'MINUTES') + timestamps() + buildDiscarder(logRotator(numToKeepStr:'15', artifactNumToKeepStr:'5')) + } + agent { + label \'''' + TEST_CONFIG.agentLabel + '''' + } + stages { + stage('Clean Workspace'){ + steps { // workspace is not always cleaned by default. Clean before custom tools are installed into workspace. + cleanWs() + } + } + stage('Run tests'){ + environment { + // Declaring a jdk and ant the usual way in the 'tools' section, because of unknown reasons, breaks the usage of system commands like xvnc, pkill and sh + JAVA_HOME = ''' + TEST_CONFIG.javaHome + ''' + ANT_HOME = tool(type:'ant', name:'apache-ant-latest') + PATH = [pathOf("${JAVA_HOME}/bin"), pathOf("${ANT_HOME}/bin"), env.PATH].join(isUnix() ? ':' : ';') + ANT_OPTS = "-Djava.io.tmpdir=${pathOf(env.WORKSPACE+'/tmp')}" + } + steps {''' + { + if(TEST_CONFIG.os == 'linux' || TEST_CONFIG.os == 'macosx') { + def runTestsScript = ''' + sh \'\'\'#!/bin/bash -x + export LANG=en_US.UTF-8 + echo " whoami: $(whoami)" + echo " uname -a: $(uname -a)" + + # 0002 is often the default for shell users, but it is not when ran from + # a cron job, so we set it explicitly, to be sure of value, so releng group has write access to anything + # we create on shared area. + oldumask=$(umask) + umask 0002 + echo "umask explicitly set to 0002, old value was $oldumask" + + # we want java.io.tmpdir to be in $WORKSPACE, but must already exist, for Java to use it. + mkdir -p tmp + + curl -o getEBuilder.xml https://download.eclipse.org/eclipse/relengScripts/testScripts/bootstrap/getEBuilder.xml + + echo JAVA_HOME: $JAVA_HOME + echo ANT_HOME: $ANT_HOME + echo PATH: $PATH + + env 1>envVars.txt 2>&1 + ant -diagnostics 1>antDiagnostics.txt 2>&1 + java -XshowSettings -version 1>javaSettings.txt 2>&1 + + ant -f getEBuilder.xml -DbuildId=${buildId} \\ + -Dosgi.os=''' + TEST_CONFIG.os + ' -Dosgi.ws=' + TEST_CONFIG.ws + ' -Dosgi.arch=' + TEST_CONFIG.arch + ''' \\ + -DtestSuite=all + \'\'\'''' + return TEST_CONFIG.os == 'linux' ? """ + xvnc(useXauthority: true) {${runTestsScript} + }""" : runTestsScript + } else if(TEST_CONFIG.os == 'win32') { + return ''' + bat \'\'\' + @REM tmp must already exist, for Java to make use of it, in subsequent steps + mkdir tmp + + curl -o getEBuilder.xml https://download.eclipse.org/eclipse/relengScripts/testScripts/bootstrap/getEBuilder.xml + + echo JAVA_HOME: %JAVA_HOME% + echo ANT_HOME: %ANT_HOME% + echo PATH: %PATH% + + env 1>envVars.txt 2>&1 + cmd /c ant -diagnostics 1>antDiagnostics.txt 2>&1 + java -XshowSettings -version 1>javaSettings.txt 2>&1 + + ant -f getEBuilder.xml -DbuildId=%buildId% ^ + -Dosgi.os=''' + TEST_CONFIG.os + ' -Dosgi.ws=' + TEST_CONFIG.ws + ' -Dosgi.arch=' + TEST_CONFIG.arch + ''' ^ + -DtestSuite=all + \'\'\'''' + }else { + throw new IllegalArgumentException('Unsupported OS: ' + TEST_CONFIG.os) + } +}() + ''' + // For smaller test-suites see: https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/blob/be721e33c916b03c342e7b6f334220c6124946f8/production/testScripts/configuration/sdk.tests/testScripts/test.xml#L1893-L1903 + archiveArtifacts '**/eclipse-testing/results/**, **/eclipse-testing/directorLogs/**, *.properties, *.txt' + junit keepLongStdio: true, testResults: '**/eclipse-testing/results/xml/*.xml' + build job: 'YPBuilds/ep-collectYbuildResults', wait: false, parameters: [ + string(name: 'triggeringJob', value: "${JOB_BASE_NAME}"), + string(name: 'buildURL', value: "${BUILD_URL}"), + string(name: 'buildID', value: "${params.buildId}") + ] + } + } + } +} + +def pathOf(String path){ + return path.replace('/', isUnix() ? '/' : '\\\\') +} + +def installTemurinJDK(String version, String os, String arch, String releaseType='ga') { + // Translate os/arch names that are different in the Adoptium API + if (arch == 'x86_64') { + arch == 'x64' + } + dir("${WORKSPACE}/java") { + sh "curl -L https://api.adoptium.net/v3/binary/latest/${version}/${releaseType}/${os}/${arch}/jdk/hotspot/normal/eclipse | tar -xzf -" + return "${pwd()}/" + sh(script: 'ls', returnStdout: true).strip() + } +} + +''') + } + } + } + } +} diff --git a/JenkinsJobs/YBuilds/Y_unit_win32.groovy b/JenkinsJobs/YBuilds/Y_unit_win32.groovy deleted file mode 100644 index f58d3c57391..00000000000 --- a/JenkinsJobs/YBuilds/Y_unit_win32.groovy +++ /dev/null @@ -1,71 +0,0 @@ -def config = new groovy.json.JsonSlurper().parseText(readFileFromWorkspace('JenkinsJobs/JobDSL.json')) -def STREAMS = config.Streams - -for (STREAM in STREAMS){ - def MAJOR = STREAM.split('\\.')[0] - def MINOR = STREAM.split('\\.')[1] - - pipelineJob('YPBuilds/ep' + MAJOR + MINOR + 'Y-unit-win32-x86_64-java21'){ - description('Run Eclipse SDK Windows Tests ') - parameters { - stringParam('buildId', null, 'Build Id to test (such as I20240611-1800, N20120716-0800).') - } - definition { - cps { - sandbox() - script(''' -pipeline { - options { - timeout(time: 600, unit: 'MINUTES') - timestamps() - buildDiscarder(logRotator(numToKeepStr:'5')) - } - agent { - label 'qa6xd-win11' - } - stages { - stage('Run tests'){ - environment { - // Declaring a jdk and ant the usual way in the 'tools' section, because of unknown reasons, breaks the usage of system commands like xvnc, pkill and sh - JAVA_HOME = 'C:\\\\Program Files\\\\Eclipse Adoptium\\\\jdk-21.0.5.11-hotspot' - ANT_HOME = tool(type:'ant', name:'apache-ant-latest') - PATH = "${JAVA_HOME}\\\\bin;${ANT_HOME}\\\\bin;${PATH}" - ANT_OPTS = "-Djava.io.tmpdir=${WORKSPACE}\\\\tmp" - } - steps { - cleanWs() // workspace not cleaned by default - bat \'\'\' -rem tmp must already exist, for Java to make use of it, in subsequent steps -rem no -p (or /p) needed on Windows. It creates -mkdir tmp - -curl -o getEBuilder.xml https://download.eclipse.org/eclipse/relengScripts/testScripts/bootstrap/getEBuilder.xml - -set JAVA_HOME -set ANT_HOME -set PATH - -env 1>envVars.txt 2>&1 -cmd /c ant -diagnostics 1>antDiagnostics.txt 2>&1 -java -XshowSettings -version 1>javaSettings.txt 2>&1 - -ant -f getEBuilder.xml -DbuildId=%buildId% ^ - -Dosgi.os=win32 -Dosgi.ws=win32 -Dosgi.arch=x86_64 ^ - -DtestSuite=all -\'\'\' - archiveArtifacts '**/eclipse-testing/results/**, **/eclipse-testing/directorLogs/**, *.properties, *.txt' - junit keepLongStdio: true, testResults: '**/eclipse-testing/results/xml/*.xml' - build job: 'YPBuilds/ep-collectYbuildResults', wait: false, parameters: [ - string(name: 'triggeringJob', value: "${JOB_BASE_NAME}"), - string(name: 'buildURL', value: "${BUILD_URL}"), - string(name: 'buildID', value: "${params.buildId}") - ] - } - } - } -} -''') - } - } - } -}