Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GH action workflow for integration tests #2670

Merged
merged 6 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
}
}
}

Loading