Skip to content

CI/CD: Add performance regression tests using QE infrastructure #798

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

Draft
wants to merge 69 commits into
base: dev
Choose a base branch
from

Conversation

juliannguyen4
Copy link
Collaborator

@juliannguyen4 juliannguyen4 commented Jun 25, 2025

TODO

  • tail test container in gha
  • rm rclone credentials if not used

@codecov-commenter
Copy link

codecov-commenter commented Jun 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.00%. Comparing base (cd0e783) to head (a22ca22).
⚠️ Report is 2 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #798   +/-   ##
=======================================
  Coverage   82.00%   82.00%           
=======================================
  Files          99       99           
  Lines       14698    14698           
=======================================
  Hits        12053    12053           
  Misses       2645     2645           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines 11 to 131
repository: citrusleaf/qe-tools
token: ${{ secrets.CLIENT_BOT_PAT }}
path: qe-tools
sparse-checkout: |
bin/test-enqueue
sparse-checkout-cone-mode: false

- name: Add test-enqueue to PATH
run: echo "$(realpath qe-tools/bin)" >> $GITHUB_PATH

- uses: jfrog/setup-jfrog-cli@v4
env:
JF_URL: ${{ secrets.JFROG_PLATFORM_URL }}
JF_ACCESS_TOKEN: ${{ secrets.JFROG_ACCESS_TOKEN }}

- run: jf rt download qe-go-dev-local/testctl.amd64.linux qe-tools/bin/testctl
- run: chmod u+x ./testctl
working-directory: qe-tools/bin

- uses: actions/checkout@v4
with:
path: aerospike-client-python
sparse-checkout: |
test/${{ env.TEST_CONFIG_FILE_NAME }}
sparse-checkout-cone-mode: false

- name: Add AWS credentials
run: |
mkdir -p ~/.aws
cd ~/.aws
sections=("default" "qe")
for section in ${sections[@]};
do
cat <<-EOF >> credentials
[$section]
aws_access_key_id = ${{ secrets.QE_TEST_ENQUEUE_AWS_ACCESS_KEY_ID }}
aws_secret_access_key = ${{ secrets.QE_TEST_ENQUEUE_AWS_SECRET_ACCESS_KEY }}
region = us-west-1
EOF
done
shell: bash

# - run: testctl --version

# test-enqueue hides testctl's output, so this can be helpful for debugging
# - run: testctl --config staging run 901b1178-0159-452d-9b36-64d455e568f2 --deployment perf_client
# working-directory: aerospike-client-python/test/

- name: Allows us to get the exact test run id that was created by test-enqueue.
run: echo TESTCTL_USER=$(uuidgen) >> $GITHUB_ENV

- run: yq -i '.definitions.std.[0] = "${{ inputs.test-scenario }}"' ${{ env.TEST_CONFIG_FILE_NAME }}
working-directory: aerospike-client-python/test/

- name: Enqueue test run and fail fast if unable to enqueue
run: |
enqueue_count=$(test-enqueue --config staging --deployment perf_client ${{ env.TEST_CONFIG_FILE_NAME }} | grep "COUNT:" | sed 's/COUNT\://' | xargs)
if [[ "$enqueue_count" != "1" ]]; then
echo "We expected 1 test run to be enqueued, but $enqueue_count was actually enqueued."
exit 1
fi
working-directory: aerospike-client-python/test/

- name: Wait for test run to finish
id: poll-run-id
run: |
while true; do
# Color messes up the run_id's string
# Use xargs to trim whitespace from testctl's output
run_id=$(${{ env.TESTCTL_BINARY_NAME }} --config staging ps --no-color --user ${{ env.TESTCTL_USER }} -n 1 -status completed --columns RUN_ID | sed '1d' | xargs)
if [[ -z "$run_id" ]]; then
echo "Test run has not finished yet..."
sleep 2
else
echo "Test run $run_id has finished."
break
fi
done
echo "run_id=$run_id" >> "$GITHUB_OUTPUT"

# Downloading builds doesn't work here, so we disable it
- run: ${{ env.TESTCTL_BINARY_NAME }} --config staging download --skip-build-download ${{ steps.poll-run-id.outputs.run_id }}

- name: Print test run logs
run: |
cd ${{ steps.poll-run-id.outputs.run_id }}*/work/test_0
echo "stdout:"
cat stdout
echo "stderr:"
cat stderr

- name: Set Github job status
run: |
run_status=$(${{ env.TESTCTL_BINARY_NAME }} --config staging ps --no-color --user ${{ env.TESTCTL_USER }} -n 1 -status completed --columns STATUS | sed '1d' | xargs)
echo $run_status
if [[ "$run_status" == "Failure" ]]; then
exit 1
else
exit 0
fi

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 19 days ago

To fix the problem, add a permissions block to the workflow file to explicitly set the minimum required permissions for the GITHUB_TOKEN. Since the workflow does not appear to require any write access to repository contents, the safest default is to set permissions: contents: read at the top level of the workflow. This will apply to all jobs unless overridden. The change should be made near the top of the file, after the name: (if present) or after the on: block, and before the jobs: block. No additional imports or definitions are required.


Suggested changeset 1
.github/workflows/run-qe-test.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/run-qe-test.yml b/.github/workflows/run-qe-test.yml
--- a/.github/workflows/run-qe-test.yml
+++ b/.github/workflows/run-qe-test.yml
@@ -8,2 +8,5 @@
 
+permissions:
+  contents: read
+
 jobs:
EOF
@@ -8,2 +8,5 @@

permissions:
contents: read

jobs:
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants