From 2976830497bc8249e82aba61652123803c82a582 Mon Sep 17 00:00:00 2001 From: Anton Iakimov Date: Mon, 7 Aug 2023 11:29:55 +0200 Subject: [PATCH] ci: cleanup e2e tests and builds from jenkins combined job --- ci/Jenkinsfile.combined | 22 +--- ci/tests/Jenkinsfile.e2e-nightly | 25 ++-- ci/tests/Jenkinsfile.e2e-nightly-build-number | 120 ------------------ 3 files changed, 19 insertions(+), 148 deletions(-) delete mode 100644 ci/tests/Jenkinsfile.e2e-nightly-build-number diff --git a/ci/Jenkinsfile.combined b/ci/Jenkinsfile.combined index ed4929b68e..76ec377399 100644 --- a/ci/Jenkinsfile.combined +++ b/ci/Jenkinsfile.combined @@ -9,8 +9,6 @@ pipeline { disableConcurrentBuilds() /* Prevent Jenkins jobs from running forever */ timeout(time: 40, unit: 'MINUTES') - /* Allow copying of artifacts from this job. */ - copyArtifactPermission('/status-mobile/e2e/*') /* Limit builds retained */ buildDiscarder(logRotator( numToKeepStr: '10', @@ -49,9 +47,6 @@ pipeline { stage('Android') { steps { script { apk = jenkins.Build('status-mobile/platforms/android') } } } - stage('Android e2e') { steps { script { - apke2e = jenkins.Build('status-mobile/platforms/android-e2e') - } } } stage('Tests') { steps { script { jenkins.Build('status-mobile/platforms/tests') } } } @@ -61,9 +56,7 @@ pipeline { steps { script { sh('rm -f pkg/*') jenkins.copyArts(ios) - //jenkins.copyArts(iose2e) jenkins.copyArts(apk) - jenkins.copyArts(apke2e) sha = "pkg/${utils.pkgFilename(ext: 'sha256')}" dir('pkg') { /* generate sha256 checksums for upload */ @@ -77,8 +70,8 @@ pipeline { /* object for easier URLs handling */ urls = [ /* mobile */ - Apk: utils.pkgUrl(apk), Apke2e: utils.pkgUrl(apke2e), - iOS: utils.pkgUrl(ios), /*iOSe2e: utils.pkgUrl(iose2e),*/ + Apk: utils.pkgUrl(apk), + iOS: utils.pkgUrl(ios), Diawi: utils.getEnv(ios, 'DIAWI_URL'), /* upload the sha256 checksums file too */ SHA: s3.uploadArtifact(sha), @@ -102,17 +95,6 @@ pipeline { } } } } - stage('Run e2e') { - when { expression { btype == 'nightly' && params.PUBLISH } } - steps { script { - e2eApk = utils.getEnv(apke2e, 'SAUCE_URL') - build( - job: 'status-mobile/e2e/status-app-nightly', - parameters: [string(name: 'APK_URL', value: e2eApk)], - wait: false - ) - } } - } } } diff --git a/ci/tests/Jenkinsfile.e2e-nightly b/ci/tests/Jenkinsfile.e2e-nightly index a2185c9760..42b379347b 100644 --- a/ci/tests/Jenkinsfile.e2e-nightly +++ b/ci/tests/Jenkinsfile.e2e-nightly @@ -7,14 +7,24 @@ pipeline { parameters { string( - name: 'APK_URL', - description: 'URL of APK uploaded to SauceLabs.', + name: 'APK_BUILD_NUMBER', + description: 'platform/e2e build number for apk artifact', ) string( name: 'KEYWORD_EXPRESSION', description: 'This will run tests which contain names that match the given string expression (Optional)', defaultValue: '', ) + string( + name: 'BRANCH', + description: 'Name of the branch to checkout and build.', + defaultValue: 'develop', + ) + string( + name: 'TR_CASE_IDS', + description: 'IDs of the TestRail case, separated by a comma (Optional)', + defaultValue: '', + ) } options { @@ -23,15 +33,14 @@ pipeline { stages { stage('Fetch') { - when { expression { !params.APK_URL } } steps { script { copyArtifacts( - projectName: "status-mobile/nightly", - filter: '*-x86.apk', - /* WARNING: This copies the latest available artifact. */ - selector: lastWithArtifacts(), + projectName: "status-mobile/platforms/android-e2e", + filter: 'result/*-x86.apk', + selector: specific(env.APK_BUILD_NUMBER), ) - apk_path = "${env.WORKSPACE}/${utils.findFile('*-x86.apk')}" + apk_path = "${env.WORKSPACE}/${utils.findFile('result/*-x86.apk')}" + } } } diff --git a/ci/tests/Jenkinsfile.e2e-nightly-build-number b/ci/tests/Jenkinsfile.e2e-nightly-build-number deleted file mode 100644 index 42b379347b..0000000000 --- a/ci/tests/Jenkinsfile.e2e-nightly-build-number +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/env groovy -library 'status-jenkins-lib@v1.7.12' - -pipeline { - - agent { label 'linux' } - - parameters { - string( - name: 'APK_BUILD_NUMBER', - description: 'platform/e2e build number for apk artifact', - ) - string( - name: 'KEYWORD_EXPRESSION', - description: 'This will run tests which contain names that match the given string expression (Optional)', - defaultValue: '', - ) - string( - name: 'BRANCH', - description: 'Name of the branch to checkout and build.', - defaultValue: 'develop', - ) - string( - name: 'TR_CASE_IDS', - description: 'IDs of the TestRail case, separated by a comma (Optional)', - defaultValue: '', - ) - } - - options { - disableConcurrentBuilds() - } - - stages { - stage('Fetch') { - steps { script { - copyArtifacts( - projectName: "status-mobile/platforms/android-e2e", - filter: 'result/*-x86.apk', - selector: specific(env.APK_BUILD_NUMBER), - ) - apk_path = "${env.WORKSPACE}/${utils.findFile('result/*-x86.apk')}" - - } } - } - - stage('Setup') { - steps { script { - dir('test/appium') { - sh 'pip3 install --user -r requirements.txt' - } - } } - } - - stage('Test') { - steps { - withCredentials([ - usernamePassword( - credentialsId: 'test-rail-api', - usernameVariable: 'TESTRAIL_USER', - passwordVariable: 'TESTRAIL_PASS' - ), - usernamePassword( - credentialsId: 'sauce-labs-api', - usernameVariable: 'SAUCE_USERNAME', - passwordVariable: 'SAUCE_ACCESS_KEY' - ), - string( - credentialsId: 'etherscan-api-key', - variable: 'ETHERSCAN_API_KEY' - ), - string( - credentialsId: 'infura-e2e-token', - variable: 'WEB3_INFURA_PROJECT_ID' - ), - file( - credentialsId: "mobile-tests-eth-accounts", - variable: 'TEST_ETH_ACCOUNTS_FILE' - ), - ]) { - dir('test/appium/tests') { - /* Provide Eth test accounts secrets. */ - sh 'cp -f $TEST_ETH_ACCOUNTS_FILE users.py' - sh """ - python3 -m pytest \ - --numprocesses 6 \ - --rerun_count=2 \ - --testrail_report=True \ - -m testrail_id \ - -m \"new_ui_critical or new_ui_medium\" \ - -k \"${params.KEYWORD_EXPRESSION}\" \ - --apk=${params.APK_URL ?: apk_path} - """ - } - } - } - } - } - - post { - always { - script { - sauce('sauce-labs-cred') { - saucePublisher() - } - } - } - success { - script { - junit( - testDataPublishers: [[$class: 'SauceOnDemandReportPublisher', jobVisibility: 'public']], - testResults: 'test/appium/tests/*.xml' - ) - } - } - cleanup { - sh 'make purge' - } - } -}