Stress tests #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Stress tests | |
on: | |
workflow_dispatch: | |
inputs: | |
ref: | |
type: string | |
description: Git ref to run tests on | |
required: true | |
default: main | |
test-type: | |
description: Type of test to run | |
options: | |
- ci-stress | |
- ci-nightly | |
required: true | |
type: string | |
test-timeout-minutes: | |
description: 'Timeout for the test, in minutes (stress: 20, nightly: 360)' | |
required: true | |
type: number | |
default: 360 | |
reuse-v8-context: | |
description: Whether to enable the "reuse V8 context" feature | |
required: true | |
type: boolean | |
default: true | |
workflow_call: | |
inputs: | |
test-type: | |
required: true | |
type: string | |
test-timeout-minutes: | |
required: true | |
type: number | |
reuse-v8-context: | |
required: true | |
type: boolean | |
env: | |
TEMPORAL_TESTING_LOG_DIR: /tmp/worker-logs | |
TEMPORAL_TESTING_MEM_LOG_DIR: /tmp/worker-mem-logs | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
REUSE_V8_CONTEXT: ${{ inputs.reuse-v8-context }} | |
jobs: | |
stress-test: | |
runs-on: buildjet-4vcpu-ubuntu-2204 | |
steps: | |
- name: Print build info | |
run: 'echo test-type: ${{ inputs.test-type }}, test-timeout-minutes: ${{ inputs.test-timeout-minutes }}, reuse-v8-context: $REUSE_V8_CONTEXT' | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Install protoc | |
uses: arduino/setup-protoc@v1 | |
with: | |
version: '3.x' | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: Swatinem/rust-cache@v1 | |
with: | |
working-directory: packages/core-bridge | |
# Don't build during install phase since we're going to explicitly build | |
- run: npm ci --ignore-scripts | |
- run: npm run build | |
env: | |
BUILD_CORE_RELEASE: true | |
# docker-compose | |
- name: Checkout docker-compose repo | |
uses: actions/checkout@v2 | |
with: | |
repository: temporalio/docker-compose | |
path: docker-compose | |
- name: Start Temporal Server | |
run: docker-compose up -d | |
working-directory: docker-compose | |
- name: Wait for Temporal Server | |
run: npm run wait-namespace | |
# end:docker-compose | |
- run: mkdir -p $TEMPORAL_TESTING_LOG_DIR/tails | |
- run: mkdir -p $TEMPORAL_TESTING_MEM_LOG_DIR | |
- run: 'timeout ${{ inputs.test-timeout-minutes }}m npm run ${{ inputs.test-type }}' | |
- run: for f in $TEMPORAL_TESTING_LOG_DIR/*.log; do tail -20000 $f > $TEMPORAL_TESTING_LOG_DIR/tails/$(basename $f); done | |
if: ${{ always() }} | |
- uses: actions/upload-artifact@v3 | |
if: ${{ always() }} | |
with: | |
name: worker-logs | |
path: ${{ env.TEMPORAL_TESTING_LOG_DIR }}/tails | |
- uses: actions/upload-artifact@v3 | |
if: ${{ always() }} | |
with: | |
name: worker-mem-logs | |
path: ${{ env.TEMPORAL_TESTING_MEM_LOG_DIR }} | |
# TODO: set up alerting | |
# TODO: record test durations and other metrics like memory usage / cache utilization / CPU |