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

ci(test): add tag with commit sha to ci tests #2409

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
ARTILLERY_BINARY_PATH: ${{ github.workspace }}/packages/artillery/bin/run
CLI_TAGS: repo:${{ github.repository }},actor:${{ github.actor }},type:smoke,ci:true
CLI_TAGS: repo:${{ github.repository }},actor:${{ github.actor }},type:smoke,ci:true,commit:${{ github.sha }}
CLI_NOTE: Running from the Official Artillery Github Action! 😀

jobs:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/run-aws-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
ARTILLERY_CLOUD_API_KEY: ${{ secrets.ARTILLERY_CLOUD_API_KEY_TEST }}
GITHUB_REPO: ${{ github.repository }}
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -77,4 +78,4 @@ jobs:

- run: npm run test:aws --workspace artillery-engine-playwright
env:
FORCE_COLOR: 1
FORCE_COLOR: 1
7 changes: 6 additions & 1 deletion packages/artillery/test/cli/_helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,13 @@ function getTestTags(additionalTags) {
const actorTag = `actor:${process.env.GITHUB_ACTOR || 'localhost'}`;
const repoTag = `repo:${process.env.GITHUB_REPO || 'artilleryio/artillery'}`;
const ciTag = `ci:${process.env.GITHUB_ACTIONS ? 'true' : 'false'}`;
const baseTags = [repoTag, actorTag, ciTag];

return `${repoTag},${actorTag},${ciTag},${additionalTags.join(',')}`;
if (process.env.GITHUB_SHA) {
baseTags.push(`commit:${process.env.GITHUB_SHA}`);
Copy link
Member

Choose a reason for hiding this comment

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

Can we send them shorter? (short sha)

Suggested change
baseTags.push(`commit:${process.env.GITHUB_SHA}`);
baseTags.push(`commit:${process.env.GITHUB_SHA.substring(0, 7)}`);

}

return `${[...baseTags, ...additionalTags].join(',')}`;
}

module.exports = {
Expand Down