mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 11:55:03 +03:00
Added metrics for test runs
Refs CORE-120 When test runs execute, use the new @tryghost/metrics package to send metrics to configurable backends. At the moment, we're just sending the test run duration to our metric store in preparation of changes to the test suite.
This commit is contained in:
parent
d89b8448ab
commit
e9afa6f40f
35
.github/workflows/test.yml
vendored
35
.github/workflows/test.yml
vendored
@ -105,6 +105,9 @@ jobs:
|
|||||||
mysql root password: 'root'
|
mysql root password: 'root'
|
||||||
|
|
||||||
- run: yarn
|
- run: yarn
|
||||||
|
|
||||||
|
- run: date +%s > ${{ runner.temp }}/startTime # Get start time for test suite
|
||||||
|
|
||||||
- run: yarn test:e2e
|
- run: yarn test:e2e
|
||||||
env:
|
env:
|
||||||
database__connection__filename: /dev/shm/ghost-test.db
|
database__connection__filename: /dev/shm/ghost-test.db
|
||||||
@ -116,6 +119,38 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
database__connection__filename: /dev/shm/ghost-test.db
|
database__connection__filename: /dev/shm/ghost-test.db
|
||||||
|
|
||||||
|
# Get runtime in seconds for test suite
|
||||||
|
- run: |
|
||||||
|
startTime="$(cat ${{ runner.temp }}/startTime)"
|
||||||
|
endTime="$(date +%s)"
|
||||||
|
echo "test_time=$(($endTime-$startTime))" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Tailscale Action
|
||||||
|
uses: tailscale/github-action@v1
|
||||||
|
with:
|
||||||
|
authkey: ${{ secrets.TAILSCALE_AUTHKEY }}
|
||||||
|
|
||||||
|
# Report time taken to metrics service
|
||||||
|
- uses: sam-lord/action-trigger-metric@main
|
||||||
|
with:
|
||||||
|
metricName: 'test-time'
|
||||||
|
metricValue: ${{ env.test_time }}
|
||||||
|
configuration: |
|
||||||
|
{
|
||||||
|
"metrics": {
|
||||||
|
"transports": ["elasticsearch"],
|
||||||
|
"metadata": {
|
||||||
|
"database": "${{ matrix.env.DB }}",
|
||||||
|
"node": "${{ matrix.node }}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"elasticsearch": {
|
||||||
|
"host": "${{ secrets.ELASTICSEARCH_HOST }}",
|
||||||
|
"username": "${{ secrets.ELASTICSEARCH_USERNAME }}",
|
||||||
|
"password": "${{ secrets.ELASTICSEARCH_PASSWORD }}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- name: Unit test coverage
|
- name: Unit test coverage
|
||||||
run: yarn cov:unit
|
run: yarn cov:unit
|
||||||
- uses: codecov/codecov-action@v2
|
- uses: codecov/codecov-action@v2
|
||||||
|
Loading…
Reference in New Issue
Block a user