diff --git a/.github/workflows/integration_tests.yaml b/.github/workflows/integration_tests.yaml new file mode 100644 index 000000000..80ce427fa --- /dev/null +++ b/.github/workflows/integration_tests.yaml @@ -0,0 +1,27 @@ +name: Integration Tests + +on: pull_request + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + integration_tests: + name: Integration tests + uses: uc-cdis/.github/.github/workflows/integration_tests.yaml@master + with: + QUAY_REPO: "awshelper" + secrets: + CI_AWS_ACCESS_KEY_ID: ${{ secrets.CI_AWS_ACCESS_KEY_ID }} + CI_AWS_SECRET_ACCESS_KEY: ${{ secrets.CI_AWS_SECRET_ACCESS_KEY }} + JENKINS_API_TOKEN: ${{ secrets.JENKINS_API_TOKEN }} + QA_DASHBOARD_S3_PATH: ${{ secrets.QA_DASHBOARD_S3_PATH }} + CI_TEST_ORCID_USERID: ${{ secrets.CI_TEST_ORCID_USERID }} + CI_TEST_ORCID_PASSWORD: ${{ secrets.CI_TEST_ORCID_PASSWORD }} + CI_TEST_RAS_USERID: ${{ secrets.CI_TEST_RAS_USERID }} + CI_TEST_RAS_PASSWORD: ${{ secrets.CI_TEST_RAS_PASSWORD }} + CI_TEST_RAS_2_USERID: ${{ secrets.CI_TEST_RAS_2_USERID }} + CI_TEST_RAS_2_PASSWORD: ${{ secrets.CI_TEST_RAS_2_PASSWORD }} + CI_SLACK_BOT_TOKEN: ${{ secrets.CI_SLACK_BOT_TOKEN }} + CI_SLACK_CHANNEL_ID: ${{ secrets.CI_SLACK_CHANNEL_ID }} diff --git a/Jenkinsfile b/Jenkinsfile index 908c2d01a..fbd7367c2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -433,203 +433,6 @@ spec: } } - stage('WaitForQuayBuild') { - options { - timeout(time: 30, unit: 'MINUTES') // timeout on this stage - } - steps { - script { - try { - if(!skipQuayImgBuildWait) { - quayHelper.waitForBuild( - "awshelper", - pipeConfig['currentBranchFormatted'] - ) - } else { - Utils.markStageSkippedForConditional(STAGE_NAME) - } - } catch (ex) { - metricsHelper.writeMetricWithResult(STAGE_NAME, false) - pipelineHelper.handleError(ex) - } - metricsHelper.writeMetricWithResult(STAGE_NAME, true) - } - } - } - - stage('SelectNamespace') { - steps { - script { - try { - if(!doNotRunTests) { - (kubectlNamespace, lock) = kubeHelper.selectAndLockNamespace(pipeConfig['UID'], namespaces) - kubeLocks << lock - } else { - Utils.markStageSkippedForConditional(STAGE_NAME) - } - } catch (ex) { - metricsHelper.writeMetricWithResult(STAGE_NAME, false) - pipelineHelper.handleError(ex) - } - currentBuild.displayName = "#${BUILD_NUMBER} - ${kubectlNamespace}" - metricsHelper.writeMetricWithResult(STAGE_NAME, true) - } - } - } - - stage('ModifyManifest') { - steps { - script { - try { - if(!doNotRunTests) { - manifestHelper.editService( - kubeHelper.getHostname(kubectlNamespace), - "awshelper", - pipeConfig.serviceTesting.branch - ) - } else { - Utils.markStageSkippedForConditional(STAGE_NAME) - } - } catch (ex) { - metricsHelper.writeMetricWithResult(STAGE_NAME, false) - pipelineHelper.handleError(ex) - } - metricsHelper.writeMetricWithResult(STAGE_NAME, true) - } - } - } - - stage('K8sReset') { - options { - timeout(time: 1, unit: 'HOURS') // timeout on this stage - } - steps { - script { - try { - if(!doNotRunTests) { - // adding the reset-lock lock in case reset fails before unlocking - kubeLocks << kubeHelper.newKubeLock(kubectlNamespace, "gen3-reset", "reset-lock") - kubeHelper.reset(kubectlNamespace) - } else { - Utils.markStageSkippedForConditional(STAGE_NAME) - } - } catch (ex) { - // ignore aborted pipelines (not a failure, just some subsequent commit that initiated a new build) - if (ex.getClass().getCanonicalName() != "hudson.AbortException" && - ex.getClass().getCanonicalName() != "org.jenkinsci.plugins.workflow.steps.FlowInterruptedException") { - metricsHelper.writeMetricWithResult(STAGE_NAME, false) - kubeHelper.sendSlackNotification(kubectlNamespace, "false") - kubeHelper.saveLogs(kubectlNamespace) - } - pipelineHelper.handleError(ex) - } - metricsHelper.writeMetricWithResult(STAGE_NAME, true) - } - } - } - - stage('VerifyClusterHealth') { - steps { - script { - try { - if(!doNotRunTests) { - kubeHelper.waitForPods(kubectlNamespace) - testHelper.checkPodHealth(kubectlNamespace, "") - } else { - Utils.markStageSkippedForConditional(STAGE_NAME) - } - } catch (ex) { - metricsHelper.writeMetricWithResult(STAGE_NAME, false) - pipelineHelper.handleError(ex) - } - metricsHelper.writeMetricWithResult(STAGE_NAME, true) - } - } - } - - - stage('GenerateData') { - steps { - script { - try { - if(!doNotRunTests) { - testHelper.simulateData(kubectlNamespace) - } else { - Utils.markStageSkippedForConditional(STAGE_NAME) - } - } catch (ex) { - metricsHelper.writeMetricWithResult(STAGE_NAME, false) - pipelineHelper.handleError(ex) - } - metricsHelper.writeMetricWithResult(STAGE_NAME, true) - } - } - } - - stage('FetchDataClient') { - steps { - script { - try { - if(!doNotRunTests) { - testHelper.fetchDataClient("master") - } else { - Utils.markStageSkippedForConditional(STAGE_NAME) - } - } catch (ex) { - metricsHelper.writeMetricWithResult(STAGE_NAME, false) - pipelineHelper.handleError(ex) - } - metricsHelper.writeMetricWithResult(STAGE_NAME, true) - } - } - } - - stage('RunTests') { - options { - timeout(time: 3, unit: 'HOURS') // timeout on this stage - } - steps { - script { - try { - if(!doNotRunTests) { - testHelper.soonToBeLegacyRunIntegrationTests( - kubectlNamespace, - pipeConfig.serviceTesting.name, - testedEnv, - isGen3Release, - isNightlyBuild, - listOfSelectedTests - ) - } else { - Utils.markStageSkippedForConditional(STAGE_NAME) - } - } catch (ex) { - metricsHelper.writeMetricWithResult(STAGE_NAME, false) - pipelineHelper.handleError(ex) - } - metricsHelper.writeMetricWithResult(STAGE_NAME, true) - } - } - } - - stage('CleanS3') { - steps { - script { - try { - if(!doNotRunTests) { - testHelper.cleanS3(kubectlNamespace) - } else { - Utils.markStageSkippedForConditional(STAGE_NAME) - } - } catch (ex) { - metricsHelper.writeMetricWithResult(STAGE_NAME, false) - pipelineHelper.handleError(ex) - } - metricsHelper.writeMetricWithResult(STAGE_NAME, true) - } - } - } - stage('authzTest') { steps { script { @@ -667,4 +470,3 @@ spec: } } } -