Skip to content

Psp 11434#5291

Draft
devinleighsmith wants to merge 8 commits into
bcgov:devfrom
devinleighsmith:psp-11434
Draft

Psp 11434#5291
devinleighsmith wants to merge 8 commits into
bcgov:devfrom
devinleighsmith:psp-11434

Conversation

@devinleighsmith

@devinleighsmith devinleighsmith commented Apr 21, 2026

Copy link
Copy Markdown
Collaborator

Tested in dev environment. Not intended for production use.

Does a best-effort clean of data created by test user(s) specified in smoke tests.

Does not delete entities where sub-entities have been manually added by other users.

Database scripts generated by AI.

Deletion does not affect PIMS_USER* or PIMS_PERSON* tables required for testing.

Deletion scripts run by openshift jobs due to firewall restrictions.

Cleans history as well as data rows - as stated, not for production.

@devinleighsmith devinleighsmith self-assigned this Apr 21, 2026
@devinleighsmith devinleighsmith added devops test-scripts Tag used for functional test scripts 6.3 labels Apr 21, 2026
Comment on lines +65 to +85
name: clean database of test user GUID
needs: [smoke-test]
runs-on: ubuntu-22.04
steps:
- name: Checkout Source Code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Login to OpenShift
uses: redhat-actions/oc-login@5eb45e848b168b6bf6b8fe7f1561003c12e3c99d # v1.3
with:
openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
openshift_token: ${{ env.OPENSHIFT_TOKEN }}
insecure_skip_tls_verify: true
namespace: ${{ env.TARGET_NAMESPACE }}
- name: call scripts to clean database
shell: bash
run: |
JOB_NAME=$(oc process -f ./openshift/4.0/templates/jobs/db-clean-guid.yaml -p DB_SECRET_NAME=${{ env.TARGET_DB_SECRET_NAME }} -p GIT_BRANCH=${{ env.TARGET_GIT_BRANCH }} -p SERVER_NAME=${{ env.TARGET_SERVER_NAME }} -p DB_NAME=${{ env.TARGET_DB_NAME }} -p NAMESPACE=${{ env.TARGET_NAMESPACE }} -p TEST_USER_GUID=${{ env.Users__0__Guid }} | oc create -f - | grep -oP "(?<=job\.batch/)[^\s]*")
oc wait --for=condition=complete job/$JOB_NAME --timeout=300s
oc get pods -o custom-columns=POD:.metadata.name --no-headers | grep -Eo $JOB_NAME-[^\s].* | (read POD_NAME; oc logs $POD_NAME)

database-clean-2:
Comment on lines +86 to +104
name: clean database of test user GUID
needs: [smoke-test]
runs-on: ubuntu-22.04
steps:
- name: Checkout Source Code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Login to OpenShift
uses: redhat-actions/oc-login@5eb45e848b168b6bf6b8fe7f1561003c12e3c99d # v1.3
with:
openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
openshift_token: ${{ env.OPENSHIFT_TOKEN }}
insecure_skip_tls_verify: true
namespace: ${{ env.TARGET_NAMESPACE }}
- name: call scripts to clean database
shell: bash
run: |
JOB_NAME=$(oc process -f ./openshift/4.0/templates/jobs/db-clean-guid.yaml -p DB_SECRET_NAME=${{ env.TARGET_DB_SECRET_NAME }} -p GIT_BRANCH=${{ env.TARGET_GIT_BRANCH }} -p SERVER_NAME=${{ env.TARGET_SERVER_NAME }} -p DB_NAME=${{ env.TARGET_DB_NAME }} -p NAMESPACE=${{ env.TARGET_NAMESPACE }} -p TEST_USER_GUID=${{ env.Users__1__Guid }} | oc create -f - | grep -oP "(?<=job\.batch/)[^\s]*")
oc wait --for=condition=complete job/$JOB_NAME --timeout=300s
oc get pods -o custom-columns=POD:.metadata.name --no-headers | grep -Eo $JOB_NAME-[^\s].* | (read POD_NAME; oc logs $POD_NAME)
Comment on lines -39 to -40
- name: 🚀 Run Cucumber Smoke Tests
run: npx cucumber-js --tags @smokeTest

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do the playwright tests were removed? Do they not work currently?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just removed for test purposes, since these aren't running cleanly atm.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
15.4% Duplication on New Code (required ≤ 3%)
E Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@eddherrera eddherrera marked this pull request as draft June 1, 2026 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.3 devops test-scripts Tag used for functional test scripts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants