-
Notifications
You must be signed in to change notification settings - Fork 83
112 lines (92 loc) · 3.9 KB
/
execution-test.yml
File metadata and controls
112 lines (92 loc) · 3.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: QA - Execution Test
on:
workflow_dispatch:
inputs:
stop_at_block:
description: 'Block number to stop at; none for all'
required: false
stop_at_stage:
description: 'Stage to stop at; none for all; sample values: "Execution", "IntermediateHashes", "HashState", "HistoryIndex"'
required: false
type: string
clean_datadir:
description: 'Remove datadir before running the test'
type: boolean
default: true
jobs:
execution-test-suite:
runs-on: [ self-hosted, Erigon2 ] # must run on E2 not to steal E3 runner, which is used for PR approval
timeout-minutes: 7200 # 5 days
env:
ERIGON_QA_PATH: /opt/erigon-qa
CHAIN: mainnet
STOP_AT_BLOCK: ${{github.event.inputs.stop_at_block}}
STOP_AT_STAGE: ${{github.event.inputs.stop_at_stage}}
TRACKING_TIME_SECONDS: 431400 # 5 days minus 10 minutes
TOTAL_TIME_SECONDS: 431400
steps:
- name: Checkout Silkworm Repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: "0"
- name: Clean Build Directory
run: rm -rf ${{runner.workspace}}/silkworm/build
- name: Clean Database Directory
if: ${{github.event.inputs.clean_datadir}}
run: rm -rf ${{runner.workspace}}/silkworm_datadir
- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/silkworm/build
- name: Configure CMake
working-directory: ${{runner.workspace}}/silkworm/build
run: |
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release
- name: Build Silkworm
working-directory: ${{runner.workspace}}/silkworm/build
run: cmake --build . --config Release --target silkworm -j 8
- name: Pause the Erigon instance dedicated to db maintenance
run: |
python3 $ERIGON_QA_PATH/test_system/db-producer/pause_production.py || true
- name: Run Execution Test
id: test_step
working-directory: ${{runner.workspace}}/silkworm/build/cmd
run: |
set +e # Disable exit on error
# Run Silkworm, wait until the end of historical execution and check the result
python3 $ERIGON_QA_PATH/test_system/qa-tests/silkworm-execution/run_and_check_execution.py \
${{runner.workspace}}/silkworm/build/cmd ${{runner.workspace}}/silkworm_datadir $TRACKING_TIME_SECONDS $TOTAL_TIME_SECONDS $CHAIN
# Capture monitoring script exit status
test_exit_status=$?
# Save the subsection reached status
echo "::set-output name=test_executed::true"
# Check test runner exit status
if [ $test_exit_status -eq 0 ]; then
echo "tests completed successfully"
echo "TEST_RESULT=success" >> "$GITHUB_OUTPUT"
else
echo "error detected during tests"
echo "TEST_RESULT=failure" >> "$GITHUB_OUTPUT"
fi
- name: Resume the Erigon instance dedicated to db maintenance
run: |
python3 $ERIGON_QA_PATH/test_system/db-producer/resume_production.py || true
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: ${{runner.workspace}}/result-${{ env.CHAIN }}.json
- name: Upload Silkworm full log
if: always()
uses: actions/upload-artifact@v4
with:
name: silkworm-log
path: ${{runner.workspace}}/silkworm/build/cmd/silkworm.log
- name: Action for Success
if: steps.test_step.outputs.TEST_RESULT == 'success'
run: echo "::notice::Tests completed successfully"
- name: Action for Failure
if: steps.test_step.outputs.TEST_RESULT != 'success'
run: |
echo "::error::Error detected during tests"
exit 1