diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index e5614fe6..650753f9 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -40,6 +40,8 @@ jobs: - name: Validate bats tests run: | TESTS=$(for i in $(seq $NUM_JOBS); do scripts/github_actions/filter_bats_list.bash $i $NUM_JOBS; done|wc -l) + TESTS_CI=$(find test/functional/ -name "*.bats" -path "*only_in_ci*" | wc -l) + TESTS=$((TESTS+TESTS_CI)) TOTAL=$(find test/functional/ -name "*.bats" | wc -l) if [ "$TOTAL" -ne "$TESTS" ]; then echo "Error in filter_bats_test.bash script" @@ -400,9 +402,45 @@ jobs: if: failure() run: cat test-suite.log + test_only_ci: + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - uses: actions/checkout@v1 + + - name: cache-dependencies + id: cache-swupd-deps + uses: actions/cache@v1 + with: + path: dependencies + key: swupd-dependencies + + - name: build_dep + run: scripts/github_actions/build_ci_dependencies.bash + + - name: build + run: scripts/github_actions/build_ci.bash + + - name: Run prereq + run: test/functional/generate-cert.prereq + + - name: run check slow + run: | + FILES="$(find test/functional/only_in_ci_slow/ -name "*.bats")" + env TESTS="$(echo $FILES)" make -e -j10 check + + - name: run check system + run: | + FILES="$(find test/functional/only_in_ci_system/ -name "*.bats")" + env TESTS="$(echo $FILES)" make -e -j1 check + + - name: print status + if: failure() + run: cat test-suite.log + test_successful: runs-on: ubuntu-latest - needs: [unit_and_style, test_job1, test_job2, test_job3, test_job4, test_job5, test_job6, test_job7, test_job8, test_job9, test_job10] + needs: [unit_and_style, test_job1, test_job2, test_job3, test_job4, test_job5, test_job6, test_job7, test_job8, test_job9, test_job10, test_only_ci] steps: - name: Successful run: echo "Successful" diff --git a/scripts/github_actions/filter_bats_list.bash b/scripts/github_actions/filter_bats_list.bash index 3568fd5a..e4d25a32 100755 --- a/scripts/github_actions/filter_bats_list.bash +++ b/scripts/github_actions/filter_bats_list.bash @@ -12,7 +12,7 @@ JOB_NUM=$1 NUM_JOBS=$2 DEFAULT_WEIGHT=6 -TEST_LIST=$(find test/functional/ -name "*.bats" | sort) +TEST_LIST=$(find test/functional/ -name "*.bats" \( ! -path "*only_in_ci*" \) | sort) TOTAL_WEIGHT=0 for t in $TEST_LIST; do diff --git a/scripts/github_actions/weight_tests.bash b/scripts/github_actions/weight_tests.bash index de8fe620..a651362c 100755 --- a/scripts/github_actions/weight_tests.bash +++ b/scripts/github_actions/weight_tests.bash @@ -2,7 +2,7 @@ MAX_WEIGHT=40 if [ -z "$1" ]; then - TESTS=$(find test/functional/ -name "*.bats") + TESTS=$(find test/functional/ -name "*.bats" \( ! -path "*only_in_ci*" \)) else TESTS="$*" fi diff --git a/test/functional/update/update-non-responsive.bats b/test/functional/only_in_ci_slow/update-non-responsive.bats similarity index 100% rename from test/functional/update/update-non-responsive.bats rename to test/functional/only_in_ci_slow/update-non-responsive.bats diff --git a/test/functional/update/update-slow-server.bats b/test/functional/only_in_ci_slow/update-slow-server.bats similarity index 100% rename from test/functional/update/update-slow-server.bats rename to test/functional/only_in_ci_slow/update-slow-server.bats diff --git a/test/functional/3rd-party/3rd-party-repo-add-certificate.bats b/test/functional/only_in_ci_system/3rd-party-repo-add-certificate.bats similarity index 100% rename from test/functional/3rd-party/3rd-party-repo-add-certificate.bats rename to test/functional/only_in_ci_system/3rd-party-repo-add-certificate.bats diff --git a/test/functional/bundleadd/add-client-certificate.bats b/test/functional/only_in_ci_system/add-client-certificate.bats similarity index 100% rename from test/functional/bundleadd/add-client-certificate.bats rename to test/functional/only_in_ci_system/add-client-certificate.bats diff --git a/test/functional/checkupdate/chk-update-client-certificate.bats b/test/functional/only_in_ci_system/chk-update-client-certificate.bats similarity index 100% rename from test/functional/checkupdate/chk-update-client-certificate.bats rename to test/functional/only_in_ci_system/chk-update-client-certificate.bats diff --git a/test/functional/diagnose/diagnose-client-certificate.bats b/test/functional/only_in_ci_system/diagnose-client-certificate.bats similarity index 100% rename from test/functional/diagnose/diagnose-client-certificate.bats rename to test/functional/only_in_ci_system/diagnose-client-certificate.bats diff --git a/test/functional/bundlelist/list-client-certificate.bats b/test/functional/only_in_ci_system/list-client-certificate.bats similarity index 100% rename from test/functional/bundlelist/list-client-certificate.bats rename to test/functional/only_in_ci_system/list-client-certificate.bats diff --git a/test/functional/bundleremove/remove-client-certificate.bats b/test/functional/only_in_ci_system/remove-client-certificate.bats similarity index 100% rename from test/functional/bundleremove/remove-client-certificate.bats rename to test/functional/only_in_ci_system/remove-client-certificate.bats diff --git a/test/functional/search/search-client-certificate.bats b/test/functional/only_in_ci_system/search-client-certificate.bats similarity index 100% rename from test/functional/search/search-client-certificate.bats rename to test/functional/only_in_ci_system/search-client-certificate.bats diff --git a/test/functional/update/update-client-certificate.bats b/test/functional/only_in_ci_system/update-client-certificate.bats similarity index 100% rename from test/functional/update/update-client-certificate.bats rename to test/functional/only_in_ci_system/update-client-certificate.bats diff --git a/test/functional/usability/usa-external-modules.bats b/test/functional/only_in_ci_system/usa-external-modules.bats similarity index 100% rename from test/functional/usability/usa-external-modules.bats rename to test/functional/only_in_ci_system/usa-external-modules.bats