Skip to content

Commit

Permalink
test ci
Browse files Browse the repository at this point in the history
  • Loading branch information
JackyWoo committed Sep 19, 2024
1 parent 8f74f9f commit 3cd3a7e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 34 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:
run: sudo chmod 755 build/programs/raftkeeper

- name: Run integration Tests
run: bash .github/workflows/run-integration-test.sh tests/integration --junitxml=report.xml
run: bash .github/workflows/run-integration-test.sh tests/integration --junitxml=integration-test-report-${{ inputs.sanitize }}.xml

- name: Upload test report
if: always()
uses: actions/upload-artifact@v4
with:
name: integration-test-report-${{ inputs.sanitize }}.xml
path: tests/integration/report.xml
path: tests/integration/integration-test-report-${{ inputs.sanitize }}.xml
4 changes: 2 additions & 2 deletions .github/workflows/report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
with:
pattern: ${{ inputs.test_type }}-test-report-*
merge-multiple: true
path: ${{ github.workspace }}/build/test/${{ inputs.test_type }}/
path: build/test/${{ inputs.test_type }}/

- name: Comment test report on PR
if: always()
run: if [ -n "$(ls -A build/test/${{ inputs.test_type }}/ 2>/dev/null)" ]; then python3 .github/workflows/report.py ${{ github.workspace }}/build/test/${{ inputs.test_type }}/ ${{ inputs.test_type }}; fi
run: if [ -n "$(ls -A build/test/${{ inputs.test_type }}/ 2>/dev/null)" ]; then python3 .github/workflows/report.py build/test/${{ inputs.test_type }}/ ${{ inputs.test_type }}; fi
30 changes: 2 additions & 28 deletions .github/workflows/run-integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ test_result="succeed"
function run_tests()
{
echo "tests_root_dir: ${tests_root_dir}"
./runner --binary "${tests_root_dir}"/../../build/programs/raftkeeper \
--base-configs-dir "${tests_root_dir}"/../../programs/server \
./runner --binary ../../build/programs/raftkeeper \
--base-configs-dir ../../programs/server \
"\"$@\"" \
| tee /tmp/tests_output.log

Expand All @@ -34,32 +34,6 @@ function run_tests()
fi
}

function run_tests_individually()
{
# shellcheck disable=SC2207
test_cases=($(ls "$tests_root_dir" | grep test_))
# test_cases=(test_multinode_simple)
echo "Total ${#test_cases[*]} test cases to run."
# shellcheck disable=SC1073
for test_case in ${test_cases[*]}
do
echo -e "\n----------------- Run test $test_case -----------------"
./runner --binary "${tests_root_dir}"/../../build/programs/raftkeeper \
--base-configs-dir "${tests_root_dir}"/../../programs/server \
"$test_case"
# shellcheck disable=SC2181
if [ $? -ne 0 ]; then
test_result="failed"
raftkeeper_instances=$(ls "$test_case"/_instances | grep node)
for raftkeeper_instance in ${raftkeeper_instances[*]}
do
echo -e "\n----------------- Captured $test_case $raftkeeper_instance raftkeeper-server.log -----------------"
sudo cat "$test_case"/_instances/"$raftkeeper_instance"/logs/raftkeeper-server.log
done
fi
done
}


run_tests "$@"

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ jobs:

- name: Run unit tests
working-directory: ${{ github.workspace }}/build
run: sudo chmod 755 ./src/rk_unit_tests && ./src/rk_unit_tests --gtest_color=yes --gtest_output=xml:report.xml
run: sudo chmod 755 ./src/rk_unit_tests && ./src/rk_unit_tests --gtest_color=yes --gtest_output=xml:unit-test-report-${{ inputs.sanitize }}.xml

- name: Upload test report
if: always()
uses: actions/upload-artifact@v4
with:
name: unit-test-report-${{ inputs.sanitize }}.xml
path: build/report.xml
path: build/unit-test-report-${{ inputs.sanitize }}.xml

0 comments on commit 3cd3a7e

Please sign in to comment.