From 645f3fd126ba875ed4401ff3dc04dec8e391cbe0 Mon Sep 17 00:00:00 2001 From: Maksym Vlasov Date: Thu, 6 Jan 2022 13:25:32 +0200 Subject: [PATCH] chore: Cleanup file with test data (#311) --- .github/CONTRIBUTING.md | 4 ++++ .github/workflows/release.yml | 3 ++- tests/hooks_performance_test.sh | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index dc3191a..7c4178c 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -56,6 +56,10 @@ Script accept next options: | 5 | `RAW_TEST_`
`RESULTS_FILE_NAME` | `terraform_tfsec_pr123` | (Temporary) File where all test data will be stored. | +> **Note:** To make test results repeatable and comparable, be sure that on the test machine nothing generates an unstable workload. During tests good to stop any other apps and do not interact with the test machine. +> +> Otherwise, for eg, when you watch Youtube videos during one test and not during other, test results can differ up to 30% for the same test. + ### Run via BASH ```bash diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9c51c32..3018771 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,8 @@ on: - '**/*.sh' - 'Dockerfile' - '.pre-commit-hooks.yaml' - + # Ignore paths + - '!tests/**' jobs: release: name: Release diff --git a/tests/hooks_performance_test.sh b/tests/hooks_performance_test.sh index 77a353f..342bb30 100755 --- a/tests/hooks_performance_test.sh +++ b/tests/hooks_performance_test.sh @@ -17,6 +17,8 @@ function run_tests { RESULTS_DIR="$(pwd)/tests/results" cd "$TEST_DIR" || { echo "Specified TEST_DIR does not exist" && exit 1; } + # Cleanup + rm "$RESULTS_DIR/$FILE_NAME_TO_SAVE_TEST_RESULTS" for ((i = 1; i <= TEST_NUM; i++)); do {