-
Notifications
You must be signed in to change notification settings - Fork 0
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
PLT-311 Add unit test workflow for opt-out-import #78
Conversation
ARTIFACTORY_PASSWORD=/artifactory/password | ||
- name: Run unit tests for opt-out-import lambda | ||
working-directory: ./optout | ||
run: ../gradlew test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to add sonarqube analysis after tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure I'll do that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more question, if you don't mind
What happens if jenkins build fails and github action pass? Will I able to merge my changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For changes to the opt-out-import lambda, there would be no need to run the Jenkins pipeline. The GitHub Actions workflow should run automatically on PR, and the only actual gate to merge is approval from a reviewer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sonar added but see the error in the run linked below. Is there a sonar task in the gradle build file?
https://github.com/CMSgov/ab2d-lambdas/actions/runs/7658938304/job/20872947370?pr=78#step:6:18
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no sonar task in optout lambda gradle.
There is sonarqube verification in common build.gradle under ab2d-lambdas
sonarqube {
properties {
property "sonar.projectKey", "ab2d-lambdas"
}
}
and stage in jenkins
stage('SonarQube Analysis') {
steps {
withCredentials([usernamePassword(credentialsId: 'artifactoryuserpass', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) {
// Automatically saves the an id for the SonarQube build
withSonarQubeEnv('CMSSonar') {
sh './gradlew sonarqube -Dsonar.projectKey=ab2d-lambdas -Dsonar.host.url=https://sonarqube.cloud.cms.gov'
}
}
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So are you able to run sonar tests specifically for opt-out-import lambda in your dev environment? Which command do you run for that, and in which directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't run sonar from ab2d-lambda/optout
. I assume, working directory should be ab2d-lambda
.
Locally I've got the same result for ab2d-lambdas % ./gradlew sonar
and ab2d-lambdas % ./gradlew sonarrqube
.
Not sure what's the difference
I'm fine to hold off sonarqube on the current developing stage
Okay I've dropped SonarQube for now and checks are passing. Merging. |
🎫 Ticket
https://jira.cms.gov/browse/PLT-311
🛠 Changes
Added workflow for running unit tests on the opt-out-import workflow.
ℹ️ Context for reviewers
This should run on every PR to check that unit tests pass.
✅ Acceptance Validation
See checks for runs. This won't be fully tested until merged and run in another PR.
🔒 Security Implications
None.