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

Performance tests: Fix date time log for commit #8072

Closed
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
9 changes: 1 addition & 8 deletions .github/workflows/reusable-performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -331,20 +331,13 @@ jobs:
- name: Set commit details
# Only needed when publishing results.
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached && ! inputs.multisite }}
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
id: commit-timestamp
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const commit_details = await github.rest.git.getCommit({ owner: context.repo.owner, repo: context.repo.repo, commit_sha: context.sha });
return parseInt((new Date( commit_details.data.author.date ).getTime() / 1000).toFixed(0))
run: echo "COMMITTED_AT=$(git show -s $GITHUB_SHA --format='%cI')" >> $GITHUB_ENV
mukeshpanchal27 marked this conversation as resolved.
Show resolved Hide resolved
felixarntz marked this conversation as resolved.
Show resolved Hide resolved

- name: Publish performance results
# Only publish results on pushes to trunk.
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/trunk' && ! inputs.memcached && ! inputs.multisite }}
env:
BASE_SHA: ${{ steps.base-sha.outputs.result }}
COMMITTED_AT: ${{ steps.commit-timestamp.outputs.result }}
CODEVITALS_PROJECT_TOKEN: ${{ secrets.CODEVITALS_PROJECT_TOKEN }}
HOST_NAME: "www.codevitals.run"
run: |
Expand Down
4 changes: 2 additions & 2 deletions tests/performance/log-results.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* External dependencies.
*/
const https = require( 'https' );
const [ token, branch, hash, baseHash, timestamp, host ] =
const [ token, branch, hash, baseHash, date, host ] =
process.argv.slice( 2 );
const { median, parseFile, accumulateValues } = require( './utils' );

Expand Down Expand Up @@ -87,7 +87,7 @@ const data = new TextEncoder().encode(
branch,
hash,
baseHash,
timestamp: parseInt( timestamp, 10 ),
timestamp: date,
metrics: metrics,
baseMetrics: baseMetrics,
} )
Expand Down
Loading