From 9442a8ca2023ef31f2363db6adcc4ec7225e28c6 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Mon, 16 Aug 2021 14:05:35 -0400 Subject: [PATCH 01/49] Adding gotestsum to integration tests --- test/scripts/e2e_go_tests.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/scripts/e2e_go_tests.sh b/test/scripts/e2e_go_tests.sh index 09371bb889..158f5b43f9 100755 --- a/test/scripts/e2e_go_tests.sh +++ b/test/scripts/e2e_go_tests.sh @@ -7,7 +7,15 @@ set -o pipefail export GOPATH=$(go env GOPATH) export GO111MODULE=on +# GOTESTCOMMAND=${GOTESTCOMMAND:="go test"} +if [ -z $(which gotestsum) ]; then GOTESTCOMMAND=${GOTESTCOMMAND:="go test"} +else +GOTESTCOMMAND=${GOTESTCOMMAND:="gotestsum --format pkgname --jsonfile testresults.json --"} +fi + +echo "GOTESTCOMMAND IS: ${GOTESTCOMMAND}" +exit # If one or more -t are specified, use GOTESTCOMMAND -run for each From 68e791cfedc80bb9e50684c6fccbc3ca8f6505ff Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Mon, 16 Aug 2021 14:15:52 -0400 Subject: [PATCH 02/49] Removed a testing block --- test/scripts/e2e_go_tests.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/test/scripts/e2e_go_tests.sh b/test/scripts/e2e_go_tests.sh index 158f5b43f9..6a3e72d6b9 100755 --- a/test/scripts/e2e_go_tests.sh +++ b/test/scripts/e2e_go_tests.sh @@ -15,7 +15,6 @@ GOTESTCOMMAND=${GOTESTCOMMAND:="gotestsum --format pkgname --jsonfile testresult fi echo "GOTESTCOMMAND IS: ${GOTESTCOMMAND}" -exit # If one or more -t are specified, use GOTESTCOMMAND -run for each From f20b6d080409c6ba4536419d63eae21ec63ff784 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Tue, 17 Aug 2021 16:14:33 -0400 Subject: [PATCH 03/49] Adding test results dir --- test/scripts/e2e_go_tests.sh | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/test/scripts/e2e_go_tests.sh b/test/scripts/e2e_go_tests.sh index 6a3e72d6b9..81619eff67 100755 --- a/test/scripts/e2e_go_tests.sh +++ b/test/scripts/e2e_go_tests.sh @@ -5,16 +5,18 @@ echo "######################################################################" set -e set -o pipefail -export GOPATH=$(go env GOPATH) +GOPATH=$(go env GOPATH) +export GOPATH export GO111MODULE=on -# GOTESTCOMMAND=${GOTESTCOMMAND:="go test"} -if [ -z $(which gotestsum) ]; then -GOTESTCOMMAND=${GOTESTCOMMAND:="go test"} + +if [ -z "$(which gotestsum)" ]; then + GOTESTCOMMAND=${GOTESTCOMMAND:="go test"} else -GOTESTCOMMAND=${GOTESTCOMMAND:="gotestsum --format pkgname --jsonfile testresults.json --"} + TEST_RESULTS=${TEST_RESULTS:="$(pwd)"} + GOTESTCOMMAND=${GOTESTCOMMAND:="gotestsum --format pkgname --jsonfile ${TEST_RESULTS}/testresults.json --"} fi -echo "GOTESTCOMMAND IS: ${GOTESTCOMMAND}" +echo "GOTESTCOMMAND will be: ${GOTESTCOMMAND}" # If one or more -t are specified, use GOTESTCOMMAND -run for each @@ -24,7 +26,7 @@ while [ "$1" != "" ]; do case "$1" in -t) shift - TESTPATTERNS+=($1) + TESTPATTERNS+=("$1") ;; -norace) NORACEBUILD="TRUE" @@ -42,7 +44,7 @@ REPO_ROOT="$( cd "$(dirname "$0")" ; pwd -P )"/../.. if [ "${NORACEBUILD}" = "" ]; then # Need bin-race binaries for e2e tests - pushd ${REPO_ROOT} + pushd "${REPO_ROOT}" make build-race -j4 popd RACE_OPTION="-race" @@ -66,7 +68,7 @@ fi echo "Test output can be found in ${TESTDIR}" if [ "${SRCROOT}" = "" ]; then - export SRCROOT=${REPO_ROOT} + export SRCROOT="${REPO_ROOT}" fi if [ "${NODEBINDIR}" = "" ]; then @@ -85,7 +87,7 @@ echo "PATH: ${PATH}" echo "SRCROOT: ${SRCROOT}" echo "TESTDATADIR: ${TESTDATADIR}" -cd ${SRCROOT}/test/e2e-go +cd "${SRCROOT}"/test/e2e-go # ARM64 has some memory related issues with fork. Since we don't really care # about testing the forking capabilities, we're just run the tests one at a time. @@ -99,15 +101,15 @@ fi echo "PARALLEL_FLAG = ${PARALLEL_FLAG}" if [ "${#TESTPATTERNS[@]}" -eq 0 ]; then - ${GOTESTCOMMAND} ${RACE_OPTION} ${PARALLEL_FLAG} -timeout 1h -v ${SHORTTEST} ./... + ${GOTESTCOMMAND} "${RACE_OPTION}" "${PARALLEL_FLAG}" -timeout 1h -v "${SHORTTEST}" ./... else - for TEST in ${TESTPATTERNS[@]}; do - ${GOTESTCOMMAND} ${RACE_OPTION} ${PARALLEL_FLAG} -timeout 1h -v ${SHORTTEST} -run ${TEST} ./... + for TEST in "${TESTPATTERNS[@]}"; do + ${GOTESTCOMMAND} "${RACE_OPTION}" "${PARALLEL_FLAG}" -timeout 1h -v "${SHORTTEST}" -run "${TEST}" ./... done fi if [ ${CLEANUP_TEMPDIR} -ne 0 ]; then - rm -rf ${TEMPDIR} + rm -rf "${TEMPDIR}" fi echo "----------------------------------------------------------------------" From ec23752b36571f6ec49165fcaa99434911764183 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Tue, 17 Aug 2021 16:57:29 -0400 Subject: [PATCH 04/49] Undoing shellcheck improvements --- test/scripts/e2e_go_tests.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/scripts/e2e_go_tests.sh b/test/scripts/e2e_go_tests.sh index 81619eff67..7c0e5b8e49 100755 --- a/test/scripts/e2e_go_tests.sh +++ b/test/scripts/e2e_go_tests.sh @@ -26,7 +26,7 @@ while [ "$1" != "" ]; do case "$1" in -t) shift - TESTPATTERNS+=("$1") + TESTPATTERNS+=($1) ;; -norace) NORACEBUILD="TRUE" @@ -44,7 +44,7 @@ REPO_ROOT="$( cd "$(dirname "$0")" ; pwd -P )"/../.. if [ "${NORACEBUILD}" = "" ]; then # Need bin-race binaries for e2e tests - pushd "${REPO_ROOT}" + pushd ${REPO_ROOT} make build-race -j4 popd RACE_OPTION="-race" @@ -68,7 +68,7 @@ fi echo "Test output can be found in ${TESTDIR}" if [ "${SRCROOT}" = "" ]; then - export SRCROOT="${REPO_ROOT}" + export SRCROOT=${REPO_ROOT} fi if [ "${NODEBINDIR}" = "" ]; then @@ -87,7 +87,7 @@ echo "PATH: ${PATH}" echo "SRCROOT: ${SRCROOT}" echo "TESTDATADIR: ${TESTDATADIR}" -cd "${SRCROOT}"/test/e2e-go +cd ${SRCROOT}/test/e2e-go # ARM64 has some memory related issues with fork. Since we don't really care # about testing the forking capabilities, we're just run the tests one at a time. @@ -109,7 +109,7 @@ else fi if [ ${CLEANUP_TEMPDIR} -ne 0 ]; then - rm -rf "${TEMPDIR}" + rm -rf ${TEMPDIR} fi echo "----------------------------------------------------------------------" From 58a3b56b2991b8e660ab1d5df278da202ba90bf8 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Tue, 17 Aug 2021 17:21:20 -0400 Subject: [PATCH 05/49] Undoing shellcheck improvements --- test/scripts/e2e_go_tests.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/scripts/e2e_go_tests.sh b/test/scripts/e2e_go_tests.sh index 7c0e5b8e49..f9bfa232b4 100755 --- a/test/scripts/e2e_go_tests.sh +++ b/test/scripts/e2e_go_tests.sh @@ -5,8 +5,7 @@ echo "######################################################################" set -e set -o pipefail -GOPATH=$(go env GOPATH) -export GOPATH +export GOPATH=$(go env GOPATH) export GO111MODULE=on if [ -z "$(which gotestsum)" ]; then @@ -101,10 +100,10 @@ fi echo "PARALLEL_FLAG = ${PARALLEL_FLAG}" if [ "${#TESTPATTERNS[@]}" -eq 0 ]; then - ${GOTESTCOMMAND} "${RACE_OPTION}" "${PARALLEL_FLAG}" -timeout 1h -v "${SHORTTEST}" ./... + ${GOTESTCOMMAND} ${RACE_OPTION} ${PARALLEL_FLAG} -timeout 1h -v ${SHORTTEST} ./... else - for TEST in "${TESTPATTERNS[@]}"; do - ${GOTESTCOMMAND} "${RACE_OPTION}" "${PARALLEL_FLAG}" -timeout 1h -v "${SHORTTEST}" -run "${TEST}" ./... + for TEST in ${TESTPATTERNS[@]}; do + ${GOTESTCOMMAND} ${RACE_OPTION} ${PARALLEL_FLAG} -timeout 1h -v ${SHORTTEST} -run ${TEST} ./... done fi From 12bb9425322a1d1cf353a44152158cb2d1d44c8d Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Tue, 17 Aug 2021 18:48:57 -0400 Subject: [PATCH 06/49] Added junit file for test results --- test/scripts/e2e_go_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/scripts/e2e_go_tests.sh b/test/scripts/e2e_go_tests.sh index f9bfa232b4..4904303409 100755 --- a/test/scripts/e2e_go_tests.sh +++ b/test/scripts/e2e_go_tests.sh @@ -12,7 +12,7 @@ if [ -z "$(which gotestsum)" ]; then GOTESTCOMMAND=${GOTESTCOMMAND:="go test"} else TEST_RESULTS=${TEST_RESULTS:="$(pwd)"} - GOTESTCOMMAND=${GOTESTCOMMAND:="gotestsum --format pkgname --jsonfile ${TEST_RESULTS}/testresults.json --"} + GOTESTCOMMAND=${GOTESTCOMMAND:="gotestsum --format pkgname --junitfile ${TEST_RESULTS}/results.xml --jsonfile ${TEST_RESULTS}/testresults.json --"} fi echo "GOTESTCOMMAND will be: ${GOTESTCOMMAND}" From 3e167d4c8ec361de382d9def2f42b27bf89ce511 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Wed, 18 Aug 2021 14:35:22 -0400 Subject: [PATCH 07/49] Added new check job and result_path var --- .circleci/config.yml | 357 ++++++++++++++++++++++++------------------- 1 file changed, 202 insertions(+), 155 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c0d1c0181d..77f8e3666f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,76 +10,76 @@ workflows: build_pr: jobs: - codegen_verification - - amd64_build - - amd64_test: - requires: - - amd64_build - filters: - branches: - ignore: - - /rel\/.*/ - - /hotfix\/.*/ - - amd64_test_nightly: - requires: - - amd64_build - filters: - branches: - only: - - /rel\/.*/ - - /hotfix\/.*/ - context: slack-secrets - - amd64_integration: - requires: - - amd64_build - filters: - branches: - ignore: - - /rel\/.*/ - - /hotfix\/.*/ - - amd64_integration_nightly: - requires: - - amd64_build - filters: - branches: - only: - - /rel\/.*/ - - /hotfix\/.*/ - context: slack-secrets - - amd64_e2e_subs: - requires: - - amd64_build - filters: - branches: - ignore: - - /rel\/.*/ - - /hotfix\/.*/ - - amd64_e2e_subs_nightly: - requires: - - amd64_build - filters: - branches: - only: - - /rel\/.*/ - - /hotfix\/.*/ - context: slack-secrets + # - amd64_build + # - amd64_test: + # requires: + # - amd64_build + # filters: + # branches: + # ignore: + # - /rel\/.*/ + # - /hotfix\/.*/ + # - amd64_test_nightly: + # requires: + # - amd64_build + # filters: + # branches: + # only: + # - /rel\/.*/ + # - /hotfix\/.*/ + # context: slack-secrets + # - amd64_integration: + # requires: + # - amd64_build + # filters: + # branches: + # ignore: + # - /rel\/.*/ + # - /hotfix\/.*/ + # - amd64_integration_nightly: + # requires: + # - amd64_build + # filters: + # branches: + # only: + # - /rel\/.*/ + # - /hotfix\/.*/ + # context: slack-secrets + # - amd64_e2e_subs: + # requires: + # - amd64_build + # filters: + # branches: + # ignore: + # - /rel\/.*/ + # - /hotfix\/.*/ + # - amd64_e2e_subs_nightly: + # requires: + # - amd64_build + # filters: + # branches: + # only: + # - /rel\/.*/ + # - /hotfix\/.*/ + # context: slack-secrets - arm64_build - - arm64_test: - requires: - - arm64_build - filters: - branches: - ignore: - - /rel\/.*/ - - /hotfix\/.*/ - - arm64_test_nightly: - requires: - - arm64_build - filters: - branches: - only: - - /rel\/.*/ - - /hotfix\/.*/ - context: slack-secrets + # - arm64_test: + # requires: + # - arm64_build + # filters: + # branches: + # ignore: + # - /rel\/.*/ + # - /hotfix\/.*/ + # - arm64_test_nightly: + # requires: + # - arm64_build + # filters: + # branches: + # only: + # - /rel\/.*/ + # - /hotfix\/.*/ + # context: slack-secrets - arm64_integration: requires: - arm64_build @@ -88,85 +88,88 @@ workflows: ignore: - /rel\/.*/ - /hotfix\/.*/ - - arm64_integration_nightly: - requires: - - arm64_build - filters: - branches: - only: - - /rel\/.*/ - - /hotfix\/.*/ - context: slack-secrets - - arm64_e2e_subs: - requires: - - arm64_build - filters: - branches: - ignore: - - /rel\/.*/ - - /hotfix\/.*/ - - arm64_e2e_subs_nightly: - requires: - - arm64_build - filters: - branches: - only: - - /rel\/.*/ - - /hotfix\/.*/ - context: slack-secrets - - mac_amd64_build - - mac_amd64_test: - requires: - - mac_amd64_build - filters: - branches: - ignore: - - /rel\/.*/ - - /hotfix\/.*/ - - mac_amd64_test_nightly: - requires: - - mac_amd64_build - filters: - branches: - only: - - /rel\/.*/ - - /hotfix\/.*/ - context: slack-secrets - - mac_amd64_integration: - requires: - - mac_amd64_build - filters: - branches: - ignore: - - /rel\/.*/ - - /hotfix\/.*/ - - mac_amd64_integration_nightly: - requires: - - mac_amd64_build - filters: - branches: - only: - - /rel\/.*/ - - /hotfix\/.*/ - context: slack-secrets - - mac_amd64_e2e_subs: - requires: - - mac_amd64_build - filters: - branches: - ignore: - - /rel\/.*/ - - /hotfix\/.*/ - - mac_amd64_e2e_subs_nightly: + - arm64_integration_check: requires: - - mac_amd64_build - filters: - branches: - only: - - /rel\/.*/ - - /hotfix\/.*/ - context: slack-secrets - #- windows_x64_build + - arm64_integration + # - arm64_integration_nightly: + # requires: + # - arm64_build + # filters: + # branches: + # only: + # - /rel\/.*/ + # - /hotfix\/.*/ + # context: slack-secrets + # - arm64_e2e_subs: + # requires: + # - arm64_build + # filters: + # branches: + # ignore: + # - /rel\/.*/ + # - /hotfix\/.*/ + # - arm64_e2e_subs_nightly: + # requires: + # - arm64_build + # filters: + # branches: + # only: + # - /rel\/.*/ + # - /hotfix\/.*/ + # context: slack-secrets + # - mac_amd64_build + # - mac_amd64_test: + # requires: + # - mac_amd64_build + # filters: + # branches: + # ignore: + # - /rel\/.*/ + # - /hotfix\/.*/ + # - mac_amd64_test_nightly: + # requires: + # - mac_amd64_build + # filters: + # branches: + # only: + # - /rel\/.*/ + # - /hotfix\/.*/ + # context: slack-secrets + # - mac_amd64_integration: + # requires: + # - mac_amd64_build + # filters: + # branches: + # ignore: + # - /rel\/.*/ + # - /hotfix\/.*/ + # - mac_amd64_integration_nightly: + # requires: + # - mac_amd64_build + # filters: + # branches: + # only: + # - /rel\/.*/ + # - /hotfix\/.*/ + # context: slack-secrets + # - mac_amd64_e2e_subs: + # requires: + # - mac_amd64_build + # filters: + # branches: + # ignore: + # - /rel\/.*/ + # - /hotfix\/.*/ + # - mac_amd64_e2e_subs_nightly: + # requires: + # - mac_amd64_build + # filters: + # branches: + # only: + # - /rel\/.*/ + # - /hotfix\/.*/ + # context: slack-secrets + ##- windows_x64_build commands: prepare_go: @@ -276,10 +279,13 @@ commands: short_test_flag: type: string default: "" + result_path: + type: string + default: "/tmp/results" steps: - attach_workspace: at: << parameters.circleci_home >> - - run: mkdir -p /tmp/results/<< parameters.result_subdir >> + - run: mkdir -p << result_path >>/<< parameters.result_subdir >> - restore_cache: keys: - 'go-cache-{{ .Environment.CIRCLE_STAGE }}-' @@ -303,12 +309,16 @@ commands: export PARTITION_TOTAL=$CIRCLE_NODE_TOTAL export PARTITION_ID=$CIRCLE_NODE_INDEX export PARALLEL_FLAG="-p 1" - gotestsum --format pkgname --junitfile /tmp/results/<< parameters.result_subdir >>/results.xml --jsonfile /tmp/results/<< parameters.result_subdir >>/testresults.json -- --tags "sqlite_unlock_notify sqlite_omit_load_extension" << parameters.short_test_flag >> -race -timeout 1h -coverprofile=coverage.txt -covermode=atomic -p 1 $PACKAGE_NAMES + gotestsum --format pkgname --junitfile << result_path >>/<< parameters.result_subdir >>/results.xml --jsonfile << result_path >>/<< parameters.result_subdir >>/testresults.json -- --tags "sqlite_unlock_notify sqlite_omit_load_extension" << parameters.short_test_flag >> -race -timeout 1h -coverprofile=coverage.txt -covermode=atomic -p 1 $PACKAGE_NAMES - store_artifacts: - path: /tmp/results + path: << result_path >> destination: test-results - store_test_results: - path: /tmp/results + path: << result_path >> + - persist_to_workspace: + root: << result_path >> + paths: + - << parameters.result_subdir >> - save_cache: key: 'go-cache-{{ .Environment.CIRCLE_STAGE }}-{{ .Environment.CIRCLE_BUILD_NUM }}' paths: @@ -337,10 +347,13 @@ commands: short_test_flag: type: string default: "" + result_path: + type: string + default: "/tmp/results" steps: - attach_workspace: at: << parameters.circleci_home >> - - run: mkdir -p /tmp/results/<< parameters.result_subdir >> + - run: mkdir -p << parameters.result_path >>/<< parameters.result_subdir >> - run: name: Run integration tests no_output_timeout: << parameters.no_output_timeout >> @@ -358,15 +371,41 @@ commands: scripts/buildtools/install_buildtools.sh -o "gotest.tools/gotestsum" export ALGOTEST=1 export SHORTTEST=<< parameters.short_test_flag >> - export TEST_RESULTS=/tmp/results/<< parameters.result_subdir >> + export TEST_RESULTS=<< parameters.result_path >>/<< parameters.result_subdir >> export PARTITION_TOTAL=$CIRCLE_NODE_TOTAL export PARTITION_ID=$CIRCLE_NODE_INDEX test/scripts/run_integration_tests.sh - store_artifacts: - path: /tmp/results + path: << parameters.result_path >> destination: test-results - store_test_results: - path: /tmp/results + path: << parameters.result_path >> + - persist_to_workspace: + root: << result_path >> + paths: + - << parameters.result_subdir >> + + generic_tests_check: + description: Check if all tests were run at least once and only once across all parallel runs + parameters: + circleci_home: + type: string + default: "/home/circleci" + result_path: + type: string + default: "/tmp/results" + result_subdir: + type: string + steps: + - attach_workspace: + at: << parameters.result_path >> + - run: + name: Check if all tests were run + command: | + echo "Result Path/Subdir: << parameters.result_path >>/<< parameters.result_subdir >>" + ls << parameters.result_path >>/<< parameters.result_subdir >> + echo "Could be inside other workspace: << parameters.circleci_home >>/<< parameters.result_path >>/<< parameters.result_subdir >>" + ls << parameters.circleci_home >>/<< parameters.result_path >>/<< parameters.result_subdir >> jobs: codegen_verification: @@ -525,6 +564,14 @@ jobs: result_subdir: arm64-integration short_test_flag: "-short" + arm64_integration_check: + machine: + image: ubuntu-2004:202101-01 + resource_class: arm.small + steps: + - generic_tests_check + result_subdir: arm64-integration + arm64_integration_nightly: machine: image: ubuntu-2004:202101-01 From d35acb0f2dd3d54aed22beb841ffce3eec2a7446 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Wed, 18 Aug 2021 14:41:14 -0400 Subject: [PATCH 08/49] Fixed typo --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 77f8e3666f..48b55e60b5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -569,7 +569,7 @@ jobs: image: ubuntu-2004:202101-01 resource_class: arm.small steps: - - generic_tests_check + - generic_tests_check: result_subdir: arm64-integration arm64_integration_nightly: From 6c6a3b27efc77ab504220116eb7f7feeac35a19d Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Wed, 18 Aug 2021 14:50:29 -0400 Subject: [PATCH 09/49] Fixed parameter reference --- .circleci/config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 48b55e60b5..15edb41eea 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -285,7 +285,7 @@ commands: steps: - attach_workspace: at: << parameters.circleci_home >> - - run: mkdir -p << result_path >>/<< parameters.result_subdir >> + - run: mkdir -p << parameters.result_path >>/<< parameters.result_subdir >> - restore_cache: keys: - 'go-cache-{{ .Environment.CIRCLE_STAGE }}-' @@ -309,14 +309,14 @@ commands: export PARTITION_TOTAL=$CIRCLE_NODE_TOTAL export PARTITION_ID=$CIRCLE_NODE_INDEX export PARALLEL_FLAG="-p 1" - gotestsum --format pkgname --junitfile << result_path >>/<< parameters.result_subdir >>/results.xml --jsonfile << result_path >>/<< parameters.result_subdir >>/testresults.json -- --tags "sqlite_unlock_notify sqlite_omit_load_extension" << parameters.short_test_flag >> -race -timeout 1h -coverprofile=coverage.txt -covermode=atomic -p 1 $PACKAGE_NAMES + gotestsum --format pkgname --junitfile << parameters.result_path >>/<< parameters.result_subdir >>/results.xml --jsonfile << parameters.result_path >>/<< parameters.result_subdir >>/testresults.json -- --tags "sqlite_unlock_notify sqlite_omit_load_extension" << parameters.short_test_flag >> -race -timeout 1h -coverprofile=coverage.txt -covermode=atomic -p 1 $PACKAGE_NAMES - store_artifacts: - path: << result_path >> + path: << parameters.result_path >> destination: test-results - store_test_results: - path: << result_path >> + path: << parameters.result_path >> - persist_to_workspace: - root: << result_path >> + root: << parameters.result_path >> paths: - << parameters.result_subdir >> - save_cache: @@ -381,7 +381,7 @@ commands: - store_test_results: path: << parameters.result_path >> - persist_to_workspace: - root: << result_path >> + root: << parameters.result_path >> paths: - << parameters.result_subdir >> From e4aaf7630c36868487f8b087c3bd422bf0f76429 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Wed, 18 Aug 2021 19:53:42 -0400 Subject: [PATCH 10/49] Added script to check for tests --- .circleci/config.yml | 19 +++++---- scripts/buildtools/check_tests.py | 65 +++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+), 8 deletions(-) create mode 100755 scripts/buildtools/check_tests.py diff --git a/.circleci/config.yml b/.circleci/config.yml index 15edb41eea..95b91ef407 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,7 +9,7 @@ workflows: version: 2 build_pr: jobs: - - codegen_verification + # - codegen_verification # - amd64_build # - amd64_test: # requires: @@ -402,10 +402,12 @@ commands: - run: name: Check if all tests were run command: | - echo "Result Path/Subdir: << parameters.result_path >>/<< parameters.result_subdir >>" - ls << parameters.result_path >>/<< parameters.result_subdir >> - echo "Could be inside other workspace: << parameters.circleci_home >>/<< parameters.result_path >>/<< parameters.result_subdir >>" - ls << parameters.circleci_home >>/<< parameters.result_path >>/<< parameters.result_subdir >> + echo "Checking contents of testresults.json:" + cat << parameters.result_path >>/<< parameters.result_subdir >>/testresults.json + python3 scripts/buildtools/check_tests.py << parameters.result_path >>/<< parameters.result_subdir >>/testresults.json + - store_artifacts: + path: << parameters.result_path >>/<< parameters.result_subdir >> + destination: << parameters.result_subdir >>/combined-test-results jobs: codegen_verification: @@ -565,10 +567,11 @@ jobs: short_test_flag: "-short" arm64_integration_check: - machine: - image: ubuntu-2004:202101-01 - resource_class: arm.small + docker: + - image: python:3.9.6-alpine + resource_class: medium steps: + - checkout - generic_tests_check: result_subdir: arm64-integration diff --git a/scripts/buildtools/check_tests.py b/scripts/buildtools/check_tests.py new file mode 100755 index 0000000000..6e9baac445 --- /dev/null +++ b/scripts/buildtools/check_tests.py @@ -0,0 +1,65 @@ +import json +import sys + +if len(sys.argv) != 2: + print("Wrong number of arguments passed. Please pass one argument: json format test results file path (e.g. /tmp/results/testresults.json)") + sys.exit(1) +filepath = sys.argv[1] + +testList = [] +# testListRan = [] +testListPassed = [] +# testListSkipped = [] +with open(filepath) as f: + for jsonObj in f: + testDict = json.loads(jsonObj) + if 'Test' not in testDict: + continue + + fullTestName = testDict['Package'] + ' ' + testDict['Test'] + testList.append(fullTestName) + # actions can be: output, run, skip, pass + if 'pass' in testDict["Action"]: + testListPassed.append(fullTestName) + # elif testDict["Action"] == 'run': + # testListRan.append(fullTestName) + # elif testDict["Action"] == 'skip': + # testListSkipped.append(fullTestName) + +f.close() + +# Dedup: +testListDeduped = list(set(testList)) +# testListRanDeduped = list(set(testListRan)) +# testListSkippedDeduped = list(set(testListSkipped)) +testListPassedDeduped = list(set(testListPassed)) +countTotalDeduped = len(testListDeduped) +countPassed = len(testListPassed) +countPassedDeduped = len(testListPassedDeduped) + +print("Saw " + str(countTotalDeduped) + " tests total") +# print(str(len(testListRanDeduped)) + " ran") +# print(str(len(testListSkippedDeduped)) + " skipped") +print(str(countPassed) + " passed before dedup") +print(str(countPassedDeduped) + " passed after dedup") +errorCode = '' +if countTotalDeduped != countPassedDeduped: + countNotPassed = countTotalDeduped - countPassedDeduped + print(str(countNotPassed) + " tests didn't pass!!") + notPassed = set(testListDeduped) - set(testListPassedDeduped) + print("Here are the ones that didn't pass even once: ") + print(*sorted(notPassed), sep = "\n") + errorCode += "FAIL ERROR: " + str(countNotPassed) + " tests didn't pass!!\n" +else: + print("Seems all tests passed at least once ... OK") + +if countPassed != countPassedDeduped: + testDuplicates = set([testName + " " + str(testListPassed.count(testName)) for testName in testListPassed if testListPassed.count(testName) > 1]) + print(str(len(testDuplicates)) + " tests passed multiple times!! ... FAIL ERROR") + print("Here are the duplicates: ") + # print(*sorted(testDuplicates), sep = "\n") + errorCode += "FAIL ERROR: " + str(len(testDuplicates)) + " tests passed multiple times!!\n" +else: + print("Seems all tests that passed, passed only once ... OK") + +sys.exit(errorCode) From cff740f805460a71f8db7e17b712776d1dbf68fd Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Thu, 19 Aug 2021 14:09:32 -0400 Subject: [PATCH 11/49] Added partition id folders and recursive file list --- .circleci/config.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 95b91ef407..ded4065867 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -309,7 +309,7 @@ commands: export PARTITION_TOTAL=$CIRCLE_NODE_TOTAL export PARTITION_ID=$CIRCLE_NODE_INDEX export PARALLEL_FLAG="-p 1" - gotestsum --format pkgname --junitfile << parameters.result_path >>/<< parameters.result_subdir >>/results.xml --jsonfile << parameters.result_path >>/<< parameters.result_subdir >>/testresults.json -- --tags "sqlite_unlock_notify sqlite_omit_load_extension" << parameters.short_test_flag >> -race -timeout 1h -coverprofile=coverage.txt -covermode=atomic -p 1 $PACKAGE_NAMES + gotestsum --format pkgname --junitfile << parameters.result_path >>/<< parameters.result_subdir >>/${CIRCLE_NODE_INDEX}/results.xml --jsonfile << parameters.result_path >>/<< parameters.result_subdir >>/${CIRCLE_NODE_INDEX}/testresults.json -- --tags "sqlite_unlock_notify sqlite_omit_load_extension" << parameters.short_test_flag >> -race -timeout 1h -coverprofile=coverage.txt -covermode=atomic -p 1 $PACKAGE_NAMES - store_artifacts: path: << parameters.result_path >> destination: test-results @@ -371,7 +371,7 @@ commands: scripts/buildtools/install_buildtools.sh -o "gotest.tools/gotestsum" export ALGOTEST=1 export SHORTTEST=<< parameters.short_test_flag >> - export TEST_RESULTS=<< parameters.result_path >>/<< parameters.result_subdir >> + export TEST_RESULTS=<< parameters.result_path >>/<< parameters.result_subdir >>/$CIRCLE_NODE_INDEX export PARTITION_TOTAL=$CIRCLE_NODE_TOTAL export PARTITION_ID=$CIRCLE_NODE_INDEX test/scripts/run_integration_tests.sh @@ -383,7 +383,7 @@ commands: - persist_to_workspace: root: << parameters.result_path >> paths: - - << parameters.result_subdir >> + - << parameters.result_subdir >>/${CIRCLE_NODE_INDEX} generic_tests_check: description: Check if all tests were run at least once and only once across all parallel runs @@ -402,9 +402,10 @@ commands: - run: name: Check if all tests were run command: | - echo "Checking contents of testresults.json:" - cat << parameters.result_path >>/<< parameters.result_subdir >>/testresults.json - python3 scripts/buildtools/check_tests.py << parameters.result_path >>/<< parameters.result_subdir >>/testresults.json + ls -LR + # echo "Checking contents of testresults.json:" + # cat << parameters.result_path >>/<< parameters.result_subdir >>/testresults.json + # python3 scripts/buildtools/check_tests.py << parameters.result_path >>/<< parameters.result_subdir >>/testresults.json - store_artifacts: path: << parameters.result_path >>/<< parameters.result_subdir >> destination: << parameters.result_subdir >>/combined-test-results From eb1e87e151300d3611325f0fe789f82fb4c21066 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Thu, 19 Aug 2021 15:02:17 -0400 Subject: [PATCH 12/49] Creating node index folders --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ded4065867..c4ddc06c56 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -285,7 +285,7 @@ commands: steps: - attach_workspace: at: << parameters.circleci_home >> - - run: mkdir -p << parameters.result_path >>/<< parameters.result_subdir >> + - run: mkdir -p << parameters.result_path >>/<< parameters.result_subdir >>/$CIRCLE_NODE_INDEX - restore_cache: keys: - 'go-cache-{{ .Environment.CIRCLE_STAGE }}-' @@ -353,7 +353,7 @@ commands: steps: - attach_workspace: at: << parameters.circleci_home >> - - run: mkdir -p << parameters.result_path >>/<< parameters.result_subdir >> + - run: mkdir -p << parameters.result_path >>/<< parameters.result_subdir >>/$CIRCLE_NODE_INDEX - run: name: Run integration tests no_output_timeout: << parameters.no_output_timeout >> From 47eee529be4bdad7186243797e84fe9154f48514 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Thu, 19 Aug 2021 15:37:46 -0400 Subject: [PATCH 13/49] Fixing workspace paths --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c4ddc06c56..ea74de5465 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -383,7 +383,7 @@ commands: - persist_to_workspace: root: << parameters.result_path >> paths: - - << parameters.result_subdir >>/${CIRCLE_NODE_INDEX} + - << parameters.result_subdir >>/$CIRCLE_NODE_INDEX generic_tests_check: description: Check if all tests were run at least once and only once across all parallel runs From 744eca38d7a502288096c0eed7a1af24102d5806 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Thu, 19 Aug 2021 16:05:34 -0400 Subject: [PATCH 14/49] Fixing workspace paths --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ea74de5465..b66bf2567b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -383,7 +383,7 @@ commands: - persist_to_workspace: root: << parameters.result_path >> paths: - - << parameters.result_subdir >>/$CIRCLE_NODE_INDEX + - << parameters.result_subdir >> generic_tests_check: description: Check if all tests were run at least once and only once across all parallel runs From b73ee2b82b966aeaaf33ea6c7bdc9577989f6820 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Thu, 19 Aug 2021 16:53:13 -0400 Subject: [PATCH 15/49] Combining result files into one --- .circleci/config.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b66bf2567b..ca364624f3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -402,10 +402,8 @@ commands: - run: name: Check if all tests were run command: | - ls -LR - # echo "Checking contents of testresults.json:" - # cat << parameters.result_path >>/<< parameters.result_subdir >>/testresults.json - # python3 scripts/buildtools/check_tests.py << parameters.result_path >>/<< parameters.result_subdir >>/testresults.json + cat << parameters.result_path >>/<< parameters.result_subdir >>/**/testresults.json > << parameters.result_path >>/<< parameters.result_subdir >>/combined_testresults.json + python3 scripts/buildtools/check_tests.py << parameters.result_path >>/<< parameters.result_subdir >>/combined_testresults.json - store_artifacts: path: << parameters.result_path >>/<< parameters.result_subdir >> destination: << parameters.result_subdir >>/combined-test-results From 784072cd88a3ccb9194373b373437d41b0e6420b Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Thu, 19 Aug 2021 18:50:53 -0400 Subject: [PATCH 16/49] Making it run for all needed jobs --- .circleci/config.yml | 329 +++++++++++++++--------------- scripts/buildtools/check_tests.py | 29 +-- 2 files changed, 184 insertions(+), 174 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ca364624f3..8aa9e3eb90 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,77 +9,77 @@ workflows: version: 2 build_pr: jobs: - # - codegen_verification - # - amd64_build - # - amd64_test: - # requires: - # - amd64_build - # filters: - # branches: - # ignore: - # - /rel\/.*/ - # - /hotfix\/.*/ - # - amd64_test_nightly: - # requires: - # - amd64_build - # filters: - # branches: - # only: - # - /rel\/.*/ - # - /hotfix\/.*/ - # context: slack-secrets - # - amd64_integration: - # requires: - # - amd64_build - # filters: - # branches: - # ignore: - # - /rel\/.*/ - # - /hotfix\/.*/ - # - amd64_integration_nightly: - # requires: - # - amd64_build - # filters: - # branches: - # only: - # - /rel\/.*/ - # - /hotfix\/.*/ - # context: slack-secrets - # - amd64_e2e_subs: - # requires: - # - amd64_build - # filters: - # branches: - # ignore: - # - /rel\/.*/ - # - /hotfix\/.*/ - # - amd64_e2e_subs_nightly: - # requires: - # - amd64_build - # filters: - # branches: - # only: - # - /rel\/.*/ - # - /hotfix\/.*/ - # context: slack-secrets + - codegen_verification + - amd64_build + - amd64_test: + requires: + - amd64_build + filters: + branches: + ignore: + - /rel\/.*/ + - /hotfix\/.*/ + - amd64_test_nightly: + requires: + - amd64_build + filters: + branches: + only: + - /rel\/.*/ + - /hotfix\/.*/ + context: slack-secrets + - amd64_integration: + requires: + - amd64_build + filters: + branches: + ignore: + - /rel\/.*/ + - /hotfix\/.*/ + - amd64_integration_nightly: + requires: + - amd64_build + filters: + branches: + only: + - /rel\/.*/ + - /hotfix\/.*/ + context: slack-secrets + - amd64_e2e_subs: + requires: + - amd64_build + filters: + branches: + ignore: + - /rel\/.*/ + - /hotfix\/.*/ + - amd64_e2e_subs_nightly: + requires: + - amd64_build + filters: + branches: + only: + - /rel\/.*/ + - /hotfix\/.*/ + context: slack-secrets - arm64_build - # - arm64_test: - # requires: - # - arm64_build - # filters: - # branches: - # ignore: - # - /rel\/.*/ - # - /hotfix\/.*/ - # - arm64_test_nightly: - # requires: - # - arm64_build - # filters: - # branches: - # only: - # - /rel\/.*/ - # - /hotfix\/.*/ - # context: slack-secrets + - arm64_test: + requires: + - arm64_build + filters: + branches: + ignore: + - /rel\/.*/ + - /hotfix\/.*/ + - arm64_test_nightly: + requires: + - arm64_build + filters: + branches: + only: + - /rel\/.*/ + - /hotfix\/.*/ + context: slack-secrets - arm64_integration: requires: - arm64_build @@ -88,88 +88,93 @@ workflows: ignore: - /rel\/.*/ - /hotfix\/.*/ - - arm64_integration_check: + - arm64_integration_nightly: + requires: + - arm64_build + filters: + branches: + only: + - /rel\/.*/ + - /hotfix\/.*/ + context: slack-secrets + - arm64_e2e_subs: requires: - - arm64_integration - # - arm64_integration_nightly: - # requires: - # - arm64_build - # filters: - # branches: - # only: - # - /rel\/.*/ - # - /hotfix\/.*/ - # context: slack-secrets - # - arm64_e2e_subs: - # requires: - # - arm64_build - # filters: - # branches: - # ignore: - # - /rel\/.*/ - # - /hotfix\/.*/ - # - arm64_e2e_subs_nightly: - # requires: - # - arm64_build - # filters: - # branches: - # only: - # - /rel\/.*/ - # - /hotfix\/.*/ - # context: slack-secrets - # - mac_amd64_build - # - mac_amd64_test: - # requires: - # - mac_amd64_build - # filters: - # branches: - # ignore: - # - /rel\/.*/ - # - /hotfix\/.*/ - # - mac_amd64_test_nightly: - # requires: - # - mac_amd64_build - # filters: - # branches: - # only: - # - /rel\/.*/ - # - /hotfix\/.*/ - # context: slack-secrets - # - mac_amd64_integration: - # requires: - # - mac_amd64_build - # filters: - # branches: - # ignore: - # - /rel\/.*/ - # - /hotfix\/.*/ - # - mac_amd64_integration_nightly: - # requires: - # - mac_amd64_build - # filters: - # branches: - # only: - # - /rel\/.*/ - # - /hotfix\/.*/ - # context: slack-secrets - # - mac_amd64_e2e_subs: - # requires: - # - mac_amd64_build - # filters: - # branches: - # ignore: - # - /rel\/.*/ - # - /hotfix\/.*/ - # - mac_amd64_e2e_subs_nightly: - # requires: - # - mac_amd64_build - # filters: - # branches: - # only: - # - /rel\/.*/ - # - /hotfix\/.*/ - # context: slack-secrets - ##- windows_x64_build + - arm64_build + filters: + branches: + ignore: + - /rel\/.*/ + - /hotfix\/.*/ + - arm64_e2e_subs_nightly: + requires: + - arm64_build + filters: + branches: + only: + - /rel\/.*/ + - /hotfix\/.*/ + context: slack-secrets + - mac_amd64_build + - mac_amd64_test: + requires: + - mac_amd64_build + filters: + branches: + ignore: + - /rel\/.*/ + - /hotfix\/.*/ + - mac_amd64_test_nightly: + requires: + - mac_amd64_build + filters: + branches: + only: + - /rel\/.*/ + - /hotfix\/.*/ + context: slack-secrets + - mac_amd64_integration: + requires: + - mac_amd64_build + filters: + branches: + ignore: + - /rel\/.*/ + - /hotfix\/.*/ + - mac_amd64_integration_nightly: + requires: + - mac_amd64_build + filters: + branches: + only: + - /rel\/.*/ + - /hotfix\/.*/ + context: slack-secrets + - mac_amd64_e2e_subs: + requires: + - mac_amd64_build + filters: + branches: + ignore: + - /rel\/.*/ + - /hotfix\/.*/ + - mac_amd64_e2e_subs_nightly: + requires: + - mac_amd64_build + filters: + branches: + only: + - /rel\/.*/ + - /hotfix\/.*/ + context: slack-secrets + #- windows_x64_build + - test_verification_check: + name: << matrix.job_type >>_<< matrix.job_version >>_verification + matrix: + parameters: + job_type: ["amd64", "arm64", "mac_amd64"] + job_version: ["test", "test_nightly", "integration", "integration_nightly"] + requires: + - << matrix.job_type >>_<< matrix.job_version >> commands: prepare_go: @@ -565,15 +570,6 @@ jobs: result_subdir: arm64-integration short_test_flag: "-short" - arm64_integration_check: - docker: - - image: python:3.9.6-alpine - resource_class: medium - steps: - - checkout - - generic_tests_check: - result_subdir: arm64-integration - arm64_integration_nightly: machine: image: ubuntu-2004:202101-01 @@ -754,3 +750,16 @@ jobs: export MAKE=mingw32-make $msys2 scripts/travis/build_test.sh shell: bash.exe + test_verification_check: + docker: + - image: python:3.9.6-alpine + resource_class: medium + parameters: + job_type: # job_type: ["amd64", "arm64", "mac_amd64"] + type: string + job_version: # job_version: ["test", "test_nightly", "integration", "integration_nightly"] + type: string + steps: + - checkout + - generic_tests_check: + result_subdir: << parameters.job_type >>_<< parameters.job_version >> diff --git a/scripts/buildtools/check_tests.py b/scripts/buildtools/check_tests.py index 6e9baac445..6e7fac28a3 100755 --- a/scripts/buildtools/check_tests.py +++ b/scripts/buildtools/check_tests.py @@ -1,15 +1,15 @@ import json import sys +print("===== STARTED RUNNING check_tests.py =====") if len(sys.argv) != 2: print("Wrong number of arguments passed. Please pass one argument: json format test results file path (e.g. /tmp/results/testresults.json)") sys.exit(1) filepath = sys.argv[1] +# Go through the given file one json object at a time, and record into lists testList = [] -# testListRan = [] testListPassed = [] -# testListSkipped = [] with open(filepath) as f: for jsonObj in f: testDict = json.loads(jsonObj) @@ -21,27 +21,24 @@ # actions can be: output, run, skip, pass if 'pass' in testDict["Action"]: testListPassed.append(fullTestName) - # elif testDict["Action"] == 'run': - # testListRan.append(fullTestName) - # elif testDict["Action"] == 'skip': - # testListSkipped.append(fullTestName) f.close() -# Dedup: +# Dedup some lists: testListDeduped = list(set(testList)) -# testListRanDeduped = list(set(testListRan)) -# testListSkippedDeduped = list(set(testListSkipped)) testListPassedDeduped = list(set(testListPassed)) countTotalDeduped = len(testListDeduped) countPassed = len(testListPassed) countPassedDeduped = len(testListPassedDeduped) +# Summary +print("==================================================") print("Saw " + str(countTotalDeduped) + " tests total") -# print(str(len(testListRanDeduped)) + " ran") -# print(str(len(testListSkippedDeduped)) + " skipped") print(str(countPassed) + " passed before dedup") print(str(countPassedDeduped) + " passed after dedup") +print("==================================================") + +# Check if all seen tests have passed errorCode = '' if countTotalDeduped != countPassedDeduped: countNotPassed = countTotalDeduped - countPassedDeduped @@ -51,15 +48,19 @@ print(*sorted(notPassed), sep = "\n") errorCode += "FAIL ERROR: " + str(countNotPassed) + " tests didn't pass!!\n" else: - print("Seems all tests passed at least once ... OK") + print("All tests passed at least once ... OK") +# Check if in there are any duplicates in the passed tests +print("==================================================") if countPassed != countPassedDeduped: testDuplicates = set([testName + " " + str(testListPassed.count(testName)) for testName in testListPassed if testListPassed.count(testName) > 1]) print(str(len(testDuplicates)) + " tests passed multiple times!! ... FAIL ERROR") print("Here are the duplicates: ") - # print(*sorted(testDuplicates), sep = "\n") + print(*sorted(testDuplicates), sep = "\n") errorCode += "FAIL ERROR: " + str(len(testDuplicates)) + " tests passed multiple times!!\n" else: - print("Seems all tests that passed, passed only once ... OK") + print("All tests that passed, passed only once ... OK") +print("==================================================") +print("===== FINISHED RUNNING check_tests.py =====") sys.exit(errorCode) From 25cd3dd63aad51aecb4d9dce2328c6ccbe5ee949 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Thu, 19 Aug 2021 19:33:29 -0400 Subject: [PATCH 17/49] Fixing naming --- .circleci/config.yml | 47 +++++++++++++++---------------- scripts/buildtools/check_tests.py | 2 +- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8aa9e3eb90..5d1b973d1f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -167,7 +167,7 @@ workflows: - /hotfix\/.*/ context: slack-secrets #- windows_x64_build - - test_verification_check: + - tests_verification_job: name: << matrix.job_type >>_<< matrix.job_version >>_verification matrix: parameters: @@ -390,12 +390,9 @@ commands: paths: - << parameters.result_subdir >> - generic_tests_check: + tests_verification_command: description: Check if all tests were run at least once and only once across all parallel runs parameters: - circleci_home: - type: string - default: "/home/circleci" result_path: type: string default: "/tmp/results" @@ -443,7 +440,7 @@ jobs: steps: - prepare_go - generic_buildtest: - result_subdir: amd64-short + result_subdir: amd64_test short_test_flag: "-short" - upload_coverage @@ -455,7 +452,7 @@ jobs: steps: - prepare_go - generic_buildtest: - result_subdir: amd64-nightly + result_subdir: amd64_test_nightly no_output_timeout: 45m - upload_coverage - slack/notify: @@ -472,7 +469,7 @@ jobs: steps: - prepare_go - generic_integration: - result_subdir: amd64-integration + result_subdir: amd64_integration short_test_flag: "-short" amd64_integration_nightly: @@ -485,7 +482,7 @@ jobs: steps: - prepare_go - generic_integration: - result_subdir: amd64-integrationnightly + result_subdir: amd64_integration_nightly no_output_timeout: 45m - slack/notify: event: fail @@ -500,7 +497,7 @@ jobs: steps: - prepare_go - generic_integration: - result_subdir: amd64-e2e_subs + result_subdir: amd64_e2e_subs short_test_flag: "-short" amd64_e2e_subs_nightly: @@ -512,7 +509,7 @@ jobs: steps: - prepare_go - generic_integration: - result_subdir: amd64-e2e_subs_nightly + result_subdir: amd64_e2e_subs_nightly no_output_timeout: 45m - slack/notify: event: fail @@ -536,7 +533,7 @@ jobs: - checkout - prepare_go - generic_buildtest: - result_subdir: arm64-short + result_subdir: arm64_test short_test_flag: "-short" - upload_coverage @@ -549,7 +546,7 @@ jobs: - checkout - prepare_go - generic_buildtest: - result_subdir: arm64-nightly + result_subdir: arm64_test_nightly no_output_timeout: 45m - upload_coverage - slack/notify: @@ -567,7 +564,7 @@ jobs: - checkout - prepare_go - generic_integration: - result_subdir: arm64-integration + result_subdir: arm64_integration short_test_flag: "-short" arm64_integration_nightly: @@ -581,7 +578,7 @@ jobs: - checkout - prepare_go - generic_integration: - result_subdir: arm64-integration-nightly + result_subdir: arm64_integration_nightly no_output_timeout: 45m - slack/notify: event: fail @@ -597,7 +594,7 @@ jobs: - checkout - prepare_go - generic_integration: - result_subdir: arm64-e2e_subs + result_subdir: arm64_e2e_subs short_test_flag: "-short" arm64_e2e_subs_nightly: @@ -610,7 +607,7 @@ jobs: - checkout - prepare_go - generic_integration: - result_subdir: arm64-e2e_subs-nightly + result_subdir: arm64_e2e_subs_nightly no_output_timeout: 45m - slack/notify: event: fail @@ -640,7 +637,7 @@ jobs: #- run: git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow - prepare_go - generic_buildtest: - result_subdir: mac-amd64-short + result_subdir: mac_amd64_test circleci_home: /Users/distiller short_test_flag: "-short" - upload_coverage @@ -656,7 +653,7 @@ jobs: #- run: git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow - prepare_go - generic_buildtest: - result_subdir: mac-amd64-short + result_subdir: mac_amd64_test_nightly circleci_home: /Users/distiller no_output_timeout: 45m - upload_coverage @@ -676,7 +673,7 @@ jobs: #- run: git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow - prepare_go - generic_integration: - result_subdir: mac-amd64-integration + result_subdir: mac_amd64_integration circleci_home: /Users/distiller short_test_flag: "-short" @@ -692,7 +689,7 @@ jobs: #- run: git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow - prepare_go - generic_integration: - result_subdir: mac-amd64-integration-nightly + result_subdir: mac_amd64_integration_nightly circleci_home: /Users/distiller no_output_timeout: 45m - slack/notify: @@ -710,7 +707,7 @@ jobs: #- run: git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow - prepare_go - generic_integration: - result_subdir: mac-amd64-e2e_subs + result_subdir: mac_amd64_e2e_subs circleci_home: /Users/distiller short_test_flag: "-short" @@ -725,7 +722,7 @@ jobs: #- run: git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow - prepare_go - generic_integration: - result_subdir: mac-amd64-e2e_subs-nightly + result_subdir: mac_amd64_e2e_subs_nightly circleci_home: /Users/distiller no_output_timeout: 45m - slack/notify: @@ -750,7 +747,7 @@ jobs: export MAKE=mingw32-make $msys2 scripts/travis/build_test.sh shell: bash.exe - test_verification_check: + tests_verification_job: docker: - image: python:3.9.6-alpine resource_class: medium @@ -761,5 +758,5 @@ jobs: type: string steps: - checkout - - generic_tests_check: + - tests_verification_command: result_subdir: << parameters.job_type >>_<< parameters.job_version >> diff --git a/scripts/buildtools/check_tests.py b/scripts/buildtools/check_tests.py index 6e7fac28a3..2f808aa06c 100755 --- a/scripts/buildtools/check_tests.py +++ b/scripts/buildtools/check_tests.py @@ -50,7 +50,7 @@ else: print("All tests passed at least once ... OK") -# Check if in there are any duplicates in the passed tests +# Check for duplicates in the passed tests print("==================================================") if countPassed != countPassedDeduped: testDuplicates = set([testName + " " + str(testListPassed.count(testName)) for testName in testListPassed if testListPassed.count(testName) > 1]) From 69e438dce3535d8bdb771b46ba5a70a0c483f46e Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Fri, 20 Aug 2021 15:32:09 -0400 Subject: [PATCH 18/49] Separated skipped due to partition, and made docker small --- .circleci/config.yml | 284 +++++++++++++++--------------- scripts/buildtools/check_tests.py | 91 ++++++---- test/scripts/e2e_go_tests.sh | 2 +- 3 files changed, 204 insertions(+), 173 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5d1b973d1f..daa21c93f5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,111 +9,111 @@ workflows: version: 2 build_pr: jobs: - - codegen_verification - - amd64_build - - amd64_test: - requires: - - amd64_build - filters: - branches: - ignore: - - /rel\/.*/ - - /hotfix\/.*/ - - amd64_test_nightly: - requires: - - amd64_build - filters: - branches: - only: - - /rel\/.*/ - - /hotfix\/.*/ - context: slack-secrets - - amd64_integration: - requires: - - amd64_build - filters: - branches: - ignore: - - /rel\/.*/ - - /hotfix\/.*/ - - amd64_integration_nightly: - requires: - - amd64_build - filters: - branches: - only: - - /rel\/.*/ - - /hotfix\/.*/ - context: slack-secrets - - amd64_e2e_subs: - requires: - - amd64_build - filters: - branches: - ignore: - - /rel\/.*/ - - /hotfix\/.*/ - - amd64_e2e_subs_nightly: - requires: - - amd64_build - filters: - branches: - only: - - /rel\/.*/ - - /hotfix\/.*/ - context: slack-secrets - - arm64_build - - arm64_test: - requires: - - arm64_build - filters: - branches: - ignore: - - /rel\/.*/ - - /hotfix\/.*/ - - arm64_test_nightly: - requires: - - arm64_build - filters: - branches: - only: - - /rel\/.*/ - - /hotfix\/.*/ - context: slack-secrets - - arm64_integration: - requires: - - arm64_build - filters: - branches: - ignore: - - /rel\/.*/ - - /hotfix\/.*/ - - arm64_integration_nightly: - requires: - - arm64_build - filters: - branches: - only: - - /rel\/.*/ - - /hotfix\/.*/ - context: slack-secrets - - arm64_e2e_subs: - requires: - - arm64_build - filters: - branches: - ignore: - - /rel\/.*/ - - /hotfix\/.*/ - - arm64_e2e_subs_nightly: - requires: - - arm64_build - filters: - branches: - only: - - /rel\/.*/ - - /hotfix\/.*/ - context: slack-secrets + # - codegen_verification + # - amd64_build + # - amd64_test: + # requires: + # - amd64_build + # filters: + # branches: + # ignore: + # - /rel\/.*/ + # - /hotfix\/.*/ + # - amd64_test_nightly: + # requires: + # - amd64_build + # filters: + # branches: + # only: + # - /rel\/.*/ + # - /hotfix\/.*/ + # context: slack-secrets + # - amd64_integration: + # requires: + # - amd64_build + # filters: + # branches: + # ignore: + # - /rel\/.*/ + # - /hotfix\/.*/ + # - amd64_integration_nightly: + # requires: + # - amd64_build + # filters: + # branches: + # only: + # - /rel\/.*/ + # - /hotfix\/.*/ + # context: slack-secrets + # - amd64_e2e_subs: + # requires: + # - amd64_build + # filters: + # branches: + # ignore: + # - /rel\/.*/ + # - /hotfix\/.*/ + # - amd64_e2e_subs_nightly: + # requires: + # - amd64_build + # filters: + # branches: + # only: + # - /rel\/.*/ + # - /hotfix\/.*/ + # context: slack-secrets + # - arm64_build + # - arm64_test: + # requires: + # - arm64_build + # filters: + # branches: + # ignore: + # - /rel\/.*/ + # - /hotfix\/.*/ + # - arm64_test_nightly: + # requires: + # - arm64_build + # filters: + # branches: + # only: + # - /rel\/.*/ + # - /hotfix\/.*/ + # context: slack-secrets + # - arm64_integration: + # requires: + # - arm64_build + # filters: + # branches: + # ignore: + # - /rel\/.*/ + # - /hotfix\/.*/ + # - arm64_integration_nightly: + # requires: + # - arm64_build + # filters: + # branches: + # only: + # - /rel\/.*/ + # - /hotfix\/.*/ + # context: slack-secrets + # - arm64_e2e_subs: + # requires: + # - arm64_build + # filters: + # branches: + # ignore: + # - /rel\/.*/ + # - /hotfix\/.*/ + # - arm64_e2e_subs_nightly: + # requires: + # - arm64_build + # filters: + # branches: + # only: + # - /rel\/.*/ + # - /hotfix\/.*/ + # context: slack-secrets - mac_amd64_build - mac_amd64_test: requires: @@ -132,41 +132,41 @@ workflows: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets - - mac_amd64_integration: - requires: - - mac_amd64_build - filters: - branches: - ignore: - - /rel\/.*/ - - /hotfix\/.*/ - - mac_amd64_integration_nightly: - requires: - - mac_amd64_build - filters: - branches: - only: - - /rel\/.*/ - - /hotfix\/.*/ - context: slack-secrets - - mac_amd64_e2e_subs: - requires: - - mac_amd64_build - filters: - branches: - ignore: - - /rel\/.*/ - - /hotfix\/.*/ - - mac_amd64_e2e_subs_nightly: - requires: - - mac_amd64_build - filters: - branches: - only: - - /rel\/.*/ - - /hotfix\/.*/ - context: slack-secrets - #- windows_x64_build + # - mac_amd64_integration: + # requires: + # - mac_amd64_build + # filters: + # branches: + # ignore: + # - /rel\/.*/ + # - /hotfix\/.*/ + # - mac_amd64_integration_nightly: + # requires: + # - mac_amd64_build + # filters: + # branches: + # only: + # - /rel\/.*/ + # - /hotfix\/.*/ + # context: slack-secrets + # - mac_amd64_e2e_subs: + # requires: + # - mac_amd64_build + # filters: + # branches: + # ignore: + # - /rel\/.*/ + # - /hotfix\/.*/ + # - mac_amd64_e2e_subs_nightly: + # requires: + # - mac_amd64_build + # filters: + # branches: + # only: + # - /rel\/.*/ + # - /hotfix\/.*/ + # context: slack-secrets + ## - windows_x64_build - tests_verification_job: name: << matrix.job_type >>_<< matrix.job_version >>_verification matrix: @@ -314,7 +314,7 @@ commands: export PARTITION_TOTAL=$CIRCLE_NODE_TOTAL export PARTITION_ID=$CIRCLE_NODE_INDEX export PARALLEL_FLAG="-p 1" - gotestsum --format pkgname --junitfile << parameters.result_path >>/<< parameters.result_subdir >>/${CIRCLE_NODE_INDEX}/results.xml --jsonfile << parameters.result_path >>/<< parameters.result_subdir >>/${CIRCLE_NODE_INDEX}/testresults.json -- --tags "sqlite_unlock_notify sqlite_omit_load_extension" << parameters.short_test_flag >> -race -timeout 1h -coverprofile=coverage.txt -covermode=atomic -p 1 $PACKAGE_NAMES + gotestsum --format testname --junitfile << parameters.result_path >>/<< parameters.result_subdir >>/${CIRCLE_NODE_INDEX}/results.xml --jsonfile << parameters.result_path >>/<< parameters.result_subdir >>/${CIRCLE_NODE_INDEX}/testresults.json -- --tags "sqlite_unlock_notify sqlite_omit_load_extension" << parameters.short_test_flag >> -race -timeout 1h -coverprofile=coverage.txt -covermode=atomic -p 1 $PACKAGE_NAMES - store_artifacts: path: << parameters.result_path >> destination: test-results @@ -750,7 +750,7 @@ jobs: tests_verification_job: docker: - image: python:3.9.6-alpine - resource_class: medium + resource_class: small parameters: job_type: # job_type: ["amd64", "arm64", "mac_amd64"] type: string diff --git a/scripts/buildtools/check_tests.py b/scripts/buildtools/check_tests.py index 2f808aa06c..7318562ca9 100755 --- a/scripts/buildtools/check_tests.py +++ b/scripts/buildtools/check_tests.py @@ -8,8 +8,9 @@ filepath = sys.argv[1] # Go through the given file one json object at a time, and record into lists -testList = [] -testListPassed = [] +total = set() +passedWDupes = [] +partitionSkipped = set() with open(filepath) as f: for jsonObj in f: testDict = json.loads(jsonObj) @@ -17,50 +18,80 @@ continue fullTestName = testDict['Package'] + ' ' + testDict['Test'] - testList.append(fullTestName) + total.add(fullTestName) # actions can be: output, run, skip, pass if 'pass' in testDict["Action"]: - testListPassed.append(fullTestName) + passedWDupes.append(fullTestName) + if 'Output' in testDict and 'due to partitioning' in testDict['Output']: + partitionSkipped.add(fullTestName) f.close() -# Dedup some lists: -testListDeduped = list(set(testList)) -testListPassedDeduped = list(set(testListPassed)) -countTotalDeduped = len(testListDeduped) -countPassed = len(testListPassed) -countPassedDeduped = len(testListPassedDeduped) +# === Calculate results === -# Summary +# Total seen (deduped) +# total + +# Passed with duplicates (needed for checking which tests passed multiple times) +# passedWDupes + +# Passed without duplicates (deduped) +passed = set(passedWDupes) + +# Skipped at least once due to partition (deduped) +# partitionSkipped + +# Skipped due to partition and never passed (deduped) +partitionSkippedNotPass = partitionSkipped - passed + +# Skipped due to other reasons (deduped) +skippedNotPartition = total - passed.union(partitionSkipped) + +# Total not passed (deduped) +notPassed = total - passed + +# === Summary === print("==================================================") -print("Saw " + str(countTotalDeduped) + " tests total") -print(str(countPassed) + " passed before dedup") -print(str(countPassedDeduped) + " passed after dedup") +print("Saw {} tests total".format(len(total))) +print("{} passed before dedup".format(len(passedWDupes))) +print("{} passed after dedup".format(len(passed))) +print("{} skipped total".format(len(notPassed))) +print("{} skipped due to partition".format(len(partitionSkippedNotPass))) +print("{} skipped for other reasons (Maybe on purpose)".format(len(skippedNotPartition))) print("==================================================") -# Check if all seen tests have passed -errorCode = '' -if countTotalDeduped != countPassedDeduped: - countNotPassed = countTotalDeduped - countPassedDeduped - print(str(countNotPassed) + " tests didn't pass!!") - notPassed = set(testListDeduped) - set(testListPassedDeduped) - print("Here are the ones that didn't pass even once: ") - print(*sorted(notPassed), sep = "\n") - errorCode += "FAIL ERROR: " + str(countNotPassed) + " tests didn't pass!!\n" +errorMessage = '' +# Check tests not passed due to partition +print("==================================================") +if len(partitionSkippedNotPass): + print("{} tests didn't pass due to partition!!".format(len(partitionSkippedNotPass))) + print("Here are the ones that didn't pass due to partition: ") + print(*sorted(list(partitionSkippedNotPass)), sep = "\n") + errorMessage += "FAIL ERROR: {} tests didn't pass due to partition!! (Scroll up to see which)\n".format(len(partitionSkippedNotPass)) +else: + print("No tests skipped due to partition.") +print("==================================================") + +# Check tests not passed for other reasons +print("==================================================") +if len(skippedNotPartition): + print("{} tests didn't pass due to other reasons (Maybe on purpose)".format(len(skippedNotPartition))) + print("Here are the ones that didn't pass due to other reasons: ") + print(*sorted(list(skippedNotPartition)), sep = "\n") else: - print("All tests passed at least once ... OK") + print("No tests skipped for other reasons.") +print("==================================================") # Check for duplicates in the passed tests print("==================================================") -if countPassed != countPassedDeduped: - testDuplicates = set([testName + " " + str(testListPassed.count(testName)) for testName in testListPassed if testListPassed.count(testName) > 1]) - print(str(len(testDuplicates)) + " tests passed multiple times!! ... FAIL ERROR") - print("Here are the duplicates: ") +if len(passedWDupes) != len(passed): + testDuplicates = set([testName + " - " + str(passedWDupes.count(testName)) for testName in passedWDupes if passedWDupes.count(testName) > 1]) + print("{} tests passed multiple times!!".format(len(testDuplicates))) + print("Here are the duplicates and number of times passed: ") print(*sorted(testDuplicates), sep = "\n") - errorCode += "FAIL ERROR: " + str(len(testDuplicates)) + " tests passed multiple times!!\n" else: print("All tests that passed, passed only once ... OK") print("==================================================") print("===== FINISHED RUNNING check_tests.py =====") -sys.exit(errorCode) +sys.exit(errorMessage) diff --git a/test/scripts/e2e_go_tests.sh b/test/scripts/e2e_go_tests.sh index 4904303409..15a7bd43a1 100755 --- a/test/scripts/e2e_go_tests.sh +++ b/test/scripts/e2e_go_tests.sh @@ -12,7 +12,7 @@ if [ -z "$(which gotestsum)" ]; then GOTESTCOMMAND=${GOTESTCOMMAND:="go test"} else TEST_RESULTS=${TEST_RESULTS:="$(pwd)"} - GOTESTCOMMAND=${GOTESTCOMMAND:="gotestsum --format pkgname --junitfile ${TEST_RESULTS}/results.xml --jsonfile ${TEST_RESULTS}/testresults.json --"} + GOTESTCOMMAND=${GOTESTCOMMAND:="gotestsum --format testname --junitfile ${TEST_RESULTS}/results.xml --jsonfile ${TEST_RESULTS}/testresults.json --"} fi echo "GOTESTCOMMAND will be: ${GOTESTCOMMAND}" From 61986f5dfc7cd4948ac17d9dfd891d83f7c804f9 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Fri, 20 Aug 2021 15:34:29 -0400 Subject: [PATCH 19/49] Restricted to amd64_test and nightly for testing --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index daa21c93f5..93c6a35bbf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -171,8 +171,8 @@ workflows: name: << matrix.job_type >>_<< matrix.job_version >>_verification matrix: parameters: - job_type: ["amd64", "arm64", "mac_amd64"] - job_version: ["test", "test_nightly", "integration", "integration_nightly"] + job_type: ["amd64"] #["amd64", "arm64", "mac_amd64"] + job_version: ["test", "test_nightly"] #["test", "test_nightly", "integration", "integration_nightly"] requires: - << matrix.job_type >>_<< matrix.job_version >> From aed014bd18f8ced6a603bd58f358ad80ae738979 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Fri, 20 Aug 2021 15:35:49 -0400 Subject: [PATCH 20/49] Restricted to mac_amd64_test and nightly for testing --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 93c6a35bbf..01039d76b1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -171,7 +171,7 @@ workflows: name: << matrix.job_type >>_<< matrix.job_version >>_verification matrix: parameters: - job_type: ["amd64"] #["amd64", "arm64", "mac_amd64"] + job_type: ["mac_amd64"] #["amd64", "arm64", "mac_amd64"] job_version: ["test", "test_nightly"] #["test", "test_nightly", "integration", "integration_nightly"] requires: - << matrix.job_type >>_<< matrix.job_version >> From 965c61dfb716d14d2e2d3c00c5f55b69db5788e9 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Fri, 20 Aug 2021 18:31:35 -0400 Subject: [PATCH 21/49] Added color and switched to nightly --- .circleci/config.yml | 4 +- scripts/buildtools/check_tests.py | 67 ++++++++++++++++++------------- 2 files changed, 42 insertions(+), 29 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 01039d76b1..3542016d76 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -120,7 +120,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: + only: # SWITCHED FOR TESTING - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_test_nightly: @@ -128,7 +128,7 @@ workflows: - mac_amd64_build filters: branches: - only: + ignore: # SWITCHED FOR TESTING - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets diff --git a/scripts/buildtools/check_tests.py b/scripts/buildtools/check_tests.py index 7318562ca9..78c1633e90 100755 --- a/scripts/buildtools/check_tests.py +++ b/scripts/buildtools/check_tests.py @@ -1,17 +1,20 @@ +print("===== STARTED RUNNING check_tests.py =====") + import json import sys +import argparse -print("===== STARTED RUNNING check_tests.py =====") -if len(sys.argv) != 2: - print("Wrong number of arguments passed. Please pass one argument: json format test results file path (e.g. /tmp/results/testresults.json)") - sys.exit(1) -filepath = sys.argv[1] +# Arguments parsing / help menu +parser = argparse.ArgumentParser(description='Verify test results for skipped tests and tests with multiple passes.') +parser.add_argument('tests_results_filepath', metavar='RESULTS_FILE', + help='json format test results file path (e.g. /tmp/results/testresults.json)') +args = parser.parse_args() # Go through the given file one json object at a time, and record into lists total = set() passedWDupes = [] partitionSkipped = set() -with open(filepath) as f: +with open(args.tests_results_filepath) as f: for jsonObj in f: testDict = json.loads(jsonObj) if 'Test' not in testDict: @@ -50,29 +53,18 @@ # Total not passed (deduped) notPassed = total - passed -# === Summary === -print("==================================================") -print("Saw {} tests total".format(len(total))) -print("{} passed before dedup".format(len(passedWDupes))) -print("{} passed after dedup".format(len(passed))) -print("{} skipped total".format(len(notPassed))) -print("{} skipped due to partition".format(len(partitionSkippedNotPass))) -print("{} skipped for other reasons (Maybe on purpose)".format(len(skippedNotPartition))) -print("==================================================") +# Sort and print messages with colored prefix +red_text_color = "\033[0;31m" +green_text_color = "\033[0;32m" +yellow_text_color = "\033[0;33m" +normal_text_color = "\033[0;0m" +def printColor(message, color=normal_text_color): + print("{}{}{}".format(color, message, normal_text_color)) +# Record error message for sys.exit(errorMessage) errorMessage = '' -# Check tests not passed due to partition -print("==================================================") -if len(partitionSkippedNotPass): - print("{} tests didn't pass due to partition!!".format(len(partitionSkippedNotPass))) - print("Here are the ones that didn't pass due to partition: ") - print(*sorted(list(partitionSkippedNotPass)), sep = "\n") - errorMessage += "FAIL ERROR: {} tests didn't pass due to partition!! (Scroll up to see which)\n".format(len(partitionSkippedNotPass)) -else: - print("No tests skipped due to partition.") -print("==================================================") -# Check tests not passed for other reasons +# Check tests not passed for misc reasons print("==================================================") if len(skippedNotPartition): print("{} tests didn't pass due to other reasons (Maybe on purpose)".format(len(skippedNotPartition))) @@ -92,6 +84,27 @@ else: print("All tests that passed, passed only once ... OK") print("==================================================") -print("===== FINISHED RUNNING check_tests.py =====") +# Check tests not passed due to partition +print("==================================================") +if len(partitionSkippedNotPass): + print("{} tests didn't pass due to partition!!".format(len(partitionSkippedNotPass))) + print("Here are the ones that didn't pass due to partition: ") + [printColor(x, red_text_color) for x in sorted(list(partitionSkippedNotPass))] + errorMessage += "{}FAIL ERROR:{} {} tests didn't pass due to partition!! (Scroll up top to see which)\n".format(red_text_color, normal_text_color, len(partitionSkippedNotPass)) +else: + print("No tests skipped due to partition.") +print("==================================================") + +# === Summary === +print("==================================================") +print("Saw {} tests total".format(len(total))) +print("{} passed before dedup".format(len(passedWDupes))) +print("{} passed after dedup".format(len(passed))) +print("{} skipped due to partition".format(len(partitionSkippedNotPass))) +print("{} skipped for misc reasons (Maybe on purpose)".format(len(skippedNotPartition))) +print("{} total skipped".format(len(notPassed))) +print("==================================================") + +print("===== FINISHED RUNNING check_tests.py =====") sys.exit(errorMessage) From 7884fe738c3fef6ab4bdbf9db1698df1a0fdc151 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Mon, 23 Aug 2021 11:06:40 -0400 Subject: [PATCH 22/49] Enabled all nightly tests to check that they all work --- .circleci/config.yml | 284 +++++++++++++++++++++---------------------- 1 file changed, 142 insertions(+), 142 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3542016d76..26c02504ff 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -9,111 +9,111 @@ workflows: version: 2 build_pr: jobs: - # - codegen_verification - # - amd64_build - # - amd64_test: - # requires: - # - amd64_build - # filters: - # branches: - # ignore: - # - /rel\/.*/ - # - /hotfix\/.*/ - # - amd64_test_nightly: - # requires: - # - amd64_build - # filters: - # branches: - # only: - # - /rel\/.*/ - # - /hotfix\/.*/ - # context: slack-secrets - # - amd64_integration: - # requires: - # - amd64_build - # filters: - # branches: - # ignore: - # - /rel\/.*/ - # - /hotfix\/.*/ - # - amd64_integration_nightly: - # requires: - # - amd64_build - # filters: - # branches: - # only: - # - /rel\/.*/ - # - /hotfix\/.*/ - # context: slack-secrets - # - amd64_e2e_subs: - # requires: - # - amd64_build - # filters: - # branches: - # ignore: - # - /rel\/.*/ - # - /hotfix\/.*/ - # - amd64_e2e_subs_nightly: - # requires: - # - amd64_build - # filters: - # branches: - # only: - # - /rel\/.*/ - # - /hotfix\/.*/ - # context: slack-secrets - # - arm64_build - # - arm64_test: - # requires: - # - arm64_build - # filters: - # branches: - # ignore: - # - /rel\/.*/ - # - /hotfix\/.*/ - # - arm64_test_nightly: - # requires: - # - arm64_build - # filters: - # branches: - # only: - # - /rel\/.*/ - # - /hotfix\/.*/ - # context: slack-secrets - # - arm64_integration: - # requires: - # - arm64_build - # filters: - # branches: - # ignore: - # - /rel\/.*/ - # - /hotfix\/.*/ - # - arm64_integration_nightly: - # requires: - # - arm64_build - # filters: - # branches: - # only: - # - /rel\/.*/ - # - /hotfix\/.*/ - # context: slack-secrets - # - arm64_e2e_subs: - # requires: - # - arm64_build - # filters: - # branches: - # ignore: - # - /rel\/.*/ - # - /hotfix\/.*/ - # - arm64_e2e_subs_nightly: - # requires: - # - arm64_build - # filters: - # branches: - # only: - # - /rel\/.*/ - # - /hotfix\/.*/ - # context: slack-secrets + - codegen_verification + - amd64_build + - amd64_test: + requires: + - amd64_build + filters: + branches: + only: # SWITCHED FOR TESTING + - /rel\/.*/ + - /hotfix\/.*/ + - amd64_test_nightly: + requires: + - amd64_build + filters: + branches: + ignore: # SWITCHED FOR TESTING + - /rel\/.*/ + - /hotfix\/.*/ + context: slack-secrets + - amd64_integration: + requires: + - amd64_build + filters: + branches: + only: # SWITCHED FOR TESTING + - /rel\/.*/ + - /hotfix\/.*/ + - amd64_integration_nightly: + requires: + - amd64_build + filters: + branches: + ignore: # SWITCHED FOR TESTING + - /rel\/.*/ + - /hotfix\/.*/ + context: slack-secrets + - amd64_e2e_subs: + requires: + - amd64_build + filters: + branches: + only: # SWITCHED FOR TESTING + - /rel\/.*/ + - /hotfix\/.*/ + - amd64_e2e_subs_nightly: + requires: + - amd64_build + filters: + branches: + ignore: # SWITCHED FOR TESTING + - /rel\/.*/ + - /hotfix\/.*/ + context: slack-secrets + - arm64_build + - arm64_test: + requires: + - arm64_build + filters: + branches: + only: # SWITCHED FOR TESTING + - /rel\/.*/ + - /hotfix\/.*/ + - arm64_test_nightly: + requires: + - arm64_build + filters: + branches: + ignore: # SWITCHED FOR TESTING + - /rel\/.*/ + - /hotfix\/.*/ + context: slack-secrets + - arm64_integration: + requires: + - arm64_build + filters: + branches: + only: # SWITCHED FOR TESTING + - /rel\/.*/ + - /hotfix\/.*/ + - arm64_integration_nightly: + requires: + - arm64_build + filters: + branches: + ignore: # SWITCHED FOR TESTING + - /rel\/.*/ + - /hotfix\/.*/ + context: slack-secrets + - arm64_e2e_subs: + requires: + - arm64_build + filters: + branches: + only: # SWITCHED FOR TESTING + - /rel\/.*/ + - /hotfix\/.*/ + - arm64_e2e_subs_nightly: + requires: + - arm64_build + filters: + branches: + ignore: # SWITCHED FOR TESTING + - /rel\/.*/ + - /hotfix\/.*/ + context: slack-secrets - mac_amd64_build - mac_amd64_test: requires: @@ -132,47 +132,47 @@ workflows: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets - # - mac_amd64_integration: - # requires: - # - mac_amd64_build - # filters: - # branches: - # ignore: - # - /rel\/.*/ - # - /hotfix\/.*/ - # - mac_amd64_integration_nightly: - # requires: - # - mac_amd64_build - # filters: - # branches: - # only: - # - /rel\/.*/ - # - /hotfix\/.*/ - # context: slack-secrets - # - mac_amd64_e2e_subs: - # requires: - # - mac_amd64_build - # filters: - # branches: - # ignore: - # - /rel\/.*/ - # - /hotfix\/.*/ - # - mac_amd64_e2e_subs_nightly: - # requires: - # - mac_amd64_build - # filters: - # branches: - # only: - # - /rel\/.*/ - # - /hotfix\/.*/ - # context: slack-secrets - ## - windows_x64_build + - mac_amd64_integration: + requires: + - mac_amd64_build + filters: + branches: + only: # SWITCHED FOR TESTING + - /rel\/.*/ + - /hotfix\/.*/ + - mac_amd64_integration_nightly: + requires: + - mac_amd64_build + filters: + branches: + ignore: # SWITCHED FOR TESTING + - /rel\/.*/ + - /hotfix\/.*/ + context: slack-secrets + - mac_amd64_e2e_subs: + requires: + - mac_amd64_build + filters: + branches: + only: # SWITCHED FOR TESTING + - /rel\/.*/ + - /hotfix\/.*/ + - mac_amd64_e2e_subs_nightly: + requires: + - mac_amd64_build + filters: + branches: + ignore: # SWITCHED FOR TESTING + - /rel\/.*/ + - /hotfix\/.*/ + context: slack-secrets + # - windows_x64_build - tests_verification_job: name: << matrix.job_type >>_<< matrix.job_version >>_verification matrix: parameters: - job_type: ["mac_amd64"] #["amd64", "arm64", "mac_amd64"] - job_version: ["test", "test_nightly"] #["test", "test_nightly", "integration", "integration_nightly"] + job_type: ["amd64", "arm64", "mac_amd64"] + job_version: ["test", "test_nightly", "integration", "integration_nightly"] requires: - << matrix.job_type >>_<< matrix.job_version >> From 28553414b64eed5cceb024af9ea4e0ec1033a28b Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Mon, 23 Aug 2021 13:00:51 -0400 Subject: [PATCH 23/49] Switched back to normal (not nightlies) --- .circleci/config.yml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 26c02504ff..8353c8dd8a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,7 +16,7 @@ workflows: - amd64_build filters: branches: - only: # SWITCHED FOR TESTING + ignore: - /rel\/.*/ - /hotfix\/.*/ - amd64_test_nightly: @@ -24,7 +24,7 @@ workflows: - amd64_build filters: branches: - ignore: # SWITCHED FOR TESTING + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -33,7 +33,7 @@ workflows: - amd64_build filters: branches: - only: # SWITCHED FOR TESTING + ignore: - /rel\/.*/ - /hotfix\/.*/ - amd64_integration_nightly: @@ -41,7 +41,7 @@ workflows: - amd64_build filters: branches: - ignore: # SWITCHED FOR TESTING + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -50,7 +50,7 @@ workflows: - amd64_build filters: branches: - only: # SWITCHED FOR TESTING + ignore: - /rel\/.*/ - /hotfix\/.*/ - amd64_e2e_subs_nightly: @@ -58,7 +58,7 @@ workflows: - amd64_build filters: branches: - ignore: # SWITCHED FOR TESTING + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -68,7 +68,7 @@ workflows: - arm64_build filters: branches: - only: # SWITCHED FOR TESTING + ignore: - /rel\/.*/ - /hotfix\/.*/ - arm64_test_nightly: @@ -76,7 +76,7 @@ workflows: - arm64_build filters: branches: - ignore: # SWITCHED FOR TESTING + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -85,7 +85,7 @@ workflows: - arm64_build filters: branches: - only: # SWITCHED FOR TESTING + ignore: - /rel\/.*/ - /hotfix\/.*/ - arm64_integration_nightly: @@ -93,7 +93,7 @@ workflows: - arm64_build filters: branches: - ignore: # SWITCHED FOR TESTING + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -102,7 +102,7 @@ workflows: - arm64_build filters: branches: - only: # SWITCHED FOR TESTING + ignore: - /rel\/.*/ - /hotfix\/.*/ - arm64_e2e_subs_nightly: @@ -110,7 +110,7 @@ workflows: - arm64_build filters: branches: - ignore: # SWITCHED FOR TESTING + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -120,7 +120,7 @@ workflows: - mac_amd64_build filters: branches: - only: # SWITCHED FOR TESTING + ignore: - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_test_nightly: @@ -128,7 +128,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: # SWITCHED FOR TESTING + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -137,7 +137,7 @@ workflows: - mac_amd64_build filters: branches: - only: # SWITCHED FOR TESTING + ignore: - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_integration_nightly: @@ -145,7 +145,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: # SWITCHED FOR TESTING + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -154,7 +154,7 @@ workflows: - mac_amd64_build filters: branches: - only: # SWITCHED FOR TESTING + ignore: - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_e2e_subs_nightly: @@ -162,7 +162,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: # SWITCHED FOR TESTING + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets From b6d3b4d4bbb32abf018c7adfd8e7de4d06360151 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Mon, 23 Aug 2021 18:06:00 -0400 Subject: [PATCH 24/49] Added comment about gotestsum usage --- test/scripts/e2e_go_tests.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/test/scripts/e2e_go_tests.sh b/test/scripts/e2e_go_tests.sh index 15a7bd43a1..7827b33e03 100755 --- a/test/scripts/e2e_go_tests.sh +++ b/test/scripts/e2e_go_tests.sh @@ -8,6 +8,7 @@ set -o pipefail export GOPATH=$(go env GOPATH) export GO111MODULE=on +# Needed for now because circleci doesn't use makefile yet if [ -z "$(which gotestsum)" ]; then GOTESTCOMMAND=${GOTESTCOMMAND:="go test"} else From 11d153a0c19330f09f5c44f17db0c2f13d882e0d Mon Sep 17 00:00:00 2001 From: chris erway Date: Wed, 25 Aug 2021 16:48:52 -0400 Subject: [PATCH 25/49] Add double sharding to the expect tests --- test/e2e-go/cli/algod/expect/algod_expect_test.go | 2 ++ test/e2e-go/cli/algoh/expect/algoh_expect_test.go | 2 ++ test/e2e-go/cli/goal/expect/goal_expect_test.go | 2 ++ test/e2e-go/cli/tealdbg/expect/tealdbg_expect_test.go | 2 ++ 4 files changed, 8 insertions(+) diff --git a/test/e2e-go/cli/algod/expect/algod_expect_test.go b/test/e2e-go/cli/algod/expect/algod_expect_test.go index d7201b3f18..a5793200ab 100644 --- a/test/e2e-go/cli/algod/expect/algod_expect_test.go +++ b/test/e2e-go/cli/algod/expect/algod_expect_test.go @@ -19,10 +19,12 @@ import ( "testing" "github.com/algorand/go-algorand/test/framework/fixtures" + "github.com/algorand/go-algorand/test/partitiontest" ) // TestAlgodWithExpect Process all expect script files with suffix Test.exp within the test/e2e-go/cli/algod/expect directory func TestAlgodWithExpect(t *testing.T) { + partitiontest.PartitionTest(t) et := fixtures.MakeExpectTest(t) et.Run() } diff --git a/test/e2e-go/cli/algoh/expect/algoh_expect_test.go b/test/e2e-go/cli/algoh/expect/algoh_expect_test.go index 682183c495..e30b1ef1ca 100644 --- a/test/e2e-go/cli/algoh/expect/algoh_expect_test.go +++ b/test/e2e-go/cli/algoh/expect/algoh_expect_test.go @@ -19,10 +19,12 @@ import ( "testing" "github.com/algorand/go-algorand/test/framework/fixtures" + "github.com/algorand/go-algorand/test/partitiontest" ) // TestAlgohWithExpect Process all expect script files with suffix Test.exp within the test/e2e-go/cli/algoh/expect directory func TestAlgohWithExpect(t *testing.T) { + partitiontest.PartitionTest(t) et := fixtures.MakeExpectTest(t) et.Run() } diff --git a/test/e2e-go/cli/goal/expect/goal_expect_test.go b/test/e2e-go/cli/goal/expect/goal_expect_test.go index ce22987f07..8a49bebc22 100644 --- a/test/e2e-go/cli/goal/expect/goal_expect_test.go +++ b/test/e2e-go/cli/goal/expect/goal_expect_test.go @@ -20,10 +20,12 @@ import ( "testing" "github.com/algorand/go-algorand/test/framework/fixtures" + "github.com/algorand/go-algorand/test/partitiontest" ) // TestGoalWithExpect Process all expect script files with suffix Test.exp within the test/e2e-go/cli/goal/expect directory func TestGoalWithExpect(t *testing.T) { + partitiontest.PartitionTest(t) et := fixtures.MakeExpectTest(t) et.Run() } diff --git a/test/e2e-go/cli/tealdbg/expect/tealdbg_expect_test.go b/test/e2e-go/cli/tealdbg/expect/tealdbg_expect_test.go index 633e8f133e..451bc43a21 100644 --- a/test/e2e-go/cli/tealdbg/expect/tealdbg_expect_test.go +++ b/test/e2e-go/cli/tealdbg/expect/tealdbg_expect_test.go @@ -19,10 +19,12 @@ import ( "testing" "github.com/algorand/go-algorand/test/framework/fixtures" + "github.com/algorand/go-algorand/test/partitiontest" ) // TestTealdbgWithExpect processes all expect script files with suffix Test.exp within the test/e2e-go/cli/tealdbg/expect directory func TestTealdbgWithExpect(t *testing.T) { + partitiontest.PartitionTest(t) et := fixtures.MakeExpectTest(t) et.Run() } From 7f93ef41382ff5f012f04341afac3a1545c83f6e Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Mon, 30 Aug 2021 19:26:52 -0400 Subject: [PATCH 26/49] Replaced lists with one dictionary and better messages --- scripts/buildtools/check_tests.py | 141 +++++++++++++++--------------- 1 file changed, 70 insertions(+), 71 deletions(-) diff --git a/scripts/buildtools/check_tests.py b/scripts/buildtools/check_tests.py index 78c1633e90..23820ad95d 100755 --- a/scripts/buildtools/check_tests.py +++ b/scripts/buildtools/check_tests.py @@ -3,6 +3,7 @@ import json import sys import argparse +NUMBER_OF_NODES = 4 # Arguments parsing / help menu parser = argparse.ArgumentParser(description='Verify test results for skipped tests and tests with multiple passes.') @@ -10,10 +11,8 @@ help='json format test results file path (e.g. /tmp/results/testresults.json)') args = parser.parse_args() -# Go through the given file one json object at a time, and record into lists -total = set() -passedWDupes = [] -partitionSkipped = set() +# Go through the given file one json object at a time, and record into a dict +AllTestResults = {} with open(args.tests_results_filepath) as f: for jsonObj in f: testDict = json.loads(jsonObj) @@ -21,90 +20,90 @@ continue fullTestName = testDict['Package'] + ' ' + testDict['Test'] - total.add(fullTestName) + if fullTestName not in AllTestResults: + AllTestResults[fullTestName] = {} + AllTestResults[fullTestName]['ran'] = 0 + AllTestResults[fullTestName]['skipped_due_to_partitioning'] = 0 + # AllTestResults[fullTestName]['other_reasons'] = [] + # actions can be: output, run, skip, pass if 'pass' in testDict["Action"]: - passedWDupes.append(fullTestName) - if 'Output' in testDict and 'due to partitioning' in testDict['Output']: - partitionSkipped.add(fullTestName) + AllTestResults[fullTestName]['ran'] += 1 + elif 'Output' in testDict: + if 'due to partitioning' in testDict['Output']: + AllTestResults[fullTestName]['skipped_due_to_partitioning'] += 1 + # elif not any(x in testDict['Output']for x in ['--- SKIP', '=== RUN', '--- PASS', '=== PAUSE', '=== CONT']): + # AllTestResults[fullTestName]['other_reasons'].append(testDict['Output']) + + f.close() # === Calculate results === -# Total seen (deduped) -# total - -# Passed with duplicates (needed for checking which tests passed multiple times) -# passedWDupes - -# Passed without duplicates (deduped) -passed = set(passedWDupes) - -# Skipped at least once due to partition (deduped) -# partitionSkipped - -# Skipped due to partition and never passed (deduped) -partitionSkippedNotPass = partitionSkipped - passed - -# Skipped due to other reasons (deduped) -skippedNotPartition = total - passed.union(partitionSkipped) - -# Total not passed (deduped) -notPassed = total - passed - # Sort and print messages with colored prefix -red_text_color = "\033[0;31m" -green_text_color = "\033[0;32m" -yellow_text_color = "\033[0;33m" -normal_text_color = "\033[0;0m" -def printColor(message, color=normal_text_color): - print("{}{}{}".format(color, message, normal_text_color)) +RED_TEXT_COLOR = "\033[0;31m" +GREEN_TEXT_COLOR = "\033[0;32m" +YELLOW_TEXT_COLOR = "\033[0;33m" +NORMAL_TEXT_COLOR = "\033[0;0m" +def printColor(message, color=NORMAL_TEXT_COLOR): + print(f"{color}{message}{NORMAL_TEXT_COLOR}") # Record error message for sys.exit(errorMessage) errorMessage = '' -# Check tests not passed for misc reasons -print("==================================================") -if len(skippedNotPartition): - print("{} tests didn't pass due to other reasons (Maybe on purpose)".format(len(skippedNotPartition))) - print("Here are the ones that didn't pass due to other reasons: ") - print(*sorted(list(skippedNotPartition)), sep = "\n") +# Check for tests that ran multiple times +printColor("=========== RAN MULTIPLE TIMES ===================", YELLOW_TEXT_COLOR) +listOfMultipleRuns = [] +for x in AllTestResults: + if AllTestResults[x]['ran'] > 1: + listOfMultipleRuns.append(x + " -- ran " + str(AllTestResults[x]['ran']) + " times. (Can probably be fixed by adding \"partitiontest.PartitionTest()\")") +countMultipleRuns = len(listOfMultipleRuns) +if countMultipleRuns: + printColor(f"The above {countMultipleRuns} tests ran multiple times:", RED_TEXT_COLOR) + [printColor(f"{x}", RED_TEXT_COLOR) for x in sorted(listOfMultipleRuns)] + printColor(f"The above {countMultipleRuns} tests ran multiple times:", RED_TEXT_COLOR) else: - print("No tests skipped for other reasons.") -print("==================================================") - -# Check for duplicates in the passed tests -print("==================================================") -if len(passedWDupes) != len(passed): - testDuplicates = set([testName + " - " + str(passedWDupes.count(testName)) for testName in passedWDupes if passedWDupes.count(testName) > 1]) - print("{} tests passed multiple times!!".format(len(testDuplicates))) - print("Here are the duplicates and number of times passed: ") - print(*sorted(testDuplicates), sep = "\n") + printColor("All tests that ran, ran only once ... OK", GREEN_TEXT_COLOR) +printColor("==================================================", YELLOW_TEXT_COLOR) + +# Check intentionally skipped tests +printColor("============= INTENTIONALLY SKIPPED ==============", YELLOW_TEXT_COLOR) +# countSkippedOther = sum([1 for x in AllTestResults if 'other_reasons' in AllTestResults[x] and len(AllTestResults[x]['other_reasons'])]) +listOfSkippedIntentionally = [] +[listOfSkippedIntentionally.append(x) for x in AllTestResults if (AllTestResults[x]['ran'] == 0 and AllTestResults[x]['skipped_due_to_partitioning'] < NUMBER_OF_NODES)] +countSkippedIntentionally = len(listOfSkippedIntentionally) +if countSkippedIntentionally: + printColor(f"The following {countSkippedIntentionally} tests were skipped intentionally:", YELLOW_TEXT_COLOR) + [printColor(f"{x} -- skipped intentionally (please double check)", YELLOW_TEXT_COLOR) for x in sorted(listOfSkippedIntentionally)] + printColor(f"The above {countSkippedIntentionally} tests were skipped intentionally:", YELLOW_TEXT_COLOR) else: - print("All tests that passed, passed only once ... OK") -print("==================================================") - -# Check tests not passed due to partition -print("==================================================") -if len(partitionSkippedNotPass): - print("{} tests didn't pass due to partition!!".format(len(partitionSkippedNotPass))) - print("Here are the ones that didn't pass due to partition: ") - [printColor(x, red_text_color) for x in sorted(list(partitionSkippedNotPass))] - errorMessage += "{}FAIL ERROR:{} {} tests didn't pass due to partition!! (Scroll up top to see which)\n".format(red_text_color, normal_text_color, len(partitionSkippedNotPass)) + printColor("No tests skipped intentionally.", GREEN_TEXT_COLOR) +printColor("==================================================", YELLOW_TEXT_COLOR) + +# Check tests unintentionally (due to partition) +printColor("============= UNINTENTIONALLY SKIPPED ============", YELLOW_TEXT_COLOR) +listOfSkippedUnintentionally = [] +[listOfSkippedUnintentionally.append(x) for x in AllTestResults if (AllTestResults[x]['ran'] == 0 and AllTestResults[x]['skipped_due_to_partitioning'] >= NUMBER_OF_NODES)] +countSkippedUnintentionally = len(listOfSkippedIntentionally) +if countSkippedUnintentionally: + printColor(f"{countSkippedUnintentionally} tests were skipped UNintentionally", RED_TEXT_COLOR) + [printColor(f"{x} -- skipped UNintentionally. (due to partitiontest.PartitionTest() being called twice?)", RED_TEXT_COLOR) for x in sorted(listOfSkippedIntentionally)] + printColor(f"{countSkippedUnintentionally} tests were skipped UNintentionally.", RED_TEXT_COLOR) else: - print("No tests skipped due to partition.") -print("==================================================") + printColor("No tests skipped UNintentionally (due to partitioning).", GREEN_TEXT_COLOR) +printColor("==================================================", YELLOW_TEXT_COLOR) # === Summary === -print("==================================================") -print("Saw {} tests total".format(len(total))) -print("{} passed before dedup".format(len(passedWDupes))) -print("{} passed after dedup".format(len(passed))) -print("{} skipped due to partition".format(len(partitionSkippedNotPass))) -print("{} skipped for misc reasons (Maybe on purpose)".format(len(skippedNotPartition))) -print("{} total skipped".format(len(notPassed))) -print("==================================================") +printColor("==================== SUMMARY =====================", YELLOW_TEXT_COLOR) + +printColor(f"Saw {len(AllTestResults)} unique tests", GREEN_TEXT_COLOR if countSkippedIntentionally != 0 else RED_TEXT_COLOR) +print(f"{countSkippedIntentionally + countSkippedUnintentionally} tests skipped total") +printColor(f"{sum(1 for x in AllTestResults if AllTestResults[x]['ran'] > 0)} tests ran", GREEN_TEXT_COLOR if countSkippedIntentionally != 0 else RED_TEXT_COLOR) +printColor(f"{countSkippedIntentionally} tests were skipped intentionally. (They were probably disabled, please double check)", GREEN_TEXT_COLOR if countSkippedIntentionally == 0 else YELLOW_TEXT_COLOR) +printColor(f"{countMultipleRuns} tests ran multiple times. (Can probably be fixed by adding \"partitiontest.PartitionTest()\")", GREEN_TEXT_COLOR if countMultipleRuns == 0 else RED_TEXT_COLOR) +printColor(f"{countSkippedUnintentionally} tests were skipped UNintentionally. (Due to partitioning multiple times? maybe due to partitiontest.PartitionTest() being called twice?)", GREEN_TEXT_COLOR if countSkippedUnintentionally == 0 else RED_TEXT_COLOR) +printColor("==================================================", YELLOW_TEXT_COLOR) print("===== FINISHED RUNNING check_tests.py =====") sys.exit(errorMessage) From 08fd3b5e85e8e9decd3effbae2a4a866c79a0410 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Tue, 31 Aug 2021 12:47:39 -0400 Subject: [PATCH 27/49] Fixed typos and formatting --- scripts/buildtools/check_tests.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/scripts/buildtools/check_tests.py b/scripts/buildtools/check_tests.py index 23820ad95d..8ad815c306 100755 --- a/scripts/buildtools/check_tests.py +++ b/scripts/buildtools/check_tests.py @@ -1,4 +1,4 @@ -print("===== STARTED RUNNING check_tests.py =====") +print("===== STARTED RUNNING check_tests.py =====\n") import json import sys @@ -65,7 +65,7 @@ def printColor(message, color=NORMAL_TEXT_COLOR): printColor(f"The above {countMultipleRuns} tests ran multiple times:", RED_TEXT_COLOR) else: printColor("All tests that ran, ran only once ... OK", GREEN_TEXT_COLOR) -printColor("==================================================", YELLOW_TEXT_COLOR) +printColor("==================================================\n", YELLOW_TEXT_COLOR) # Check intentionally skipped tests printColor("============= INTENTIONALLY SKIPPED ==============", YELLOW_TEXT_COLOR) @@ -79,31 +79,34 @@ def printColor(message, color=NORMAL_TEXT_COLOR): printColor(f"The above {countSkippedIntentionally} tests were skipped intentionally:", YELLOW_TEXT_COLOR) else: printColor("No tests skipped intentionally.", GREEN_TEXT_COLOR) -printColor("==================================================", YELLOW_TEXT_COLOR) +printColor("==================================================\n", YELLOW_TEXT_COLOR) # Check tests unintentionally (due to partition) printColor("============= UNINTENTIONALLY SKIPPED ============", YELLOW_TEXT_COLOR) listOfSkippedUnintentionally = [] [listOfSkippedUnintentionally.append(x) for x in AllTestResults if (AllTestResults[x]['ran'] == 0 and AllTestResults[x]['skipped_due_to_partitioning'] >= NUMBER_OF_NODES)] -countSkippedUnintentionally = len(listOfSkippedIntentionally) +countSkippedUnintentionally = len(listOfSkippedUnintentionally) if countSkippedUnintentionally: printColor(f"{countSkippedUnintentionally} tests were skipped UNintentionally", RED_TEXT_COLOR) - [printColor(f"{x} -- skipped UNintentionally. (due to partitiontest.PartitionTest() being called twice?)", RED_TEXT_COLOR) for x in sorted(listOfSkippedIntentionally)] + [printColor(f"{x} -- skipped UNintentionally. (due to partitiontest.PartitionTest() being called twice?)", RED_TEXT_COLOR) for x in sorted(listOfSkippedUnintentionally)] printColor(f"{countSkippedUnintentionally} tests were skipped UNintentionally.", RED_TEXT_COLOR) else: printColor("No tests skipped UNintentionally (due to partitioning).", GREEN_TEXT_COLOR) -printColor("==================================================", YELLOW_TEXT_COLOR) +printColor("==================================================\n", YELLOW_TEXT_COLOR) # === Summary === printColor("==================== SUMMARY =====================", YELLOW_TEXT_COLOR) +countUniqueTests = len(AllTestResults) +countTotalSkipped = countSkippedIntentionally + countSkippedUnintentionally +countRanTests = sum(1 for x in AllTestResults if AllTestResults[x]['ran'] > 0) -printColor(f"Saw {len(AllTestResults)} unique tests", GREEN_TEXT_COLOR if countSkippedIntentionally != 0 else RED_TEXT_COLOR) -print(f"{countSkippedIntentionally + countSkippedUnintentionally} tests skipped total") -printColor(f"{sum(1 for x in AllTestResults if AllTestResults[x]['ran'] > 0)} tests ran", GREEN_TEXT_COLOR if countSkippedIntentionally != 0 else RED_TEXT_COLOR) +printColor(f"Saw {countUniqueTests} unique tests", GREEN_TEXT_COLOR if countUniqueTests != 0 else RED_TEXT_COLOR) +printColor(f"{countTotalSkipped} total skipped tests", GREEN_TEXT_COLOR if countTotalSkipped == 0 else YELLOW_TEXT_COLOR) +printColor(f"{countRanTests} tests ran", GREEN_TEXT_COLOR if countRanTests != 0 else RED_TEXT_COLOR) printColor(f"{countSkippedIntentionally} tests were skipped intentionally. (They were probably disabled, please double check)", GREEN_TEXT_COLOR if countSkippedIntentionally == 0 else YELLOW_TEXT_COLOR) -printColor(f"{countMultipleRuns} tests ran multiple times. (Can probably be fixed by adding \"partitiontest.PartitionTest()\")", GREEN_TEXT_COLOR if countMultipleRuns == 0 else RED_TEXT_COLOR) printColor(f"{countSkippedUnintentionally} tests were skipped UNintentionally. (Due to partitioning multiple times? maybe due to partitiontest.PartitionTest() being called twice?)", GREEN_TEXT_COLOR if countSkippedUnintentionally == 0 else RED_TEXT_COLOR) -printColor("==================================================", YELLOW_TEXT_COLOR) +printColor(f"{countMultipleRuns} tests ran multiple times. (Can probably be fixed by adding \"partitiontest.PartitionTest()\")", GREEN_TEXT_COLOR if countMultipleRuns == 0 else RED_TEXT_COLOR) +printColor("==================================================\n", YELLOW_TEXT_COLOR) print("===== FINISHED RUNNING check_tests.py =====") sys.exit(errorMessage) From a7497346c0df5b53b555864b16367aedd1de94af Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Tue, 31 Aug 2021 14:10:52 -0400 Subject: [PATCH 28/49] Added verification to e2e expect jobs --- .circleci/config.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8218388037..6b35bd7437 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -222,7 +222,7 @@ workflows: matrix: parameters: job_type: ["amd64", "arm64", "mac_amd64"] - job_version: ["test", "test_nightly", "integration", "integration_nightly"] + job_version: ["test", "test_nightly", "integration", "integration_nightly", "e2e_expect", "e2e_expect_nightly"] requires: - << matrix.job_type >>_<< matrix.job_version >> #- windows_x64_build @@ -575,7 +575,7 @@ jobs: steps: - prepare_go - generic_integration: - result_subdir: amd64-e2e_subs + result_subdir: amd64_e2e_expect short_test_flag: "-short" amd64_e2e_expect_nightly: @@ -587,7 +587,7 @@ jobs: steps: - prepare_go - generic_integration: - result_subdir: amd64-e2e_subs_nightly + result_subdir: amd64_e2e_expect_nightly no_output_timeout: 45m - slack/notify: event: fail @@ -701,7 +701,7 @@ jobs: - checkout - prepare_go - generic_integration: - result_subdir: arm64-e2e_subs + result_subdir: arm64_e2e_expect short_test_flag: "-short" arm64_e2e_expect_nightly: @@ -714,7 +714,7 @@ jobs: - checkout - prepare_go - generic_integration: - result_subdir: arm64-e2e_subs-nightly + result_subdir: arm64_e2e_expect_nightly no_output_timeout: 45m - slack/notify: event: fail @@ -847,7 +847,7 @@ jobs: #- run: git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow - prepare_go - generic_integration: - result_subdir: mac-amd64-e2e_subs + result_subdir: mac_amd64_e2e_expect circleci_home: /Users/distiller short_test_flag: "-short" @@ -862,7 +862,7 @@ jobs: #- run: git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow - prepare_go - generic_integration: - result_subdir: mac-amd64-e2e_subs-nightly + result_subdir: mac_amd64_e2e_expect_nightly circleci_home: /Users/distiller no_output_timeout: 45m - slack/notify: @@ -894,7 +894,7 @@ jobs: parameters: job_type: # job_type: ["amd64", "arm64", "mac_amd64"] type: string - job_version: # job_version: ["test", "test_nightly", "integration", "integration_nightly"] + job_version: # job_version: ["test", "test_nightly", "integration", "integration_nightly", "e2e_expect", "e2e_expect_nightly"] type: string steps: - checkout From 08cfb406ff864306e35ffce211f6d97c7104e8ee Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Tue, 31 Aug 2021 14:26:29 -0400 Subject: [PATCH 29/49] Fixed exit error code --- scripts/buildtools/check_tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/buildtools/check_tests.py b/scripts/buildtools/check_tests.py index 8ad815c306..d0fc7d5770 100755 --- a/scripts/buildtools/check_tests.py +++ b/scripts/buildtools/check_tests.py @@ -90,6 +90,7 @@ def printColor(message, color=NORMAL_TEXT_COLOR): printColor(f"{countSkippedUnintentionally} tests were skipped UNintentionally", RED_TEXT_COLOR) [printColor(f"{x} -- skipped UNintentionally. (due to partitiontest.PartitionTest() being called twice?)", RED_TEXT_COLOR) for x in sorted(listOfSkippedUnintentionally)] printColor(f"{countSkippedUnintentionally} tests were skipped UNintentionally.", RED_TEXT_COLOR) + errorMessage += f"{countSkippedUnintentionally} tests were skipped UNintentionally"; else: printColor("No tests skipped UNintentionally (due to partitioning).", GREEN_TEXT_COLOR) printColor("==================================================\n", YELLOW_TEXT_COLOR) @@ -109,4 +110,4 @@ def printColor(message, color=NORMAL_TEXT_COLOR): printColor("==================================================\n", YELLOW_TEXT_COLOR) print("===== FINISHED RUNNING check_tests.py =====") -sys.exit(errorMessage) +sys.exit(0 if not errorMessage else errorMessage) From a7ef7c74b7b3a9c08c825759357787563e8ef28e Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Tue, 31 Aug 2021 16:55:05 -0400 Subject: [PATCH 30/49] Switching to nightly tests to check them too --- .circleci/config.yml | 48 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6b35bd7437..94894c5805 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,7 +16,7 @@ workflows: - amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - amd64_test_nightly: @@ -24,7 +24,7 @@ workflows: - amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -33,7 +33,7 @@ workflows: - amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - amd64_integration_nightly: @@ -41,7 +41,7 @@ workflows: - amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -50,7 +50,7 @@ workflows: - amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - amd64_e2e_subs_nightly: @@ -58,7 +58,7 @@ workflows: - amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -67,7 +67,7 @@ workflows: - amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - amd64_e2e_expect_nightly: @@ -75,7 +75,7 @@ workflows: - amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -85,7 +85,7 @@ workflows: - arm64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - arm64_test_nightly: @@ -93,7 +93,7 @@ workflows: - arm64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -102,7 +102,7 @@ workflows: - arm64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - arm64_integration_nightly: @@ -110,7 +110,7 @@ workflows: - arm64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -119,7 +119,7 @@ workflows: - arm64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - arm64_e2e_subs_nightly: @@ -127,7 +127,7 @@ workflows: - arm64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -136,7 +136,7 @@ workflows: - arm64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - arm64_e2e_expect_nightly: @@ -144,7 +144,7 @@ workflows: - arm64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -154,7 +154,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_test_nightly: @@ -162,7 +162,7 @@ workflows: - mac_amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -171,7 +171,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_integration_nightly: @@ -179,7 +179,7 @@ workflows: - mac_amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -188,7 +188,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_e2e_subs_nightly: @@ -196,7 +196,7 @@ workflows: - mac_amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -205,7 +205,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_e2e_expect_nightly: @@ -213,7 +213,7 @@ workflows: - mac_amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets From fa5f92c5fa621eb0373a15b48f80adb556128fda Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Tue, 31 Aug 2021 18:04:16 -0400 Subject: [PATCH 31/49] Revert "Switching to nightly tests to check them too" This reverts commit a7ef7c74b7b3a9c08c825759357787563e8ef28e. --- .circleci/config.yml | 48 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 94894c5805..6b35bd7437 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,7 +16,7 @@ workflows: - amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - amd64_test_nightly: @@ -24,7 +24,7 @@ workflows: - amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -33,7 +33,7 @@ workflows: - amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - amd64_integration_nightly: @@ -41,7 +41,7 @@ workflows: - amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -50,7 +50,7 @@ workflows: - amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - amd64_e2e_subs_nightly: @@ -58,7 +58,7 @@ workflows: - amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -67,7 +67,7 @@ workflows: - amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - amd64_e2e_expect_nightly: @@ -75,7 +75,7 @@ workflows: - amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -85,7 +85,7 @@ workflows: - arm64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - arm64_test_nightly: @@ -93,7 +93,7 @@ workflows: - arm64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -102,7 +102,7 @@ workflows: - arm64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - arm64_integration_nightly: @@ -110,7 +110,7 @@ workflows: - arm64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -119,7 +119,7 @@ workflows: - arm64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - arm64_e2e_subs_nightly: @@ -127,7 +127,7 @@ workflows: - arm64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -136,7 +136,7 @@ workflows: - arm64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - arm64_e2e_expect_nightly: @@ -144,7 +144,7 @@ workflows: - arm64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -154,7 +154,7 @@ workflows: - mac_amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_test_nightly: @@ -162,7 +162,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -171,7 +171,7 @@ workflows: - mac_amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_integration_nightly: @@ -179,7 +179,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -188,7 +188,7 @@ workflows: - mac_amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_e2e_subs_nightly: @@ -196,7 +196,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -205,7 +205,7 @@ workflows: - mac_amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_e2e_expect_nightly: @@ -213,7 +213,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets From fff391398f354471fd2b10bb3d0d671e88d2b7c4 Mon Sep 17 00:00:00 2001 From: chris erway Date: Wed, 1 Sep 2021 10:04:54 -0400 Subject: [PATCH 32/49] increase parallelism: 2 and reduce resource_class used by expect jobs --- .circleci/config.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6b35bd7437..a5d9637eb7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -569,7 +569,8 @@ jobs: amd64_e2e_expect: machine: image: ubuntu-2004:202104-01 - resource_class: large + resource_class: medium + parallelism: 2 environment: E2E_TEST_FILTER: "EXPECT" steps: @@ -581,7 +582,8 @@ jobs: amd64_e2e_expect_nightly: machine: image: ubuntu-2004:202104-01 - resource_class: large + resource_class: medium + parallelism: 2 environment: E2E_TEST_FILTER: "EXPECT" steps: @@ -694,7 +696,8 @@ jobs: arm64_e2e_expect: machine: image: ubuntu-2004:202101-01 - resource_class: arm.large + resource_class: arm.medium + parallelism: 2 environment: E2E_TEST_FILTER: "EXPECT" steps: @@ -707,7 +710,8 @@ jobs: arm64_e2e_expect_nightly: machine: image: ubuntu-2004:202101-01 - resource_class: arm.large + resource_class: arm.medium + parallelism: 2 environment: E2E_TEST_FILTER: "EXPECT" steps: @@ -839,7 +843,8 @@ jobs: mac_amd64_e2e_expect: macos: xcode: 12.0.1 - resource_class: large + resource_class: medium + parallelism: 2 environment: E2E_TEST_FILTER: "EXPECT" HOMEBREW_NO_AUTO_UPDATE: "true" @@ -854,7 +859,8 @@ jobs: mac_amd64_e2e_expect_nightly: macos: xcode: 12.0.1 - resource_class: large + resource_class: medium + parallelism: 2 environment: E2E_TEST_FILTER: "EXPECT" HOMEBREW_NO_AUTO_UPDATE: "true" From c4b6da383230961de3b77187edaf50a92a7ae76b Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Wed, 1 Sep 2021 16:36:32 -0400 Subject: [PATCH 33/49] Fixing how we detect intentional vs unintentional skips --- scripts/buildtools/check_tests.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/scripts/buildtools/check_tests.py b/scripts/buildtools/check_tests.py index d0fc7d5770..b056d02cad 100755 --- a/scripts/buildtools/check_tests.py +++ b/scripts/buildtools/check_tests.py @@ -3,7 +3,6 @@ import json import sys import argparse -NUMBER_OF_NODES = 4 # Arguments parsing / help menu parser = argparse.ArgumentParser(description='Verify test results for skipped tests and tests with multiple passes.') @@ -23,17 +22,18 @@ if fullTestName not in AllTestResults: AllTestResults[fullTestName] = {} AllTestResults[fullTestName]['ran'] = 0 - AllTestResults[fullTestName]['skipped_due_to_partitioning'] = 0 - # AllTestResults[fullTestName]['other_reasons'] = [] + AllTestResults[fullTestName]['last_output'] = '' + AllTestResults[fullTestName]['skipped_intentionally'] = False + AllTestResults[fullTestName]['skipped_reason'] = '' # actions can be: output, run, skip, pass if 'pass' in testDict["Action"]: AllTestResults[fullTestName]['ran'] += 1 - elif 'Output' in testDict: - if 'due to partitioning' in testDict['Output']: - AllTestResults[fullTestName]['skipped_due_to_partitioning'] += 1 - # elif not any(x in testDict['Output']for x in ['--- SKIP', '=== RUN', '--- PASS', '=== PAUSE', '=== CONT']): - # AllTestResults[fullTestName]['other_reasons'].append(testDict['Output']) + elif 'output' in testDict["Action"]: + if '--- SKIP' in testDict['Output'] and 'due to partitioning' not in AllTestResults[fullTestName]['last_output']: + AllTestResults[fullTestName]['skipped_intentionally'] = True + AllTestResults[fullTestName]['skipped_reason'] = AllTestResults[fullTestName]['last_output'] + AllTestResults[fullTestName]['last_output'] = testDict['Output'] @@ -69,13 +69,12 @@ def printColor(message, color=NORMAL_TEXT_COLOR): # Check intentionally skipped tests printColor("============= INTENTIONALLY SKIPPED ==============", YELLOW_TEXT_COLOR) -# countSkippedOther = sum([1 for x in AllTestResults if 'other_reasons' in AllTestResults[x] and len(AllTestResults[x]['other_reasons'])]) listOfSkippedIntentionally = [] -[listOfSkippedIntentionally.append(x) for x in AllTestResults if (AllTestResults[x]['ran'] == 0 and AllTestResults[x]['skipped_due_to_partitioning'] < NUMBER_OF_NODES)] +[listOfSkippedIntentionally.append(x) for x in AllTestResults if (AllTestResults[x]['ran'] == 0 and AllTestResults[x]['skipped_intentionally'] == True )] countSkippedIntentionally = len(listOfSkippedIntentionally) if countSkippedIntentionally: printColor(f"The following {countSkippedIntentionally} tests were skipped intentionally:", YELLOW_TEXT_COLOR) - [printColor(f"{x} -- skipped intentionally (please double check)", YELLOW_TEXT_COLOR) for x in sorted(listOfSkippedIntentionally)] + [printColor(f"{x} -- skipped intentionally (please double check) Reason: {AllTestResults[x]['skipped_reason']}", YELLOW_TEXT_COLOR) for x in sorted(listOfSkippedIntentionally)] printColor(f"The above {countSkippedIntentionally} tests were skipped intentionally:", YELLOW_TEXT_COLOR) else: printColor("No tests skipped intentionally.", GREEN_TEXT_COLOR) @@ -84,7 +83,7 @@ def printColor(message, color=NORMAL_TEXT_COLOR): # Check tests unintentionally (due to partition) printColor("============= UNINTENTIONALLY SKIPPED ============", YELLOW_TEXT_COLOR) listOfSkippedUnintentionally = [] -[listOfSkippedUnintentionally.append(x) for x in AllTestResults if (AllTestResults[x]['ran'] == 0 and AllTestResults[x]['skipped_due_to_partitioning'] >= NUMBER_OF_NODES)] +[listOfSkippedUnintentionally.append(x) for x in AllTestResults if (AllTestResults[x]['ran'] == 0 and AllTestResults[x]['skipped_intentionally'] == False)] countSkippedUnintentionally = len(listOfSkippedUnintentionally) if countSkippedUnintentionally: printColor(f"{countSkippedUnintentionally} tests were skipped UNintentionally", RED_TEXT_COLOR) From aa5576d399145c5520f0248aa422827070889ad1 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Wed, 1 Sep 2021 17:49:25 -0400 Subject: [PATCH 34/49] Fixed message when no reason found --- scripts/buildtools/check_tests.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/buildtools/check_tests.py b/scripts/buildtools/check_tests.py index b056d02cad..d847613130 100755 --- a/scripts/buildtools/check_tests.py +++ b/scripts/buildtools/check_tests.py @@ -32,7 +32,11 @@ elif 'output' in testDict["Action"]: if '--- SKIP' in testDict['Output'] and 'due to partitioning' not in AllTestResults[fullTestName]['last_output']: AllTestResults[fullTestName]['skipped_intentionally'] = True - AllTestResults[fullTestName]['skipped_reason'] = AllTestResults[fullTestName]['last_output'] + if '=== RUN' in AllTestResults[fullTestName]['last_output']: + AllTestResults[fullTestName]['skipped_reason'] = 'No reason given. PLEASE CHECK!!!' + else: + AllTestResults[fullTestName]['skipped_reason'] = AllTestResults[fullTestName]['last_output'] + AllTestResults[fullTestName]['last_output'] = testDict['Output'] From 30c9613e0509f9132a5c4c6396b9bd41434c44a3 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Thu, 2 Sep 2021 11:20:13 -0400 Subject: [PATCH 35/49] Fixed formatting of skipped reasons --- scripts/buildtools/check_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/buildtools/check_tests.py b/scripts/buildtools/check_tests.py index d847613130..3c2b117e6b 100755 --- a/scripts/buildtools/check_tests.py +++ b/scripts/buildtools/check_tests.py @@ -35,7 +35,7 @@ if '=== RUN' in AllTestResults[fullTestName]['last_output']: AllTestResults[fullTestName]['skipped_reason'] = 'No reason given. PLEASE CHECK!!!' else: - AllTestResults[fullTestName]['skipped_reason'] = AllTestResults[fullTestName]['last_output'] + AllTestResults[fullTestName]['skipped_reason'] = AllTestResults[fullTestName]['last_output'].strip() AllTestResults[fullTestName]['last_output'] = testDict['Output'] From 57724163422f28941ed771326e77e106b643e9a9 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Fri, 3 Sep 2021 15:47:13 -0400 Subject: [PATCH 36/49] Fixing wording of some things --- scripts/buildtools/check_tests.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/buildtools/check_tests.py b/scripts/buildtools/check_tests.py index 3c2b117e6b..d34bb70389 100755 --- a/scripts/buildtools/check_tests.py +++ b/scripts/buildtools/check_tests.py @@ -5,7 +5,7 @@ import argparse # Arguments parsing / help menu -parser = argparse.ArgumentParser(description='Verify test results for skipped tests and tests with multiple passes.') +parser = argparse.ArgumentParser(description='Check test results for intentionally and unintentionally skipped tests, as well as tests that ran multiple times.') parser.add_argument('tests_results_filepath', metavar='RESULTS_FILE', help='json format test results file path (e.g. /tmp/results/testresults.json)') args = parser.parse_args() @@ -84,18 +84,18 @@ def printColor(message, color=NORMAL_TEXT_COLOR): printColor("No tests skipped intentionally.", GREEN_TEXT_COLOR) printColor("==================================================\n", YELLOW_TEXT_COLOR) -# Check tests unintentionally (due to partition) +# Check unintentionally skipped tests (due to partition) printColor("============= UNINTENTIONALLY SKIPPED ============", YELLOW_TEXT_COLOR) listOfSkippedUnintentionally = [] [listOfSkippedUnintentionally.append(x) for x in AllTestResults if (AllTestResults[x]['ran'] == 0 and AllTestResults[x]['skipped_intentionally'] == False)] countSkippedUnintentionally = len(listOfSkippedUnintentionally) if countSkippedUnintentionally: - printColor(f"{countSkippedUnintentionally} tests were skipped UNintentionally", RED_TEXT_COLOR) - [printColor(f"{x} -- skipped UNintentionally. (due to partitiontest.PartitionTest() being called twice?)", RED_TEXT_COLOR) for x in sorted(listOfSkippedUnintentionally)] - printColor(f"{countSkippedUnintentionally} tests were skipped UNintentionally.", RED_TEXT_COLOR) - errorMessage += f"{countSkippedUnintentionally} tests were skipped UNintentionally"; + printColor(f"{countSkippedUnintentionally} tests were skipped unintentionally", RED_TEXT_COLOR) + [printColor(f"{x} -- skipped unintentionally. (due to partitiontest.PartitionTest() being called twice?)", RED_TEXT_COLOR) for x in sorted(listOfSkippedUnintentionally)] + printColor(f"{countSkippedUnintentionally} tests were skipped unintentionally.", RED_TEXT_COLOR) + errorMessage += f"{countSkippedUnintentionally} tests were skipped unintentionally"; else: - printColor("No tests skipped UNintentionally (due to partitioning).", GREEN_TEXT_COLOR) + printColor("No tests skipped unintentionally (due to partitioning).", GREEN_TEXT_COLOR) printColor("==================================================\n", YELLOW_TEXT_COLOR) # === Summary === @@ -108,7 +108,7 @@ def printColor(message, color=NORMAL_TEXT_COLOR): printColor(f"{countTotalSkipped} total skipped tests", GREEN_TEXT_COLOR if countTotalSkipped == 0 else YELLOW_TEXT_COLOR) printColor(f"{countRanTests} tests ran", GREEN_TEXT_COLOR if countRanTests != 0 else RED_TEXT_COLOR) printColor(f"{countSkippedIntentionally} tests were skipped intentionally. (They were probably disabled, please double check)", GREEN_TEXT_COLOR if countSkippedIntentionally == 0 else YELLOW_TEXT_COLOR) -printColor(f"{countSkippedUnintentionally} tests were skipped UNintentionally. (Due to partitioning multiple times? maybe due to partitiontest.PartitionTest() being called twice?)", GREEN_TEXT_COLOR if countSkippedUnintentionally == 0 else RED_TEXT_COLOR) +printColor(f"{countSkippedUnintentionally} tests were skipped unintentionally. (Due to partitioning multiple times? maybe due to partitiontest.PartitionTest() being called twice?)", GREEN_TEXT_COLOR if countSkippedUnintentionally == 0 else RED_TEXT_COLOR) printColor(f"{countMultipleRuns} tests ran multiple times. (Can probably be fixed by adding \"partitiontest.PartitionTest()\")", GREEN_TEXT_COLOR if countMultipleRuns == 0 else RED_TEXT_COLOR) printColor("==================================================\n", YELLOW_TEXT_COLOR) From bb2fa5715037cf49085a902e41742cc2ab97d17b Mon Sep 17 00:00:00 2001 From: chris erway Date: Tue, 7 Sep 2021 12:04:22 -0400 Subject: [PATCH 37/49] Revert "Add double sharding to the expect tests" This reverts commit 11d153a0c19330f09f5c44f17db0c2f13d882e0d. --- test/e2e-go/cli/algod/expect/algod_expect_test.go | 2 -- test/e2e-go/cli/algoh/expect/algoh_expect_test.go | 2 -- test/e2e-go/cli/goal/expect/goal_expect_test.go | 2 -- test/e2e-go/cli/tealdbg/expect/tealdbg_expect_test.go | 2 -- 4 files changed, 8 deletions(-) diff --git a/test/e2e-go/cli/algod/expect/algod_expect_test.go b/test/e2e-go/cli/algod/expect/algod_expect_test.go index a5793200ab..d7201b3f18 100644 --- a/test/e2e-go/cli/algod/expect/algod_expect_test.go +++ b/test/e2e-go/cli/algod/expect/algod_expect_test.go @@ -19,12 +19,10 @@ import ( "testing" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/test/partitiontest" ) // TestAlgodWithExpect Process all expect script files with suffix Test.exp within the test/e2e-go/cli/algod/expect directory func TestAlgodWithExpect(t *testing.T) { - partitiontest.PartitionTest(t) et := fixtures.MakeExpectTest(t) et.Run() } diff --git a/test/e2e-go/cli/algoh/expect/algoh_expect_test.go b/test/e2e-go/cli/algoh/expect/algoh_expect_test.go index e30b1ef1ca..682183c495 100644 --- a/test/e2e-go/cli/algoh/expect/algoh_expect_test.go +++ b/test/e2e-go/cli/algoh/expect/algoh_expect_test.go @@ -19,12 +19,10 @@ import ( "testing" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/test/partitiontest" ) // TestAlgohWithExpect Process all expect script files with suffix Test.exp within the test/e2e-go/cli/algoh/expect directory func TestAlgohWithExpect(t *testing.T) { - partitiontest.PartitionTest(t) et := fixtures.MakeExpectTest(t) et.Run() } diff --git a/test/e2e-go/cli/goal/expect/goal_expect_test.go b/test/e2e-go/cli/goal/expect/goal_expect_test.go index 8a49bebc22..ce22987f07 100644 --- a/test/e2e-go/cli/goal/expect/goal_expect_test.go +++ b/test/e2e-go/cli/goal/expect/goal_expect_test.go @@ -20,12 +20,10 @@ import ( "testing" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/test/partitiontest" ) // TestGoalWithExpect Process all expect script files with suffix Test.exp within the test/e2e-go/cli/goal/expect directory func TestGoalWithExpect(t *testing.T) { - partitiontest.PartitionTest(t) et := fixtures.MakeExpectTest(t) et.Run() } diff --git a/test/e2e-go/cli/tealdbg/expect/tealdbg_expect_test.go b/test/e2e-go/cli/tealdbg/expect/tealdbg_expect_test.go index 451bc43a21..633e8f133e 100644 --- a/test/e2e-go/cli/tealdbg/expect/tealdbg_expect_test.go +++ b/test/e2e-go/cli/tealdbg/expect/tealdbg_expect_test.go @@ -19,12 +19,10 @@ import ( "testing" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/test/partitiontest" ) // TestTealdbgWithExpect processes all expect script files with suffix Test.exp within the test/e2e-go/cli/tealdbg/expect directory func TestTealdbgWithExpect(t *testing.T) { - partitiontest.PartitionTest(t) et := fixtures.MakeExpectTest(t) et.Run() } From 4929222b4f0d8f5be47a0c74b5852668f74b779f Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Tue, 7 Sep 2021 13:12:53 -0400 Subject: [PATCH 38/49] Fixing double partitioned tests --- data/transactions/logic/opcodes_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/transactions/logic/opcodes_test.go b/data/transactions/logic/opcodes_test.go index c894e12478..b5e7627850 100644 --- a/data/transactions/logic/opcodes_test.go +++ b/data/transactions/logic/opcodes_test.go @@ -81,7 +81,8 @@ func TestOpcodesByVersionReordered(t *testing.T) { } func TestOpcodesByVersion(t *testing.T) { - partitiontest.PartitionTest(t) + // partitiontest.PartitionTest(t) + // has partitioning in the TestOpcodesByVersionReordered() // Make a copy of the OpSpecs to check if OpcodesByVersion will change it OpSpecs2 := make([]OpSpec, len(OpSpecs)) From 67abb84d8edae8c270f2083ecfb81f7b0a3e4166 Mon Sep 17 00:00:00 2001 From: chris erway Date: Tue, 7 Sep 2021 15:22:54 -0400 Subject: [PATCH 39/49] Add PartitionTest call to some tests that were not partitioned spotted by #2749 --- agreement/agreementtest/simulate_test.go | 3 +++ daemon/algod/api/server/lib/middlewares/auth_test.go | 3 +++ data/transactions/logic/doc_test.go | 2 ++ data/transactions/logic/eval_test.go | 5 +++++ network/wsNetwork_test.go | 1 + 5 files changed, 14 insertions(+) diff --git a/agreement/agreementtest/simulate_test.go b/agreement/agreementtest/simulate_test.go index c4ccb69b15..086349b82d 100644 --- a/agreement/agreementtest/simulate_test.go +++ b/agreement/agreementtest/simulate_test.go @@ -37,6 +37,7 @@ import ( "github.com/algorand/go-algorand/data/committee" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/db" ) @@ -294,6 +295,8 @@ func (l *testLedger) EnsureDigest(c agreement.Certificate, verifier *agreement.A } func TestSimulate(t *testing.T) { + partitiontest.PartitionTest(t) + f, _ := os.Create(t.Name() + ".log") logging.Base().SetJSONFormatter() logging.Base().SetOutput(f) diff --git a/daemon/algod/api/server/lib/middlewares/auth_test.go b/daemon/algod/api/server/lib/middlewares/auth_test.go index 544875f37b..b0dd0fe260 100644 --- a/daemon/algod/api/server/lib/middlewares/auth_test.go +++ b/daemon/algod/api/server/lib/middlewares/auth_test.go @@ -21,6 +21,7 @@ import ( "net/http" "testing" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/labstack/echo/v4" "github.com/stretchr/testify/require" ) @@ -36,6 +37,8 @@ func success(ctx echo.Context) error { } func TestAuth(t *testing.T) { + partitiontest.PartitionTest(t) + tokens := []string{"token1", "token2"} tests := []struct { diff --git a/data/transactions/logic/doc_test.go b/data/transactions/logic/doc_test.go index ad87f4a010..6f9bf329c4 100644 --- a/data/transactions/logic/doc_test.go +++ b/data/transactions/logic/doc_test.go @@ -96,6 +96,8 @@ func TestOpImmediateNote(t *testing.T) { } func TestAllImmediatesDocumented(t *testing.T) { + partitiontest.PartitionTest(t) + for _, op := range OpSpecs { count := len(op.Details.Immediates) note := OpImmediateNote(op.Name) diff --git a/data/transactions/logic/eval_test.go b/data/transactions/logic/eval_test.go index c6330032c2..bf15f3f415 100644 --- a/data/transactions/logic/eval_test.go +++ b/data/transactions/logic/eval_test.go @@ -2140,6 +2140,7 @@ len`, 2) } func TestExtractOp(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, "byte 0x123456789abc; extract 1 2; byte 0x3456; ==", 5) testAccepts(t, "byte 0x123456789abc; extract 0 6; byte 0x123456789abc; ==", 5) @@ -2156,6 +2157,7 @@ func TestExtractOp(t *testing.T) { } func TestExtractFlop(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() // fails in compiler testProg(t, `byte 0xf000000000000000 @@ -4355,6 +4357,7 @@ func TestBytes(t *testing.T) { } func TestMethod(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() // Although 'method' is new around the time of v5, it is a // pseudo-op, so it's ok to use it earlier, as it compiles to @@ -4391,6 +4394,7 @@ func TestDig(t *testing.T) { } func TestCover(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, "int 4; int 3; int 2; int 1; cover 0; int 1; ==; return", 5) testAccepts(t, "int 4; int 3; int 2; int 1; cover 1; int 2; ==; return", 5) @@ -4401,6 +4405,7 @@ func TestCover(t *testing.T) { } func TestUncover(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() testAccepts(t, "int 4; int 3; int 2; int 1; uncover 0; int 1; ==; return", 5) testAccepts(t, "int 4; int 3; int 2; int 1; uncover 2; int 3; ==; return", 5) diff --git a/network/wsNetwork_test.go b/network/wsNetwork_test.go index e19d20a848..d1d719b362 100644 --- a/network/wsNetwork_test.go +++ b/network/wsNetwork_test.go @@ -2053,6 +2053,7 @@ type urlCase struct { } func TestParseHostOrURL(t *testing.T) { + partitiontest.PartitionTest(t) urlTestCases := []urlCase{ {"localhost:123", url.URL{Scheme: "http", Host: "localhost:123"}}, {"http://localhost:123", url.URL{Scheme: "http", Host: "localhost:123"}}, From 04ed1bc97cfe0ccd0a77ce1bafccd6e320f06b27 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Tue, 7 Sep 2021 16:37:43 -0400 Subject: [PATCH 40/49] Switching to nightly tests for testing only --- .circleci/config.yml | 48 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a5d9637eb7..fc46fb381c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,7 +16,7 @@ workflows: - amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - amd64_test_nightly: @@ -24,7 +24,7 @@ workflows: - amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -33,7 +33,7 @@ workflows: - amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - amd64_integration_nightly: @@ -41,7 +41,7 @@ workflows: - amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -50,7 +50,7 @@ workflows: - amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - amd64_e2e_subs_nightly: @@ -58,7 +58,7 @@ workflows: - amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -67,7 +67,7 @@ workflows: - amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - amd64_e2e_expect_nightly: @@ -75,7 +75,7 @@ workflows: - amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -85,7 +85,7 @@ workflows: - arm64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - arm64_test_nightly: @@ -93,7 +93,7 @@ workflows: - arm64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -102,7 +102,7 @@ workflows: - arm64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - arm64_integration_nightly: @@ -110,7 +110,7 @@ workflows: - arm64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -119,7 +119,7 @@ workflows: - arm64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - arm64_e2e_subs_nightly: @@ -127,7 +127,7 @@ workflows: - arm64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -136,7 +136,7 @@ workflows: - arm64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - arm64_e2e_expect_nightly: @@ -144,7 +144,7 @@ workflows: - arm64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -154,7 +154,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_test_nightly: @@ -162,7 +162,7 @@ workflows: - mac_amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -171,7 +171,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_integration_nightly: @@ -179,7 +179,7 @@ workflows: - mac_amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -188,7 +188,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_e2e_subs_nightly: @@ -196,7 +196,7 @@ workflows: - mac_amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -205,7 +205,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_e2e_expect_nightly: @@ -213,7 +213,7 @@ workflows: - mac_amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets From 87e0cbad2102d5ecc80e5ff75b7bc6612328d1a1 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Tue, 7 Sep 2021 17:28:12 -0400 Subject: [PATCH 41/49] Fixing expect tests to have partition --- test/e2e-go/cli/algod/expect/algod_expect_test.go | 2 ++ test/e2e-go/cli/algoh/expect/algoh_expect_test.go | 2 ++ test/e2e-go/cli/goal/expect/goal_expect_test.go | 2 ++ test/e2e-go/cli/tealdbg/expect/tealdbg_expect_test.go | 2 ++ 4 files changed, 8 insertions(+) diff --git a/test/e2e-go/cli/algod/expect/algod_expect_test.go b/test/e2e-go/cli/algod/expect/algod_expect_test.go index d7201b3f18..a5793200ab 100644 --- a/test/e2e-go/cli/algod/expect/algod_expect_test.go +++ b/test/e2e-go/cli/algod/expect/algod_expect_test.go @@ -19,10 +19,12 @@ import ( "testing" "github.com/algorand/go-algorand/test/framework/fixtures" + "github.com/algorand/go-algorand/test/partitiontest" ) // TestAlgodWithExpect Process all expect script files with suffix Test.exp within the test/e2e-go/cli/algod/expect directory func TestAlgodWithExpect(t *testing.T) { + partitiontest.PartitionTest(t) et := fixtures.MakeExpectTest(t) et.Run() } diff --git a/test/e2e-go/cli/algoh/expect/algoh_expect_test.go b/test/e2e-go/cli/algoh/expect/algoh_expect_test.go index 682183c495..e30b1ef1ca 100644 --- a/test/e2e-go/cli/algoh/expect/algoh_expect_test.go +++ b/test/e2e-go/cli/algoh/expect/algoh_expect_test.go @@ -19,10 +19,12 @@ import ( "testing" "github.com/algorand/go-algorand/test/framework/fixtures" + "github.com/algorand/go-algorand/test/partitiontest" ) // TestAlgohWithExpect Process all expect script files with suffix Test.exp within the test/e2e-go/cli/algoh/expect directory func TestAlgohWithExpect(t *testing.T) { + partitiontest.PartitionTest(t) et := fixtures.MakeExpectTest(t) et.Run() } diff --git a/test/e2e-go/cli/goal/expect/goal_expect_test.go b/test/e2e-go/cli/goal/expect/goal_expect_test.go index ce22987f07..8a49bebc22 100644 --- a/test/e2e-go/cli/goal/expect/goal_expect_test.go +++ b/test/e2e-go/cli/goal/expect/goal_expect_test.go @@ -20,10 +20,12 @@ import ( "testing" "github.com/algorand/go-algorand/test/framework/fixtures" + "github.com/algorand/go-algorand/test/partitiontest" ) // TestGoalWithExpect Process all expect script files with suffix Test.exp within the test/e2e-go/cli/goal/expect directory func TestGoalWithExpect(t *testing.T) { + partitiontest.PartitionTest(t) et := fixtures.MakeExpectTest(t) et.Run() } diff --git a/test/e2e-go/cli/tealdbg/expect/tealdbg_expect_test.go b/test/e2e-go/cli/tealdbg/expect/tealdbg_expect_test.go index 633e8f133e..451bc43a21 100644 --- a/test/e2e-go/cli/tealdbg/expect/tealdbg_expect_test.go +++ b/test/e2e-go/cli/tealdbg/expect/tealdbg_expect_test.go @@ -19,10 +19,12 @@ import ( "testing" "github.com/algorand/go-algorand/test/framework/fixtures" + "github.com/algorand/go-algorand/test/partitiontest" ) // TestTealdbgWithExpect processes all expect script files with suffix Test.exp within the test/e2e-go/cli/tealdbg/expect directory func TestTealdbgWithExpect(t *testing.T) { + partitiontest.PartitionTest(t) et := fixtures.MakeExpectTest(t) et.Run() } From 017a5ae6c9eb9a43d45ebd9f71f7d834fe286f68 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Tue, 7 Sep 2021 18:55:36 -0400 Subject: [PATCH 42/49] Paritioning unpartitioned multiple run tests --- agreement/fuzzer/tests_test.go | 5 +++++ cmd/algofix/deadlock_test.go | 2 ++ cmd/algofix/main_test.go | 3 +++ cmd/algoh/blockWatcher_test.go | 7 ++++++- cmd/algoh/blockstats_test.go | 4 +++- cmd/catchupsrv/download_test.go | 7 ++++++- cmd/goal/commands_test.go | 2 ++ cmd/goal/formatting_test.go | 2 ++ cmd/goal/inspect_test.go | 2 ++ cmd/tealdbg/cdtSession_test.go | 10 ++++++++++ cmd/tealdbg/cdtdbg_test.go | 4 ++++ cmd/tealdbg/debugger_test.go | 3 +++ cmd/tealdbg/localLedger_test.go | 2 ++ cmd/tealdbg/local_test.go | 11 +++++++++++ cmd/tealdbg/remote_test.go | 2 ++ cmd/tealdbg/server_test.go | 3 +++ cmd/tealdbg/util_test.go | 2 ++ cmd/tealdbg/webdbg_test.go | 2 ++ cmd/updater/version_test.go | 2 ++ crypto/curve25519_test.go | 7 +++++++ crypto/encoding_test.go | 3 +++ crypto/onetimesig_test.go | 3 +++ crypto/util_test.go | 3 +++ crypto/vrf_test.go | 3 +++ daemon/algod/api/server/router_test.go | 1 + .../api/server/v1/handlers/handlers_test.go | 1 + daemon/algod/api/server/v2/account_test.go | 2 ++ daemon/algod/api/server/v2/dryrun_test.go | 14 ++++++++++++++ .../algod/api/server/v2/test/handlers_test.go | 17 +++++++++++++++++ data/committee/sortition/sortition_test.go | 2 ++ data/transactions/logic/assembler_test.go | 9 +++++++++ data/transactions/logic/evalStateful_test.go | 1 + data/transactions/logic/fields_test.go | 1 + debug/logfilter/main_test.go | 2 ++ gen/generate_test.go | 2 ++ ledger/persistedaccts_list_test.go | 9 ++++++++- ledger/txtail_test.go | 1 + libgoal/libgoal_test.go | 2 ++ logging/cyclicWriter_test.go | 2 ++ logging/logBuffer_test.go | 7 +++++++ logging/log_test.go | 5 +++++ logging/telemetryConfig_test.go | 8 +++++++- logging/telemetry_test.go | 11 +++++++++++ logging/telemetryhook_test.go | 8 ++++++++ logging/telemetryspec/metric_test.go | 2 ++ util/condvar/timedwait_test.go | 4 ++++ 46 files changed, 200 insertions(+), 5 deletions(-) diff --git a/agreement/fuzzer/tests_test.go b/agreement/fuzzer/tests_test.go index f05852e39a..b409cd885a 100644 --- a/agreement/fuzzer/tests_test.go +++ b/agreement/fuzzer/tests_test.go @@ -25,6 +25,7 @@ import ( "math" "math/rand" "os" + //ossignal "os/signal" "path/filepath" //"runtime/pprof" @@ -36,6 +37,7 @@ import ( "github.com/algorand/go-algorand/logging" "github.com/algorand/go-deadlock" + //"github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" ) @@ -105,6 +107,7 @@ func testConfig(t *testing.T, config NetworkConfig) (network *Network) { */ func TestCircularNetworkTopology(t *testing.T) { + partitiontest.PartitionTest(t) var nodeCounts []int if testing.Short() { nodeCounts = []int{4, 6} @@ -422,6 +425,7 @@ type FuzzerTestFile struct { } func TestFuzzer(t *testing.T) { + partitiontest.PartitionTest(t) jsonFiles := make(map[string]string) // map json test to full json file name. err := filepath.Walk(".", func(path string, info os.FileInfo, err error) error { if strings.HasSuffix(info.Name(), ".json") { @@ -475,6 +479,7 @@ func TestFuzzer(t *testing.T) { } func TestNetworkBandwidth(t *testing.T) { + partitiontest.PartitionTest(t) // travis rans out of memory when we get a high nodes count.. so we'll skip it for now. if testing.Short() { t.Skip() diff --git a/cmd/algofix/deadlock_test.go b/cmd/algofix/deadlock_test.go index f1f3aa1b04..2c21115850 100644 --- a/cmd/algofix/deadlock_test.go +++ b/cmd/algofix/deadlock_test.go @@ -25,6 +25,7 @@ import ( "strings" "testing" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) @@ -130,6 +131,7 @@ func main() { ` func TestDeadlockRewrite(t *testing.T) { + partitiontest.PartitionTest(t) t.Run("simple", func(t *testing.T) { testDeadlock(t, deadlockSimpleSrc, deadlockSimpleDest) }) t.Run("onoff", func(t *testing.T) { testDeadlock(t, deadlockTestSrc, deadlockTestFin) }) } diff --git a/cmd/algofix/main_test.go b/cmd/algofix/main_test.go index c2ace28caa..fad46ca7cc 100644 --- a/cmd/algofix/main_test.go +++ b/cmd/algofix/main_test.go @@ -9,6 +9,8 @@ import ( "go/parser" "strings" "testing" + + "github.com/algorand/go-algorand/test/partitiontest" ) type testCase struct { @@ -73,6 +75,7 @@ func parseFixPrint(t *testing.T, fn func(*ast.File) bool, desc, in string, mustB } func TestRewrite(t *testing.T) { + partitiontest.PartitionTest(t) for _, tt := range testCases { // Apply fix: should get tt.Out. out, fixed, ok := parseFixPrint(t, tt.Fn, tt.Name, tt.In, true) diff --git a/cmd/algoh/blockWatcher_test.go b/cmd/algoh/blockWatcher_test.go index 5aeec20640..9dbc33220d 100644 --- a/cmd/algoh/blockWatcher_test.go +++ b/cmd/algoh/blockWatcher_test.go @@ -22,7 +22,7 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/daemon/algod/api/spec/v1" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) @@ -38,6 +38,7 @@ func bw(client Client) *blockWatcher { // When the status continues to report block 300 // Then blockIfStalled will block until the next block is reported func TestBlockIfStalled(t *testing.T) { + partitiontest.PartitionTest(t) client := mockClient{ error: []error{nil, nil, nil}, status: makeNodeStatuses(300, 300, 300, 301), @@ -59,6 +60,7 @@ func TestBlockIfStalled(t *testing.T) { // When the status continues to increase quickly // Then blockIfCatchup will block until a block is reported twice func TestBlockIfCatchup(t *testing.T) { + partitiontest.PartitionTest(t) client := mockClient{ error: []error{nil, nil, nil}, status: makeNodeStatuses(301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 310), @@ -80,6 +82,7 @@ func TestBlockIfCatchup(t *testing.T) { // When the status is not changing quickly // Then blockIfCatchup will return after the first status call. func TestBlockIfCaughtUp(t *testing.T) { + partitiontest.PartitionTest(t) client := mockClient{ error: []error{nil, nil, nil}, status: makeNodeStatuses(300), @@ -111,6 +114,7 @@ func (l *testlistener) onBlock(block v1.Block) { } func TestE2E(t *testing.T) { + partitiontest.PartitionTest(t) client := makeMockClient( []error{nil, nil, nil}, makeNodeStatuses(300, 301, 302, 302, 302, 302, 302, 302, 310, 320, 321, 321, 321, 322), @@ -159,6 +163,7 @@ func TestE2E(t *testing.T) { } func TestAbortDuringStall(t *testing.T) { + partitiontest.PartitionTest(t) client := makeMockClient( []error{}, makeNodeStatuses(300), diff --git a/cmd/algoh/blockstats_test.go b/cmd/algoh/blockstats_test.go index e96fffe6b0..4d8f950dd7 100644 --- a/cmd/algoh/blockstats_test.go +++ b/cmd/algoh/blockstats_test.go @@ -20,8 +20,8 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/daemon/algod/api/spec/v1" "github.com/algorand/go-algorand/logging/telemetryspec" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) @@ -42,6 +42,7 @@ func (mes *MockEventSender) EventWithDetails(category telemetryspec.Category, id } func TestConsecutiveBlocks(t *testing.T) { + partitiontest.PartitionTest(t) sender := MockEventSender{} bs := blockstats{log: &sender} @@ -57,6 +58,7 @@ func TestConsecutiveBlocks(t *testing.T) { } func TestAgreementTime(t *testing.T) { + partitiontest.PartitionTest(t) sleepTime := 50 * time.Millisecond testAttempts := 0 const maxTestAttempts = 10 diff --git a/cmd/catchupsrv/download_test.go b/cmd/catchupsrv/download_test.go index 1a952cebe4..fa65f05fbf 100644 --- a/cmd/catchupsrv/download_test.go +++ b/cmd/catchupsrv/download_test.go @@ -17,11 +17,14 @@ package main import ( - "github.com/stretchr/testify/require" "testing" + + "github.com/algorand/go-algorand/test/partitiontest" + "github.com/stretchr/testify/require" ) func TestBlockToPath(t *testing.T) { + partitiontest.PartitionTest(t) require.Equal(t, "00/00/000000", blockToPath(0)) require.Equal(t, "00/00/0000rs", blockToPath(1000)) require.Equal(t, "05/yc/05ycfo", blockToPath(10000500)) @@ -29,6 +32,7 @@ func TestBlockToPath(t *testing.T) { } func TestBlockToFileName(t *testing.T) { + partitiontest.PartitionTest(t) require.Equal(t, "000000", blockToFileName(0)) require.Equal(t, "0000rs", blockToFileName(1000)) require.Equal(t, "05ycfo", blockToFileName(10000500)) @@ -36,6 +40,7 @@ func TestBlockToFileName(t *testing.T) { } func TestBlockToString(t *testing.T) { + partitiontest.PartitionTest(t) require.Equal(t, "0", blockToString(0)) require.Equal(t, "rs", blockToString(1000)) require.Equal(t, "5ycfo", blockToString(10000500)) diff --git a/cmd/goal/commands_test.go b/cmd/goal/commands_test.go index e997605924..26a621ea2b 100644 --- a/cmd/goal/commands_test.go +++ b/cmd/goal/commands_test.go @@ -20,10 +20,12 @@ import ( "os" "testing" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func TestEnsureDataDirReturnsWhenDataDirIsProvided(t *testing.T) { + partitiontest.PartitionTest(t) expectedDir := "~/.algorand" os.Setenv("ALGORAND_DATA", expectedDir) actualDir := ensureFirstDataDir() diff --git a/cmd/goal/formatting_test.go b/cmd/goal/formatting_test.go index e1fe731dc6..d5f216fd06 100644 --- a/cmd/goal/formatting_test.go +++ b/cmd/goal/formatting_test.go @@ -19,10 +19,12 @@ package main import ( "testing" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func TestUnicodePrintable(t *testing.T) { + partitiontest.PartitionTest(t) testUnicodePrintableStrings := []struct { testString string isPrintable bool diff --git a/cmd/goal/inspect_test.go b/cmd/goal/inspect_test.go index 2068a3a925..564f7611ba 100644 --- a/cmd/goal/inspect_test.go +++ b/cmd/goal/inspect_test.go @@ -25,9 +25,11 @@ import ( "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/protocol" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestInspect(t *testing.T) { + partitiontest.PartitionTest(t) var err error var empty transactions.SignedTxn diff --git a/cmd/tealdbg/cdtSession_test.go b/cmd/tealdbg/cdtSession_test.go index 1eb669126a..8ee0107be1 100644 --- a/cmd/tealdbg/cdtSession_test.go +++ b/cmd/tealdbg/cdtSession_test.go @@ -28,9 +28,11 @@ import ( "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/data/transactions/logic" "github.com/algorand/go-algorand/protocol" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestCdtSessionProto11Common(t *testing.T) { + partitiontest.PartitionTest(t) sid := "test" dbg := MockDebugControl{} ch := make(chan Notification) @@ -94,6 +96,7 @@ func TestCdtSessionProto11Common(t *testing.T) { } func TestCdtSessionProto11Breakpoints(t *testing.T) { + partitiontest.PartitionTest(t) sid := "test" dbg := MockDebugControl{} ch := make(chan Notification) @@ -178,6 +181,7 @@ func TestCdtSessionProto11Breakpoints(t *testing.T) { } func TestCdtSessionProto11Events(t *testing.T) { + partitiontest.PartitionTest(t) sid := "test" dbg := MockDebugControl{} ch := make(chan Notification) @@ -211,6 +215,7 @@ func TestCdtSessionProto11Events(t *testing.T) { } func TestCdtSessionProto11Controls(t *testing.T) { + partitiontest.PartitionTest(t) sid := "test" dbg := MockDebugControl{} ch := make(chan Notification) @@ -254,6 +259,7 @@ func TestCdtSessionProto11Controls(t *testing.T) { } func TestCdtSessionProto11Evaluate(t *testing.T) { + partitiontest.PartitionTest(t) sid := "test" dbg := MockDebugControl{} ch := make(chan Notification) @@ -292,6 +298,7 @@ func TestCdtSessionProto11Evaluate(t *testing.T) { } func TestCdtSessionProto11CallOnFunc(t *testing.T) { + partitiontest.PartitionTest(t) sid := "test" dbg := MockDebugControl{} ch := make(chan Notification) @@ -380,6 +387,7 @@ func TestCdtSessionProto11CallOnFunc(t *testing.T) { } func TestCdtSessionProto11GetProps(t *testing.T) { + partitiontest.PartitionTest(t) sid := "test" dbg := MockDebugControl{} ch := make(chan Notification) @@ -413,6 +421,7 @@ func TestCdtSessionProto11GetProps(t *testing.T) { } func TestCdtSessionStateToEvent(t *testing.T) { + partitiontest.PartitionTest(t) sid := "test" dbg := MockDebugControl{} ch := make(chan Notification) @@ -451,6 +460,7 @@ func TestCdtSessionStateToEvent(t *testing.T) { } func TestCdtSessionGetObjects(t *testing.T) { + partitiontest.PartitionTest(t) sid := "test" dbg := MockDebugControl{} ch := make(chan Notification) diff --git a/cmd/tealdbg/cdtdbg_test.go b/cmd/tealdbg/cdtdbg_test.go index 28c2417c32..fb6b4c0a69 100644 --- a/cmd/tealdbg/cdtdbg_test.go +++ b/cmd/tealdbg/cdtdbg_test.go @@ -29,9 +29,11 @@ import ( "github.com/algorand/go-algorand/cmd/tealdbg/cdt" "github.com/algorand/go-algorand/data/transactions/logic" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestCdtHandlers(t *testing.T) { + partitiontest.PartitionTest(t) params := CdtFrontendParams{ router: mux.NewRouter(), apiAddress: "127.0.0.1:12345", @@ -142,6 +144,7 @@ func (c *MockDebugControl) GetStates(s *logic.DebugState) AppState { } func TestCdtFrontendSessionStarted(t *testing.T) { + partitiontest.PartitionTest(t) params := CdtFrontendParams{ router: mux.NewRouter(), apiAddress: "127.0.0.1:12345", @@ -178,6 +181,7 @@ func TestCdtFrontendSessionStarted(t *testing.T) { } func TestCdtAdapterSessionEnded(t *testing.T) { + partitiontest.PartitionTest(t) params := CdtFrontendParams{ router: mux.NewRouter(), apiAddress: "127.0.0.1:12345", diff --git a/cmd/tealdbg/debugger_test.go b/cmd/tealdbg/debugger_test.go index be517d5b44..d1d815b1a3 100644 --- a/cmd/tealdbg/debugger_test.go +++ b/cmd/tealdbg/debugger_test.go @@ -26,6 +26,7 @@ import ( "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/data/transactions/logic" "github.com/algorand/go-algorand/protocol" + "github.com/algorand/go-algorand/test/partitiontest" ) type testDbgAdapter struct { @@ -91,6 +92,7 @@ func (d *testDbgAdapter) eventLoop() { } func TestDebuggerSimple(t *testing.T) { + partitiontest.PartitionTest(t) proto := config.Consensus[protocol.ConsensusV18] require.Greater(t, proto.LogicSigVersion, uint64(0)) debugger := MakeDebugger() @@ -122,6 +124,7 @@ int 1 } func TestSession(t *testing.T) { + partitiontest.PartitionTest(t) source := fmt.Sprintf("#pragma version %d\nint 1\ndup\n+\n", logic.LogicVersion) ops, err := logic.AssembleStringWithVersion(source, logic.LogicVersion) require.NoError(t, err) diff --git a/cmd/tealdbg/localLedger_test.go b/cmd/tealdbg/localLedger_test.go index ae941723a2..be2ef81898 100644 --- a/cmd/tealdbg/localLedger_test.go +++ b/cmd/tealdbg/localLedger_test.go @@ -26,6 +26,7 @@ import ( "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/data/transactions/logic" "github.com/algorand/go-algorand/protocol" + "github.com/algorand/go-algorand/test/partitiontest" ) // Current implementation uses LegderForCowBase interface to plug into evaluator. @@ -34,6 +35,7 @@ import ( // This test ensures TEAL program sees data provided by LegderForCowBase, and sees all // intermediate changes. func TestBalanceAdapterStateChanges(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) source := `#pragma version 2 diff --git a/cmd/tealdbg/local_test.go b/cmd/tealdbg/local_test.go index 6a844963e5..da4e813069 100644 --- a/cmd/tealdbg/local_test.go +++ b/cmd/tealdbg/local_test.go @@ -31,6 +31,7 @@ import ( "github.com/algorand/go-algorand/data/transactions/logic" "github.com/algorand/go-algorand/ledger/apply" "github.com/algorand/go-algorand/protocol" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) @@ -53,6 +54,7 @@ var txnSample string = `{ ` func TestTxnJSONInput(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) dp := DebugParams{ @@ -73,6 +75,7 @@ func TestTxnJSONInput(t *testing.T) { } func TestTxnMessagePackInput(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) var txn transactions.SignedTxn @@ -232,6 +235,7 @@ func makeSampleSerializedBalanceRecord(addr basics.Address, toJSON bool) []byte } func TestBalanceJSONInput(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) addr, err := basics.UnmarshalChecksumAddress("47YPQTIGQEO7T4Y4RWDYWEKV6RTR2UNBQXBABEEGM72ESWDQNCQ52OPASU") @@ -254,6 +258,7 @@ func TestBalanceJSONInput(t *testing.T) { } func TestBalanceMessagePackInput(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) addr, err := basics.UnmarshalChecksumAddress("47YPQTIGQEO7T4Y4RWDYWEKV6RTR2UNBQXBABEEGM72ESWDQNCQ52OPASU") a.NoError(err) @@ -281,6 +286,7 @@ func TestBalanceMessagePackInput(t *testing.T) { } func TestDebugEnvironment(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) sender, err := basics.UnmarshalChecksumAddress("47YPQTIGQEO7T4Y4RWDYWEKV6RTR2UNBQXBABEEGM72ESWDQNCQ52OPASU") @@ -521,6 +527,7 @@ byte 0x676c6f62616c // global } func TestDebugFromPrograms(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) txnBlob := []byte("[" + strings.Join([]string{string(txnSample), txnSample}, ",") + "]") @@ -599,6 +606,7 @@ func TestDebugFromPrograms(t *testing.T) { } func TestRunMode(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) txnBlob := []byte("[" + strings.Join([]string{string(txnSample), txnSample}, ",") + "]") @@ -685,6 +693,7 @@ func TestRunMode(t *testing.T) { } func TestDebugFromTxn(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) sender, err := basics.UnmarshalChecksumAddress("47YPQTIGQEO7T4Y4RWDYWEKV6RTR2UNBQXBABEEGM72ESWDQNCQ52OPASU") @@ -904,6 +913,7 @@ func checkBalanceAdapter( } func TestLocalBalanceAdapter(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) sender, err := basics.UnmarshalChecksumAddress("47YPQTIGQEO7T4Y4RWDYWEKV6RTR2UNBQXBABEEGM72ESWDQNCQ52OPASU") @@ -964,6 +974,7 @@ func TestLocalBalanceAdapter(t *testing.T) { } func TestLocalBalanceAdapterIndexer(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) sender, err := basics.UnmarshalChecksumAddress("47YPQTIGQEO7T4Y4RWDYWEKV6RTR2UNBQXBABEEGM72ESWDQNCQ52OPASU") diff --git a/cmd/tealdbg/remote_test.go b/cmd/tealdbg/remote_test.go index 863e303692..553bc4c564 100644 --- a/cmd/tealdbg/remote_test.go +++ b/cmd/tealdbg/remote_test.go @@ -28,9 +28,11 @@ import ( "github.com/algorand/go-algorand/data/transactions/logic" "github.com/algorand/go-algorand/protocol" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestRemoteAdapterHandlers(t *testing.T) { + partitiontest.PartitionTest(t) d := MakeDebugger() a := MakeRemoteHook(d) router := mux.NewRouter() diff --git a/cmd/tealdbg/server_test.go b/cmd/tealdbg/server_test.go index aa138b30b3..232c6a6f4c 100644 --- a/cmd/tealdbg/server_test.go +++ b/cmd/tealdbg/server_test.go @@ -23,6 +23,7 @@ import ( "testing" "time" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/gorilla/mux" "github.com/stretchr/testify/require" ) @@ -124,10 +125,12 @@ func serverTestImpl(t *testing.T, run func(t *testing.T, ds *DebugServer) bool, } func TestServerRemote(t *testing.T) { + partitiontest.PartitionTest(t) serverTestImpl(t, tryStartingServerRemote, &DebugParams{}) } func TestServerLocal(t *testing.T) { + partitiontest.PartitionTest(t) txnBlob := []byte("[" + strings.Join([]string{string(txnSample), txnSample}, ",") + "]") dp := DebugParams{ ProgramNames: []string{"test"}, diff --git a/cmd/tealdbg/util_test.go b/cmd/tealdbg/util_test.go index 459bd3a298..8613a398bd 100644 --- a/cmd/tealdbg/util_test.go +++ b/cmd/tealdbg/util_test.go @@ -19,10 +19,12 @@ package main import ( "testing" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func TestVLQ(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) a.Equal("AAAA", MakeSourceMapLine(0, 0, 0, 0)) diff --git a/cmd/tealdbg/webdbg_test.go b/cmd/tealdbg/webdbg_test.go index 76620a82f5..5f340ff6aa 100644 --- a/cmd/tealdbg/webdbg_test.go +++ b/cmd/tealdbg/webdbg_test.go @@ -23,11 +23,13 @@ import ( "net/http/httptest" "testing" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/gorilla/mux" "github.com/stretchr/testify/require" ) func TestWebPageFrontendHandlers(t *testing.T) { + partitiontest.PartitionTest(t) params := WebPageFrontendParams{ router: mux.NewRouter(), apiAddress: "127.0.0.1:12345", diff --git a/cmd/updater/version_test.go b/cmd/updater/version_test.go index 9921161b09..2869461658 100644 --- a/cmd/updater/version_test.go +++ b/cmd/updater/version_test.go @@ -21,10 +21,12 @@ import ( "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/s3" ) func TestGetVersion(t *testing.T) { + partitiontest.PartitionTest(t) testValidVersion(t, "algonode_update_0.1.0.log", uint64(0x00010000)) testValidVersion(t, "algo_update_0.1.0", uint64(0x00010000)) testValidVersion(t, "algo_update_65535.1.0", uint64(0xFFFF00010000)) diff --git a/crypto/curve25519_test.go b/crypto/curve25519_test.go index ea155e0704..7850048618 100644 --- a/crypto/curve25519_test.go +++ b/crypto/curve25519_test.go @@ -19,6 +19,8 @@ package crypto import ( "bytes" "testing" + + "github.com/algorand/go-algorand/test/partitiontest" ) func makeCurve25519Secret() *SignatureSecrets { @@ -28,6 +30,7 @@ func makeCurve25519Secret() *SignatureSecrets { } func TestSignVerifyEmptyMessage(t *testing.T) { + partitiontest.PartitionTest(t) pk, sk := ed25519GenerateKey() sig := ed25519Sign(sk, []byte{}) if !ed25519Verify(pk, []byte{}, sig) { @@ -36,6 +39,7 @@ func TestSignVerifyEmptyMessage(t *testing.T) { } func TestVerifyZeros(t *testing.T) { + partitiontest.PartitionTest(t) var pk SignatureVerifier var sig Signature for x := byte(0); x < 255; x++ { @@ -46,6 +50,7 @@ func TestVerifyZeros(t *testing.T) { } func TestGenerateSignatureSecrets(t *testing.T) { + partitiontest.PartitionTest(t) var s Seed RandBytes(s[:]) ref := GenerateSignatureSecrets(s) @@ -63,10 +68,12 @@ func TestGenerateSignatureSecrets(t *testing.T) { } func TestCurve25519SignVerify(t *testing.T) { + partitiontest.PartitionTest(t) signVerify(t, makeCurve25519Secret(), makeCurve25519Secret()) } func TestVRFProveVerify(t *testing.T) { + partitiontest.PartitionTest(t) proveVerifyVrf(t, GenerateVRFSecrets(), GenerateVRFSecrets()) } diff --git a/crypto/encoding_test.go b/crypto/encoding_test.go index 17e83b71f7..e5df42c9ef 100644 --- a/crypto/encoding_test.go +++ b/crypto/encoding_test.go @@ -18,11 +18,14 @@ package crypto import ( "testing" + + "github.com/algorand/go-algorand/test/partitiontest" // "github.com/stretchr/testify/require" // "github.com/algorand/go-algorand/protocol" ) func TestEmptyEncoding(t *testing.T) { + partitiontest.PartitionTest(t) // TODO systematically add checks for empty encodings // var s SignatureSecrets diff --git a/crypto/onetimesig_test.go b/crypto/onetimesig_test.go index ad9a109e1d..9f1b85f061 100644 --- a/crypto/onetimesig_test.go +++ b/crypto/onetimesig_test.go @@ -18,6 +18,8 @@ package crypto import ( "testing" + + "github.com/algorand/go-algorand/test/partitiontest" ) func randID() OneTimeSignatureIdentifier { @@ -30,6 +32,7 @@ func randID() OneTimeSignatureIdentifier { } func TestOneTimeSignVerifyNewStyle(t *testing.T) { + partitiontest.PartitionTest(t) c := GenerateOneTimeSignatureSecrets(0, 1000) c2 := GenerateOneTimeSignatureSecrets(0, 1000) testOneTimeSignVerifyNewStyle(t, c, c2) diff --git a/crypto/util_test.go b/crypto/util_test.go index 3cdba9e9c4..0488dcadbe 100644 --- a/crypto/util_test.go +++ b/crypto/util_test.go @@ -19,10 +19,12 @@ package crypto import ( "testing" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func TestEncodeDecode(t *testing.T) { + partitiontest.PartitionTest(t) toBeHashed := []byte("this is a test") hashed := Hash(toBeHashed) hashedStr := hashed.String() @@ -33,6 +35,7 @@ func TestEncodeDecode(t *testing.T) { } func TestDigest_IsZero(t *testing.T) { + partitiontest.PartitionTest(t) d := Digest{} require.True(t, d.IsZero()) require.Zero(t, d) diff --git a/crypto/vrf_test.go b/crypto/vrf_test.go index dc91653e7e..42e8dc7cc3 100644 --- a/crypto/vrf_test.go +++ b/crypto/vrf_test.go @@ -20,6 +20,8 @@ import ( "crypto/rand" "encoding/hex" "testing" + + "github.com/algorand/go-algorand/test/partitiontest" ) func mustDecode(t *testing.T, out []byte, hexIn string) { @@ -72,6 +74,7 @@ func testVector(t *testing.T, skHex, pkHex, alphaHex, piHex, betaHex string) { // ECVRF-ED25519-SHA512-Elligator2 test vectors from: https://www.ietf.org/id/draft-irtf-cfrg-vrf-03.txt appendix A.4 func TestVRFTestVectors(t *testing.T) { + partitiontest.PartitionTest(t) testVector(t, "9d61b19deffd5a60ba844af492ec2cc44449c5697b326919703bac031cae7f60", //sk "d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a", //pk diff --git a/daemon/algod/api/server/router_test.go b/daemon/algod/api/server/router_test.go index 3c0d8295af..5f5edf666d 100644 --- a/daemon/algod/api/server/router_test.go +++ b/daemon/algod/api/server/router_test.go @@ -190,5 +190,6 @@ func (s *TestSuite) TestGetTransactionByID() { assert.Equal(s.T(), callsBefore+1, s.calls) } func TestTestSuite(t *testing.T) { + partitiontest.PartitionTest(t) suite.Run(t, new(TestSuite)) } diff --git a/daemon/algod/api/server/v1/handlers/handlers_test.go b/daemon/algod/api/server/v1/handlers/handlers_test.go index 861d1767d4..48a4fec47a 100644 --- a/daemon/algod/api/server/v1/handlers/handlers_test.go +++ b/daemon/algod/api/server/v1/handlers/handlers_test.go @@ -29,6 +29,7 @@ import ( ) func TestDecorateUnknownTransactionTypeError(t *testing.T) { + partitiontest.PartitionTest(t) type TestCase struct { err error txn node.TxnWithStatus diff --git a/daemon/algod/api/server/v2/account_test.go b/daemon/algod/api/server/v2/account_test.go index f9bc836fb0..f7dd96d807 100644 --- a/daemon/algod/api/server/v2/account_test.go +++ b/daemon/algod/api/server/v2/account_test.go @@ -26,9 +26,11 @@ import ( "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/protocol" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestAccount(t *testing.T) { + partitiontest.PartitionTest(t) proto := config.Consensus[protocol.ConsensusFuture] appIdx1 := basics.AppIndex(1) appIdx2 := basics.AppIndex(2) diff --git a/daemon/algod/api/server/v2/dryrun_test.go b/daemon/algod/api/server/v2/dryrun_test.go index 6bcf2c9051..1073feb4e8 100644 --- a/daemon/algod/api/server/v2/dryrun_test.go +++ b/daemon/algod/api/server/v2/dryrun_test.go @@ -131,6 +131,7 @@ var dryrunProtoVersion protocol.ConsensusVersion = protocol.ConsensusFuture var dryrunMakeLedgerProto protocol.ConsensusVersion = "dryrunMakeLedgerProto" func TestDryrunLogicSig(t *testing.T) { + partitiontest.PartitionTest(t) // {"txns":[{"lsig":{"l":"AiABASI="},"txn":{}}]} t.Parallel() @@ -155,6 +156,7 @@ func TestDryrunLogicSig(t *testing.T) { } func TestDryrunLogicSigSource(t *testing.T) { + partitiontest.PartitionTest(t) // {"txns":[{"lsig":{"l":"AiABASI="},"txn":{}}]} t.Parallel() @@ -386,6 +388,7 @@ func checkAppCallPass(t *testing.T, response *generated.DryrunResponse) { } func TestDryrunGlobal1(t *testing.T) { + partitiontest.PartitionTest(t) // {"txns":[{"lsig":{"l":"AiABASI="},"txn":{}}]} t.Parallel() @@ -434,6 +437,7 @@ func TestDryrunGlobal1(t *testing.T) { } func TestDryrunGlobal2(t *testing.T) { + partitiontest.PartitionTest(t) // {"txns":[{"lsig":{"l":"AiABASI="},"txn":{}}]} t.Parallel() @@ -486,6 +490,7 @@ func TestDryrunGlobal2(t *testing.T) { } func TestDryrunLocal1(t *testing.T) { + partitiontest.PartitionTest(t) // {"txns":[{"lsig":{"l":"AiABASI="},"txn":{}}]} t.Parallel() @@ -559,6 +564,7 @@ func TestDryrunLocal1(t *testing.T) { } func TestDryrunLocal1A(t *testing.T) { + partitiontest.PartitionTest(t) // {"txns":[{"lsig":{"l":"AiABASI="},"txn":{}}]} t.Parallel() @@ -639,6 +645,7 @@ func TestDryrunLocal1A(t *testing.T) { } func TestDryrunLocalCheck(t *testing.T) { + partitiontest.PartitionTest(t) // {"txns":[{"lsig":{"l":"AiABASI="},"txn":{}}]} t.Parallel() var dr DryrunRequest @@ -693,6 +700,7 @@ func TestDryrunLocalCheck(t *testing.T) { } func TestDryrunMultipleTxns(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() var dr DryrunRequest @@ -740,6 +748,7 @@ func TestDryrunMultipleTxns(t *testing.T) { } func TestDryrunEncodeDecode(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() var gdr generated.DryrunRequest @@ -844,6 +853,7 @@ func TestDryrunEncodeDecode(t *testing.T) { } func TestDryrunMakeLedger(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() var dr DryrunRequest @@ -956,6 +966,7 @@ var dataJSON = []byte(`{ }`) func TestDryrunRequestJSON(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() var gdr generated.DryrunRequest @@ -982,6 +993,7 @@ func TestDryrunRequestJSON(t *testing.T) { } func TestStateDeltaToStateDelta(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() sd := basics.StateDelta{ "byteskey": { @@ -1032,6 +1044,7 @@ func randomAddress() basics.Address { } func TestDryrunOptIn(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() ops, err := logic.AssembleString(`#pragma version 2 @@ -1095,6 +1108,7 @@ int 1`) } func TestDryrunLogs(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() ops, err := logic.AssembleString(` diff --git a/daemon/algod/api/server/v2/test/handlers_test.go b/daemon/algod/api/server/v2/test/handlers_test.go index b5930e28a0..5d5c465dad 100644 --- a/daemon/algod/api/server/v2/test/handlers_test.go +++ b/daemon/algod/api/server/v2/test/handlers_test.go @@ -41,6 +41,7 @@ import ( "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/node" "github.com/algorand/go-algorand/protocol" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/execpool" ) @@ -64,6 +65,7 @@ func setupTestForMethodGet(t *testing.T) (v2.Handlers, echo.Context, *httptest.R } func TestSimpleMockBuilding(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() handler, _, _, _, _, releasefunc := setupTestForMethodGet(t) @@ -87,6 +89,7 @@ func accountInformationTest(t *testing.T, address string, expectedCode int) { } func TestAccountInformation(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() accountInformationTest(t, poolAddr.String(), 200) @@ -102,6 +105,7 @@ func getBlockTest(t *testing.T, blockNum uint64, format string, expectedCode int } func TestGetBlock(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() getBlockTest(t, 0, "json", 200) @@ -111,6 +115,7 @@ func TestGetBlock(t *testing.T) { } func TestGetBlockJsonEncoding(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() handler, c, rec, _, _, releasefunc := setupTestForMethodGet(t) @@ -206,6 +211,7 @@ func TestGetBlockJsonEncoding(t *testing.T) { } func TestGetSupply(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() handler, c, _, _, _, releasefunc := setupTestForMethodGet(t) @@ -215,6 +221,7 @@ func TestGetSupply(t *testing.T) { } func TestGetStatus(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() handler, c, rec, _, _, releasefunc := setupTestForMethodGet(t) @@ -246,6 +253,7 @@ func TestGetStatus(t *testing.T) { } func TestGetStatusAfterBlock(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() handler, c, rec, _, _, releasefunc := setupTestForMethodGet(t) @@ -258,6 +266,7 @@ func TestGetStatusAfterBlock(t *testing.T) { } func TestGetTransactionParams(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() handler, c, rec, _, _, releasefunc := setupTestForMethodGet(t) @@ -281,6 +290,7 @@ func pendingTransactionInformationTest(t *testing.T, txidToUse int, format strin } func TestPendingTransactionInformation(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() pendingTransactionInformationTest(t, 0, "json", 200) @@ -317,6 +327,7 @@ func getPendingTransactionsTest(t *testing.T, format string, max uint64, expecte } func TestPendingTransactions(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() getPendingTransactionsTest(t, "json", 0, 200) @@ -344,6 +355,7 @@ func pendingTransactionsByAddressTest(t *testing.T, rootkeyToUse int, format str } func TestPendingTransactionsByAddress(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() pendingTransactionsByAddressTest(t, 0, "json", 200) @@ -381,6 +393,7 @@ func postTransactionTest(t *testing.T, txnToUse, expectedCode int) { } func TestPostTransaction(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() postTransactionTest(t, -1, 400) @@ -410,6 +423,7 @@ func startCatchupTest(t *testing.T, catchpoint string, nodeError error, expected } func TestStartCatchup(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() goodCatchPoint := "5894690#DVFRZUYHEFKRLK5N6DNJRR4IABEVN2D6H76F3ZSEPIE6MKXMQWQA" @@ -450,6 +464,7 @@ func abortCatchupTest(t *testing.T, catchpoint string, expectedCode int) { } func TestAbortCatchup(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() goodCatchPoint := "5894690#DVFRZUYHEFKRLK5N6DNJRR4IABEVN2D6H76F3ZSEPIE6MKXMQWQA" @@ -482,6 +497,7 @@ func tealCompileTest(t *testing.T, bytesToUse []byte, expectedCode int, enableDe } func TestTealCompile(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() tealCompileTest(t, nil, 200, true) // nil program should work @@ -543,6 +559,7 @@ func tealDryrunTest( } func TestTealDryrun(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() var gdr generated.DryrunRequest diff --git a/data/committee/sortition/sortition_test.go b/data/committee/sortition/sortition_test.go index 2d19bd746b..ac3eae0191 100644 --- a/data/committee/sortition/sortition_test.go +++ b/data/committee/sortition/sortition_test.go @@ -21,6 +21,7 @@ import ( "testing" "github.com/algorand/go-algorand/crypto" + "github.com/algorand/go-algorand/test/partitiontest" ) func BenchmarkSortition(b *testing.B) { @@ -36,6 +37,7 @@ func BenchmarkSortition(b *testing.B) { } func TestSortitionBasic(t *testing.T) { + partitiontest.PartitionTest(t) hitcount := uint64(0) const N = 1000 const expectedSize = 20 diff --git a/data/transactions/logic/assembler_test.go b/data/transactions/logic/assembler_test.go index 46bc84ba6f..6f7525c033 100644 --- a/data/transactions/logic/assembler_test.go +++ b/data/transactions/logic/assembler_test.go @@ -1397,6 +1397,7 @@ func TestConstantDisassembly(t *testing.T) { } func TestConstantArgs(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() for v := uint64(1); v <= AssemblerMaxVersion; v++ { testProg(t, "int", v, expect{1, "int needs one argument"}) @@ -2142,6 +2143,7 @@ flip: // [x] } func TestSwapTypeCheck(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() /* reconfirm that we detect this type error */ testProg(t, "int 1; byte 0x1234; +", AssemblerMaxVersion, expect{3, "+ arg 1..."}) @@ -2151,6 +2153,7 @@ func TestSwapTypeCheck(t *testing.T) { } func TestDigAsm(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() testProg(t, "int 1; dig; +", AssemblerMaxVersion, expect{2, "dig expects 1 immediate..."}) testProg(t, "int 1; dig junk; +", AssemblerMaxVersion, expect{2, "...invalid syntax..."}) @@ -2170,6 +2173,7 @@ func TestDigAsm(t *testing.T) { } func TestEqualsTypeCheck(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() testProg(t, "int 1; byte 0x1234; ==", AssemblerMaxVersion, expect{3, "== arg 0..."}) testProg(t, "int 1; byte 0x1234; !=", AssemblerMaxVersion, expect{3, "!= arg 0..."}) @@ -2178,6 +2182,7 @@ func TestEqualsTypeCheck(t *testing.T) { } func TestDupTypeCheck(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() testProg(t, "byte 0x1234; dup; int 1; +", AssemblerMaxVersion, expect{4, "+ arg 0..."}) testProg(t, "byte 0x1234; int 1; dup; +", AssemblerMaxVersion) @@ -2192,18 +2197,21 @@ func TestDupTypeCheck(t *testing.T) { } func TestSelectTypeCheck(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() testProg(t, "int 1; int 2; int 3; select; len", AssemblerMaxVersion, expect{5, "len arg 0..."}) testProg(t, "byte 0x1234; byte 0x5678; int 3; select; !", AssemblerMaxVersion, expect{5, "! arg 0..."}) } func TestSetBitTypeCheck(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() testProg(t, "int 1; int 2; int 3; setbit; len", AssemblerMaxVersion, expect{5, "len arg 0..."}) testProg(t, "byte 0x1234; int 2; int 3; setbit; !", AssemblerMaxVersion, expect{5, "! arg 0..."}) } func TestCoverAsm(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() testProg(t, `int 4; byte "john"; int 5; cover 2; pop; +`, AssemblerMaxVersion) testProg(t, `int 4; byte "ayush"; int 5; cover 1; pop; +`, AssemblerMaxVersion) @@ -2212,6 +2220,7 @@ func TestCoverAsm(t *testing.T) { } func TestUncoverAsm(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() testProg(t, `int 4; byte "john"; int 5; uncover 2; +`, AssemblerMaxVersion) testProg(t, `int 4; byte "ayush"; int 5; uncover 1; pop; +`, AssemblerMaxVersion) diff --git a/data/transactions/logic/evalStateful_test.go b/data/transactions/logic/evalStateful_test.go index f782fcce9a..e9f4ac1c7b 100644 --- a/data/transactions/logic/evalStateful_test.go +++ b/data/transactions/logic/evalStateful_test.go @@ -1490,6 +1490,7 @@ intc_1 } func TestAppParams(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() ep, ledger := makeSampleEnv() ledger.newAccount(ep.Txn.Txn.Sender, 1) diff --git a/data/transactions/logic/fields_test.go b/data/transactions/logic/fields_test.go index e88f3820f6..5e16894aaa 100644 --- a/data/transactions/logic/fields_test.go +++ b/data/transactions/logic/fields_test.go @@ -27,6 +27,7 @@ import ( ) func TestArrayFields(t *testing.T) { + partitiontest.PartitionTest(t) require.Equal(t, len(TxnaFieldNames), len(TxnaFieldTypes)) require.Equal(t, len(txnaFieldSpecByField), len(TxnaFieldTypes)) } diff --git a/debug/logfilter/main_test.go b/debug/logfilter/main_test.go index 963e28c348..a680073744 100644 --- a/debug/logfilter/main_test.go +++ b/debug/logfilter/main_test.go @@ -25,10 +25,12 @@ import ( "strings" "testing" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func TestLogFilterExamples(t *testing.T) { + partitiontest.PartitionTest(t) // iterate on all the example files in the local directory. exampleFiles := []string{} filepath.Walk(".", func(path string, info os.FileInfo, err error) error { diff --git a/gen/generate_test.go b/gen/generate_test.go index c8a6656d80..8b1c90e437 100644 --- a/gen/generate_test.go +++ b/gen/generate_test.go @@ -30,6 +30,7 @@ import ( "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/util/db" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) @@ -105,6 +106,7 @@ func TestLoadSingleRootKeyConcurrent(t *testing.T) { } func TestGenesisRoundoff(t *testing.T) { + partitiontest.PartitionTest(t) verbosity := strings.Builder{} genesisData := DefaultGenesis genesisData.NetworkName = "wat" diff --git a/ledger/persistedaccts_list_test.go b/ledger/persistedaccts_list_test.go index 14860d27d2..95b8b026dd 100644 --- a/ledger/persistedaccts_list_test.go +++ b/ledger/persistedaccts_list_test.go @@ -17,8 +17,10 @@ package ledger import ( - "github.com/algorand/go-algorand/data/basics" "testing" + + "github.com/algorand/go-algorand/data/basics" + "github.com/algorand/go-algorand/test/partitiontest" ) func checkLen(list *persistedAccountDataList) int { @@ -36,6 +38,7 @@ func countListSize(head *persistedAccountDataListNode) (counter int) { } func TestRemoveFromList(t *testing.T) { + partitiontest.PartitionTest(t) l := newPersistedAccountList() e1 := l.pushFront(&persistedAccountData{addr: basics.Address{1}}) e2 := l.pushFront(&persistedAccountData{addr: basics.Address{2}}) @@ -49,6 +52,7 @@ func TestRemoveFromList(t *testing.T) { } func TestAddingNewNodeWithAllocatedFreeList(t *testing.T) { + partitiontest.PartitionTest(t) l := newPersistedAccountList().allocateFreeNodes(10) checkListPointers(t, l, []*persistedAccountDataListNode{}) if countListSize(l.freeList) != 10 { @@ -122,6 +126,7 @@ func pointerInspection(t *testing.T, es []*persistedAccountDataListNode, root *p } func TestMultielementListPositioning(t *testing.T) { + partitiontest.PartitionTest(t) l := newPersistedAccountList() checkListPointers(t, l, []*persistedAccountDataListNode{}) // test elements @@ -180,6 +185,7 @@ func TestMultielementListPositioning(t *testing.T) { } func TestSingleElementListPositioning(t *testing.T) { + partitiontest.PartitionTest(t) l := newPersistedAccountList() checkListPointers(t, l, []*persistedAccountDataListNode{}) e := l.pushFront(&persistedAccountData{addr: basics.Address{1}}) @@ -191,6 +197,7 @@ func TestSingleElementListPositioning(t *testing.T) { } func TestRemovedNodeShouldBeMovedToFreeList(t *testing.T) { + partitiontest.PartitionTest(t) l := newPersistedAccountList() e1 := l.pushFront(&persistedAccountData{addr: basics.Address{1}}) e2 := l.pushFront(&persistedAccountData{addr: basics.Address{2}}) diff --git a/ledger/txtail_test.go b/ledger/txtail_test.go index 97d5a5cbba..9d5d1c2bf9 100644 --- a/ledger/txtail_test.go +++ b/ledger/txtail_test.go @@ -147,6 +147,7 @@ func makeTxTailTestTransaction(r basics.Round, txnIdx int) (txn transactions.Sig } func TestTxTailLoadFromDisk(t *testing.T) { + partitiontest.PartitionTest(t) var ledger txTailTestLedger txtail := txTail{} diff --git a/libgoal/libgoal_test.go b/libgoal/libgoal_test.go index 53274e0db5..5d0959fbeb 100644 --- a/libgoal/libgoal_test.go +++ b/libgoal/libgoal_test.go @@ -19,10 +19,12 @@ package libgoal import ( "testing" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func TestValidRounds(t *testing.T) { + partitiontest.PartitionTest(t) t.Parallel() a := require.New(t) diff --git a/logging/cyclicWriter_test.go b/logging/cyclicWriter_test.go index 9a33d5337f..e3ea895304 100644 --- a/logging/cyclicWriter_test.go +++ b/logging/cyclicWriter_test.go @@ -21,10 +21,12 @@ import ( "os" "testing" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func TestCyclicWrite(t *testing.T) { + partitiontest.PartitionTest(t) liveFileName := "live.test" archiveFileName := "archive.test" defer os.Remove(liveFileName) diff --git a/logging/logBuffer_test.go b/logging/logBuffer_test.go index 6a9b8fe840..9c0fba8b9a 100644 --- a/logging/logBuffer_test.go +++ b/logging/logBuffer_test.go @@ -22,6 +22,7 @@ import ( "io" "testing" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) @@ -46,11 +47,13 @@ func createFixture(maxDepth uint) logBufferTestFixture { } func TestLogBufferEmpty(t *testing.T) { + partitiontest.PartitionTest(t) fixture := createFixture(10) require.Equal(t, "", fixture.lb.string()) } func TestLogBufferString(t *testing.T) { + partitiontest.PartitionTest(t) fixture := createFixture(10) lb := fixture.lb w := fixture.w @@ -62,6 +65,7 @@ func TestLogBufferString(t *testing.T) { } func TestLogBufferStrings(t *testing.T) { + partitiontest.PartitionTest(t) fixture := createFixture(10) w := fixture.w fmt.Fprint(w, testString1) @@ -75,6 +79,7 @@ func TestLogBufferStrings(t *testing.T) { } func TestLogBufferZeroMaxDepth(t *testing.T) { + partitiontest.PartitionTest(t) fixture := createFixture(0) w := fixture.w fmt.Fprint(w, testString1) @@ -86,6 +91,7 @@ func TestLogBufferZeroMaxDepth(t *testing.T) { } func TestLogBufferMaxDepth(t *testing.T) { + partitiontest.PartitionTest(t) fixture := createFixture(2) w := fixture.w fmt.Fprint(w, testString1) @@ -101,6 +107,7 @@ func TestLogBufferMaxDepth(t *testing.T) { } func TestLogBufferTrim(t *testing.T) { + partitiontest.PartitionTest(t) maxDepth := uint(9) entryCount := maxDepth + 2 lb := createLogBuffer(maxDepth) diff --git a/logging/log_test.go b/logging/log_test.go index c4142fb019..363791be1a 100644 --- a/logging/log_test.go +++ b/logging/log_test.go @@ -21,6 +21,7 @@ import ( "encoding/json" "testing" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) @@ -42,6 +43,7 @@ func isJSON(s string) bool { } func TestFileOutputNewLogger(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) // Create a buffer (mimics a file) for the output @@ -59,6 +61,7 @@ func TestFileOutputNewLogger(t *testing.T) { } func TestSetLevelNewLogger(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) //Create a buffer (mimics a file) for the output @@ -79,6 +82,7 @@ func TestSetLevelNewLogger(t *testing.T) { } func TestWithFieldsNewLogger(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) // Create a buffer (mimics a file) for the output @@ -93,6 +97,7 @@ func TestWithFieldsNewLogger(t *testing.T) { } func TestSetJSONFormatter(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) // Create a buffer (mimics a file) for the output diff --git a/logging/telemetryConfig_test.go b/logging/telemetryConfig_test.go index 6e040d1460..28cfef6136 100644 --- a/logging/telemetryConfig_test.go +++ b/logging/telemetryConfig_test.go @@ -23,10 +23,12 @@ import ( "path/filepath" "testing" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func Test_loadTelemetryConfig(t *testing.T) { + partitiontest.PartitionTest(t) sample := TelemetryConfig{ Enable: true, @@ -58,6 +60,7 @@ func Test_loadTelemetryConfig(t *testing.T) { } func Test_CreateSaveLoadTelemetryConfig(t *testing.T) { + partitiontest.PartitionTest(t) testDir := os.Getenv("TESTDIR") @@ -92,6 +95,7 @@ func Test_CreateSaveLoadTelemetryConfig(t *testing.T) { } func Test_SanitizeTelemetryString(t *testing.T) { + partitiontest.PartitionTest(t) type testcase struct { input string expected string @@ -110,6 +114,7 @@ func Test_SanitizeTelemetryString(t *testing.T) { } func TestLoadTelemetryConfig(t *testing.T) { + partitiontest.PartitionTest(t) testLoggingConfigFileName := "../test/testdata/configs/logging/logging.config.test1" tc, err := loadTelemetryConfig(testLoggingConfigFileName) require.NoError(t, err) @@ -122,7 +127,7 @@ func TestLoadTelemetryConfig(t *testing.T) { } func TestLoadTelemetryConfigBlankUsernamePassword(t *testing.T) { - + partitiontest.PartitionTest(t) testLoggingConfigFileName := "../test/testdata/configs/logging/logging.config.test2" tc, err := loadTelemetryConfig(testLoggingConfigFileName) require.NoError(t, err) @@ -133,6 +138,7 @@ func TestLoadTelemetryConfigBlankUsernamePassword(t *testing.T) { } func TestSaveTelemetryConfigBlankUsernamePassword(t *testing.T) { + partitiontest.PartitionTest(t) testDir := os.Getenv("TESTDIR") diff --git a/logging/telemetry_test.go b/logging/telemetry_test.go index fce2e6d9e1..039ddf4f0d 100644 --- a/logging/telemetry_test.go +++ b/logging/telemetry_test.go @@ -29,6 +29,7 @@ import ( "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/logging/telemetryspec" + "github.com/algorand/go-algorand/test/partitiontest" ) type mockTelemetryHook struct { @@ -133,6 +134,7 @@ func (h *mockTelemetryHook) entries() []string { } func TestCreateHookError(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) cfg := createTelemetryConfig() @@ -147,6 +149,7 @@ func TestCreateHookError(t *testing.T) { } func TestTelemetryHook(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) f := makeTelemetryTestFixture(logrus.InfoLevel) @@ -169,6 +172,7 @@ func TestTelemetryHook(t *testing.T) { } func TestNilMetrics(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) f := makeTelemetryTestFixture(logrus.InfoLevel) @@ -178,6 +182,7 @@ func TestNilMetrics(t *testing.T) { } func TestMultipleOperationStop(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) f := makeTelemetryTestFixture(logrus.InfoLevel) @@ -194,6 +199,7 @@ func TestMultipleOperationStop(t *testing.T) { } func TestDetails(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) f := makeTelemetryTestFixture(logrus.InfoLevel) @@ -216,6 +222,7 @@ func (m testMetrics) Identifier() telemetryspec.Metric { } func TestMetrics(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) f := makeTelemetryTestFixture(logrus.InfoLevel) @@ -231,6 +238,7 @@ func TestMetrics(t *testing.T) { } func TestLogHook(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) f := makeTelemetryTestFixture(logrus.InfoLevel) @@ -248,6 +256,7 @@ func TestLogHook(t *testing.T) { } func TestLogLevels(t *testing.T) { + partitiontest.PartitionTest(t) runLogLevelsTest(t, logrus.DebugLevel, 7) runLogLevelsTest(t, logrus.InfoLevel, 6) runLogLevelsTest(t, logrus.WarnLevel, 5) @@ -281,6 +290,7 @@ func runLogLevelsTest(t *testing.T, minLevel logrus.Level, expected int) { } func TestLogHistoryLevels(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) cfg := createTelemetryConfig() cfg.MinLogLevel = logrus.DebugLevel @@ -320,6 +330,7 @@ func TestLogHistoryLevels(t *testing.T) { } func TestReadTelemetryConfigOrDefaultNoDataDir(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) tempDir := os.TempDir() originalGlobalConfigFileRoot, _ := config.GetGlobalConfigFileRoot() diff --git a/logging/telemetryhook_test.go b/logging/telemetryhook_test.go index c60275f95f..083df03c53 100644 --- a/logging/telemetryhook_test.go +++ b/logging/telemetryhook_test.go @@ -26,9 +26,11 @@ import ( "github.com/stretchr/testify/require" "github.com/algorand/go-algorand/config" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestTelemetryConfig(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) cfg := createTelemetryConfig() @@ -41,6 +43,7 @@ func TestTelemetryConfig(t *testing.T) { } func TestLoadDefaultConfig(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) configDir, err := ioutil.TempDir("", "testdir") @@ -64,6 +67,7 @@ func isDefault(cfg TelemetryConfig) bool { } func TestLoggingConfigDataDirFirst(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) globalConfigRoot, err := ioutil.TempDir("", "globalConfigRoot") @@ -108,6 +112,7 @@ func TestLoggingConfigDataDirFirst(t *testing.T) { } func TestLoggingConfigGlobalSecond(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) globalConfigRoot, err := ioutil.TempDir("", "globalConfigRoot") @@ -139,6 +144,7 @@ func TestLoggingConfigGlobalSecond(t *testing.T) { } func TestSaveLoadConfig(t *testing.T) { + partitiontest.PartitionTest(t) a := require.New(t) globalConfigRoot, err := ioutil.TempDir("", "globalConfigRoot") @@ -170,6 +176,7 @@ func TestSaveLoadConfig(t *testing.T) { } func TestAsyncTelemetryHook_CloseDrop(t *testing.T) { + partitiontest.PartitionTest(t) const entryCount = 100 filling := make(chan struct{}) @@ -195,6 +202,7 @@ func TestAsyncTelemetryHook_CloseDrop(t *testing.T) { } func TestAsyncTelemetryHook_QueueDepth(t *testing.T) { + partitiontest.PartitionTest(t) const entryCount = 100 const maxDepth = 10 diff --git a/logging/telemetryspec/metric_test.go b/logging/telemetryspec/metric_test.go index 3f1aceef5e..0e096e72b0 100644 --- a/logging/telemetryspec/metric_test.go +++ b/logging/telemetryspec/metric_test.go @@ -21,10 +21,12 @@ import ( "testing" "time" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) func TestTransactionProcessingTimeDistibutionFormatting(t *testing.T) { + partitiontest.PartitionTest(t) var processingTime transactionProcessingTimeDistibution processingTime.AddTransaction(50000 * time.Nanosecond) processingTime.AddTransaction(80000 * time.Nanosecond) diff --git a/util/condvar/timedwait_test.go b/util/condvar/timedwait_test.go index 9faf9e8c93..bfc9daae5f 100644 --- a/util/condvar/timedwait_test.go +++ b/util/condvar/timedwait_test.go @@ -23,10 +23,12 @@ import ( "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-deadlock" ) func TestTimedWaitSignal(t *testing.T) { + partitiontest.PartitionTest(t) var m deadlock.Mutex var signal bool c := sync.NewCond(&m) @@ -51,6 +53,7 @@ func TestTimedWaitSignal(t *testing.T) { } func TestTimedWaitBroadcast(t *testing.T) { + partitiontest.PartitionTest(t) var m deadlock.Mutex var signal bool c := sync.NewCond(&m) @@ -75,6 +78,7 @@ func TestTimedWaitBroadcast(t *testing.T) { } func TestTimedWaitTimeout(t *testing.T) { + partitiontest.PartitionTest(t) var m deadlock.Mutex c := sync.NewCond(&m) From 8c09cb545e2238af5db05660d0caff88c6d1a161 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Tue, 7 Sep 2021 18:56:29 -0400 Subject: [PATCH 43/49] Revert "Switching to nightly tests for testing only" This reverts commit 04ed1bc97cfe0ccd0a77ce1bafccd6e320f06b27. --- .circleci/config.yml | 48 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fc46fb381c..a5d9637eb7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,7 +16,7 @@ workflows: - amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - amd64_test_nightly: @@ -24,7 +24,7 @@ workflows: - amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -33,7 +33,7 @@ workflows: - amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - amd64_integration_nightly: @@ -41,7 +41,7 @@ workflows: - amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -50,7 +50,7 @@ workflows: - amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - amd64_e2e_subs_nightly: @@ -58,7 +58,7 @@ workflows: - amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -67,7 +67,7 @@ workflows: - amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - amd64_e2e_expect_nightly: @@ -75,7 +75,7 @@ workflows: - amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -85,7 +85,7 @@ workflows: - arm64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - arm64_test_nightly: @@ -93,7 +93,7 @@ workflows: - arm64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -102,7 +102,7 @@ workflows: - arm64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - arm64_integration_nightly: @@ -110,7 +110,7 @@ workflows: - arm64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -119,7 +119,7 @@ workflows: - arm64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - arm64_e2e_subs_nightly: @@ -127,7 +127,7 @@ workflows: - arm64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -136,7 +136,7 @@ workflows: - arm64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - arm64_e2e_expect_nightly: @@ -144,7 +144,7 @@ workflows: - arm64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -154,7 +154,7 @@ workflows: - mac_amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_test_nightly: @@ -162,7 +162,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -171,7 +171,7 @@ workflows: - mac_amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_integration_nightly: @@ -179,7 +179,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -188,7 +188,7 @@ workflows: - mac_amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_e2e_subs_nightly: @@ -196,7 +196,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -205,7 +205,7 @@ workflows: - mac_amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_e2e_expect_nightly: @@ -213,7 +213,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets From dcbca18b4dbc78a42a2c6821d5c15fd8ee210d38 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Tue, 7 Sep 2021 19:15:25 -0400 Subject: [PATCH 44/49] Fixed automatic VSCode corrections --- cmd/algoh/blockWatcher_test.go | 1 + cmd/algoh/blockstats_test.go | 1 + daemon/algod/api/server/v1/handlers/handlers_test.go | 1 + 3 files changed, 3 insertions(+) diff --git a/cmd/algoh/blockWatcher_test.go b/cmd/algoh/blockWatcher_test.go index 9dbc33220d..f8fc55eef3 100644 --- a/cmd/algoh/blockWatcher_test.go +++ b/cmd/algoh/blockWatcher_test.go @@ -24,6 +24,7 @@ import ( "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/daemon/algod/api/spec/v1" v1 ) func bw(client Client) *blockWatcher { diff --git a/cmd/algoh/blockstats_test.go b/cmd/algoh/blockstats_test.go index 4d8f950dd7..f15fba4628 100644 --- a/cmd/algoh/blockstats_test.go +++ b/cmd/algoh/blockstats_test.go @@ -23,6 +23,7 @@ import ( "github.com/algorand/go-algorand/logging/telemetryspec" "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/daemon/algod/api/spec/v1" v1 ) type event struct { diff --git a/daemon/algod/api/server/v1/handlers/handlers_test.go b/daemon/algod/api/server/v1/handlers/handlers_test.go index 48a4fec47a..8649efc4fa 100644 --- a/daemon/algod/api/server/v1/handlers/handlers_test.go +++ b/daemon/algod/api/server/v1/handlers/handlers_test.go @@ -25,6 +25,7 @@ import ( "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/node" "github.com/algorand/go-algorand/protocol" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) From 7a0c2b5e8c587c9f7c5f7b8a507c355115bcdfbf Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Tue, 7 Sep 2021 19:43:11 -0400 Subject: [PATCH 45/49] Fixing vscode bug --- cmd/algoh/blockWatcher_test.go | 2 +- cmd/algoh/blockstats_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/algoh/blockWatcher_test.go b/cmd/algoh/blockWatcher_test.go index f8fc55eef3..8ed724c20c 100644 --- a/cmd/algoh/blockWatcher_test.go +++ b/cmd/algoh/blockWatcher_test.go @@ -22,9 +22,9 @@ import ( "testing" "time" + "github.com/algorand/go-algorand/daemon/algod/api/spec/v1" "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" - "github.com/algorand/go-algorand/daemon/algod/api/spec/v1" v1 ) func bw(client Client) *blockWatcher { diff --git a/cmd/algoh/blockstats_test.go b/cmd/algoh/blockstats_test.go index f15fba4628..d1b95003b2 100644 --- a/cmd/algoh/blockstats_test.go +++ b/cmd/algoh/blockstats_test.go @@ -20,10 +20,10 @@ import ( "testing" "time" + "github.com/algorand/go-algorand/daemon/algod/api/spec/v1" "github.com/algorand/go-algorand/logging/telemetryspec" "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" - "github.com/algorand/go-algorand/daemon/algod/api/spec/v1" v1 ) type event struct { From 4ae27381c639e6243a60d3cb52333e514758435c Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Wed, 8 Sep 2021 10:48:35 -0400 Subject: [PATCH 46/49] Fixing double partitioned tests --- daemon/algod/api/server/router_test.go | 33 ++++++++++++------- .../cli/algoh/expect/algoh_expect_test.go | 4 +-- .../cli/goal/expect/goal_expect_test.go | 4 +-- .../cli/tealdbg/expect/tealdbg_expect_test.go | 4 +-- 4 files changed, 28 insertions(+), 17 deletions(-) diff --git a/daemon/algod/api/server/router_test.go b/daemon/algod/api/server/router_test.go index 5f5edf666d..7474165a94 100644 --- a/daemon/algod/api/server/router_test.go +++ b/daemon/algod/api/server/router_test.go @@ -56,14 +56,16 @@ func (s *TestSuite) SetupTest() { s.calls = 0 } func (s *TestSuite) TestBaselineRoute() { - partitiontest.PartitionTest(s.T()) + // partitiontest.PartitionTest(s.T()) + // Partitioning in TestTestSuite() ctx := s.e.NewContext(nil, nil) s.e.Router().Find(http.MethodGet, "/v0/this/is/no/endpoint", ctx) assert.Equal(s.T(), echo.ErrNotFound, ctx.Handler()(ctx)) assert.Equal(s.T(), 0, s.calls) } func (s *TestSuite) TestAccountPendingTransaction() { - partitiontest.PartitionTest(s.T()) + // partitiontest.PartitionTest(s.T()) + // Partitioning in TestTestSuite() ctx := s.e.NewContext(nil, nil) s.e.Router().Find(http.MethodGet, "/v1/account/address-param/transactions/pending", ctx) assert.Equal(s.T(), "/v1/account/:addr/transactions/pending", ctx.Path()) @@ -75,7 +77,8 @@ func (s *TestSuite) TestAccountPendingTransaction() { assert.Equal(s.T(), callsBefore+1, s.calls) } func (s *TestSuite) TestWaitAfterBlock() { - partitiontest.PartitionTest(s.T()) + // partitiontest.PartitionTest(s.T()) + // Partitioning in TestTestSuite() ctx := s.e.NewContext(nil, nil) s.e.Router().Find(http.MethodGet, "/v1/status/wait-for-block-after/123456", ctx) assert.Equal(s.T(), "/v1/status/wait-for-block-after/:round", ctx.Path()) @@ -87,7 +90,8 @@ func (s *TestSuite) TestWaitAfterBlock() { assert.Equal(s.T(), callsBefore+1, s.calls) } func (s *TestSuite) TestAccountInformation() { - partitiontest.PartitionTest(s.T()) + // partitiontest.PartitionTest(s.T()) + // Partitioning in TestTestSuite() ctx := s.e.NewContext(nil, nil) s.e.Router().Find(http.MethodGet, "/v1/account/ZBBRQD73JH5KZ7XRED6GALJYJUXOMBBP3X2Z2XFA4LATV3MUJKKMKG7SHA", ctx) assert.Equal(s.T(), "/v1/account/:addr", ctx.Path()) @@ -99,7 +103,8 @@ func (s *TestSuite) TestAccountInformation() { assert.Equal(s.T(), callsBefore+1, s.calls) } func (s *TestSuite) TestTransactionInformation() { - partitiontest.PartitionTest(s.T()) + // partitiontest.PartitionTest(s.T()) + // Partitioning in TestTestSuite() ctx := s.e.NewContext(nil, nil) addr := "ZBBRQD73JH5KZ7XRED6GALJYJUXOMBBP3X2Z2XFA4LATV3MUJKKMKG7SHA" txid := "ASPB5E72OT2UWSOCQGD5OPT3W4KV4LZZDL7L5MBCC3EBAIJCDHAA" @@ -114,7 +119,8 @@ func (s *TestSuite) TestTransactionInformation() { assert.Equal(s.T(), callsBefore+1, s.calls) } func (s *TestSuite) TestAccountTransaction() { - partitiontest.PartitionTest(s.T()) + // partitiontest.PartitionTest(s.T()) + // Partitioning in TestTestSuite() ctx := s.e.NewContext(nil, nil) addr := "ZBBRQD73JH5KZ7XRED6GALJYJUXOMBBP3X2Z2XFA4LATV3MUJKKMKG7SHA" s.e.Router().Find(http.MethodGet, "/v1/account/"+addr+"/transactions", ctx) @@ -127,7 +133,8 @@ func (s *TestSuite) TestAccountTransaction() { assert.Equal(s.T(), callsBefore+1, s.calls) } func (s *TestSuite) TestBlock() { - partitiontest.PartitionTest(s.T()) + // partitiontest.PartitionTest(s.T()) + // Partitioning in TestTestSuite() ctx := s.e.NewContext(nil, nil) s.e.Router().Find(http.MethodGet, "/v1/block/123456", ctx) assert.Equal(s.T(), "/v1/block/:round", ctx.Path()) @@ -139,7 +146,8 @@ func (s *TestSuite) TestBlock() { assert.Equal(s.T(), callsBefore+1, s.calls) } func (s *TestSuite) TestPendingTransactionID() { - partitiontest.PartitionTest(s.T()) + // partitiontest.PartitionTest(s.T()) + // Partitioning in TestTestSuite() ctx := s.e.NewContext(nil, nil) txid := "ASPB5E72OT2UWSOCQGD5OPT3W4KV4LZZDL7L5MBCC3EBAIJCDHAA" s.e.Router().Find(http.MethodGet, "/v1/transactions/pending/"+txid, ctx) @@ -152,7 +160,8 @@ func (s *TestSuite) TestPendingTransactionID() { assert.Equal(s.T(), callsBefore+1, s.calls) } func (s *TestSuite) TestPendingTransactionInformationByAddress() { - partitiontest.PartitionTest(s.T()) + // partitiontest.PartitionTest(s.T()) + // Partitioning in TestTestSuite() ctx := s.e.NewContext(nil, nil) addr := "ZBBRQD73JH5KZ7XRED6GALJYJUXOMBBP3X2Z2XFA4LATV3MUJKKMKG7SHA" s.e.Router().Find(http.MethodGet, "/v1/account/"+addr+"/transactions/pending", ctx) @@ -165,7 +174,8 @@ func (s *TestSuite) TestPendingTransactionInformationByAddress() { assert.Equal(s.T(), callsBefore+1, s.calls) } func (s *TestSuite) TestGetAsset() { - partitiontest.PartitionTest(s.T()) + // partitiontest.PartitionTest(s.T()) + // Partitioning in TestTestSuite() ctx := s.e.NewContext(nil, nil) s.e.Router().Find(http.MethodGet, "/v1/asset/123456", ctx) assert.Equal(s.T(), "/v1/asset/:index", ctx.Path()) @@ -177,7 +187,8 @@ func (s *TestSuite) TestGetAsset() { assert.Equal(s.T(), callsBefore+1, s.calls) } func (s *TestSuite) TestGetTransactionByID() { - partitiontest.PartitionTest(s.T()) + // partitiontest.PartitionTest(s.T()) + // Partitioning in TestTestSuite() ctx := s.e.NewContext(nil, nil) txid := "ASPB5E72OT2UWSOCQGD5OPT3W4KV4LZZDL7L5MBCC3EBAIJCDHAA" s.e.Router().Find(http.MethodGet, "/v1/transaction/"+txid, ctx) diff --git a/test/e2e-go/cli/algoh/expect/algoh_expect_test.go b/test/e2e-go/cli/algoh/expect/algoh_expect_test.go index e30b1ef1ca..5d9dbd2ecd 100644 --- a/test/e2e-go/cli/algoh/expect/algoh_expect_test.go +++ b/test/e2e-go/cli/algoh/expect/algoh_expect_test.go @@ -19,12 +19,12 @@ import ( "testing" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/test/partitiontest" ) // TestAlgohWithExpect Process all expect script files with suffix Test.exp within the test/e2e-go/cli/algoh/expect directory func TestAlgohWithExpect(t *testing.T) { - partitiontest.PartitionTest(t) + // partitiontest.PartitionTest(t) + // Causes double partition, so commented out on purpose et := fixtures.MakeExpectTest(t) et.Run() } diff --git a/test/e2e-go/cli/goal/expect/goal_expect_test.go b/test/e2e-go/cli/goal/expect/goal_expect_test.go index 8a49bebc22..eca9923f97 100644 --- a/test/e2e-go/cli/goal/expect/goal_expect_test.go +++ b/test/e2e-go/cli/goal/expect/goal_expect_test.go @@ -20,12 +20,12 @@ import ( "testing" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/test/partitiontest" ) // TestGoalWithExpect Process all expect script files with suffix Test.exp within the test/e2e-go/cli/goal/expect directory func TestGoalWithExpect(t *testing.T) { - partitiontest.PartitionTest(t) + // partitiontest.PartitionTest(t) + // Causes double partition, so commented out on purpose et := fixtures.MakeExpectTest(t) et.Run() } diff --git a/test/e2e-go/cli/tealdbg/expect/tealdbg_expect_test.go b/test/e2e-go/cli/tealdbg/expect/tealdbg_expect_test.go index 451bc43a21..0068b90a25 100644 --- a/test/e2e-go/cli/tealdbg/expect/tealdbg_expect_test.go +++ b/test/e2e-go/cli/tealdbg/expect/tealdbg_expect_test.go @@ -19,12 +19,12 @@ import ( "testing" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/algorand/go-algorand/test/partitiontest" ) // TestTealdbgWithExpect processes all expect script files with suffix Test.exp within the test/e2e-go/cli/tealdbg/expect directory func TestTealdbgWithExpect(t *testing.T) { - partitiontest.PartitionTest(t) + // partitiontest.PartitionTest(t) + // Causes double partition, so commented out on purpose et := fixtures.MakeExpectTest(t) et.Run() } From efd73b67320ebc6753210899c9e4e35978773a61 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Tue, 7 Sep 2021 16:37:43 -0400 Subject: [PATCH 47/49] Switching to nightly tests for testing only --- .circleci/config.yml | 48 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a5d9637eb7..fc46fb381c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,7 +16,7 @@ workflows: - amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - amd64_test_nightly: @@ -24,7 +24,7 @@ workflows: - amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -33,7 +33,7 @@ workflows: - amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - amd64_integration_nightly: @@ -41,7 +41,7 @@ workflows: - amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -50,7 +50,7 @@ workflows: - amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - amd64_e2e_subs_nightly: @@ -58,7 +58,7 @@ workflows: - amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -67,7 +67,7 @@ workflows: - amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - amd64_e2e_expect_nightly: @@ -75,7 +75,7 @@ workflows: - amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -85,7 +85,7 @@ workflows: - arm64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - arm64_test_nightly: @@ -93,7 +93,7 @@ workflows: - arm64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -102,7 +102,7 @@ workflows: - arm64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - arm64_integration_nightly: @@ -110,7 +110,7 @@ workflows: - arm64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -119,7 +119,7 @@ workflows: - arm64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - arm64_e2e_subs_nightly: @@ -127,7 +127,7 @@ workflows: - arm64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -136,7 +136,7 @@ workflows: - arm64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - arm64_e2e_expect_nightly: @@ -144,7 +144,7 @@ workflows: - arm64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -154,7 +154,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_test_nightly: @@ -162,7 +162,7 @@ workflows: - mac_amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -171,7 +171,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_integration_nightly: @@ -179,7 +179,7 @@ workflows: - mac_amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -188,7 +188,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_e2e_subs_nightly: @@ -196,7 +196,7 @@ workflows: - mac_amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -205,7 +205,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_e2e_expect_nightly: @@ -213,7 +213,7 @@ workflows: - mac_amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets From d083c52269b33f4b287c1377635b4fab0baa411d Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Wed, 8 Sep 2021 13:39:44 -0400 Subject: [PATCH 48/49] Fixing double partitioning --- agreement/fuzzer/tests_test.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/agreement/fuzzer/tests_test.go b/agreement/fuzzer/tests_test.go index b409cd885a..22e1cc049b 100644 --- a/agreement/fuzzer/tests_test.go +++ b/agreement/fuzzer/tests_test.go @@ -107,7 +107,8 @@ func testConfig(t *testing.T, config NetworkConfig) (network *Network) { */ func TestCircularNetworkTopology(t *testing.T) { - partitiontest.PartitionTest(t) + // partitiontest.PartitionTest(t) + // Causes double partition, so commented out on purpose var nodeCounts []int if testing.Short() { nodeCounts = []int{4, 6} @@ -425,7 +426,8 @@ type FuzzerTestFile struct { } func TestFuzzer(t *testing.T) { - partitiontest.PartitionTest(t) + // partitiontest.PartitionTest(t) + // Causes double partition, so commented out on purpose jsonFiles := make(map[string]string) // map json test to full json file name. err := filepath.Walk(".", func(path string, info os.FileInfo, err error) error { if strings.HasSuffix(info.Name(), ".json") { @@ -479,7 +481,8 @@ func TestFuzzer(t *testing.T) { } func TestNetworkBandwidth(t *testing.T) { - partitiontest.PartitionTest(t) + // partitiontest.PartitionTest(t) + // Causes double partition, so commented out on purpose // travis rans out of memory when we get a high nodes count.. so we'll skip it for now. if testing.Short() { t.Skip() From 54a03e5603d13aee204f0dc85d25ca2b14c65445 Mon Sep 17 00:00:00 2001 From: Jack Smith Date: Wed, 8 Sep 2021 14:33:18 -0400 Subject: [PATCH 49/49] Revert "Switching to nightly tests for testing only" This reverts commit efd73b67320ebc6753210899c9e4e35978773a61. --- .circleci/config.yml | 48 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fc46fb381c..a5d9637eb7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,7 +16,7 @@ workflows: - amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - amd64_test_nightly: @@ -24,7 +24,7 @@ workflows: - amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -33,7 +33,7 @@ workflows: - amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - amd64_integration_nightly: @@ -41,7 +41,7 @@ workflows: - amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -50,7 +50,7 @@ workflows: - amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - amd64_e2e_subs_nightly: @@ -58,7 +58,7 @@ workflows: - amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -67,7 +67,7 @@ workflows: - amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - amd64_e2e_expect_nightly: @@ -75,7 +75,7 @@ workflows: - amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -85,7 +85,7 @@ workflows: - arm64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - arm64_test_nightly: @@ -93,7 +93,7 @@ workflows: - arm64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -102,7 +102,7 @@ workflows: - arm64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - arm64_integration_nightly: @@ -110,7 +110,7 @@ workflows: - arm64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -119,7 +119,7 @@ workflows: - arm64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - arm64_e2e_subs_nightly: @@ -127,7 +127,7 @@ workflows: - arm64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -136,7 +136,7 @@ workflows: - arm64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - arm64_e2e_expect_nightly: @@ -144,7 +144,7 @@ workflows: - arm64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -154,7 +154,7 @@ workflows: - mac_amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_test_nightly: @@ -162,7 +162,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -171,7 +171,7 @@ workflows: - mac_amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_integration_nightly: @@ -179,7 +179,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -188,7 +188,7 @@ workflows: - mac_amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_e2e_subs_nightly: @@ -196,7 +196,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets @@ -205,7 +205,7 @@ workflows: - mac_amd64_build filters: branches: - only: + ignore: - /rel\/.*/ - /hotfix\/.*/ - mac_amd64_e2e_expect_nightly: @@ -213,7 +213,7 @@ workflows: - mac_amd64_build filters: branches: - ignore: + only: - /rel\/.*/ - /hotfix\/.*/ context: slack-secrets