Skip to content

Commit

Permalink
Add GH action workflow for integration tests (#2670)
Browse files Browse the repository at this point in the history
* Add GH action workflow for integration tests

* Update integration_tests.yaml

* Reverting Jenkinsfile and removing integrationtests entry

* Update Jenkinsfile

---------

Co-authored-by: Hara Prasad <[email protected]>
  • Loading branch information
krishnaa05 and haraprasadj authored Nov 21, 2024
1 parent e7d8f31 commit 69e15ba
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 198 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/integration_tests.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
198 changes: 0 additions & 198 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -667,4 +470,3 @@ spec:
}
}
}

0 comments on commit 69e15ba

Please sign in to comment.