From ecf8dd0a26459855f563238c718e3d39ef9f50ee Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Tue, 30 May 2023 00:24:01 +0200 Subject: [PATCH] test: type integration not needed Signed-off-by: CrazyMax --- .github/workflows/build.yml | 4 +--- hack/test | 29 ++++++----------------------- 2 files changed, 7 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 200b6a87..11be1800 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,8 +40,6 @@ jobs: - remote pkg: - ./tests - typ: - - integration include: - pkg: ./... skip-integration-tests: 1 @@ -66,7 +64,7 @@ jobs: name: Test run: | export TEST_REPORT_SUFFIX=-${{ github.job }}-$(echo "${{ matrix.pkg }}-${{ matrix.skip-integration-tests }}-${{ matrix.worker }}" | tr -dc '[:alnum:]-\n\r' | tr '[:upper:]' '[:lower:]') - ./hack/test ${{ matrix.typ }} + ./hack/test env: TEST_DOCKERD: "${{ (matrix.worker == 'docker' || matrix.worker == 'docker-container') && '1' || '0' }}" TESTFLAGS: "${{ (matrix.worker == 'docker' || matrix.worker == 'docker-container') && env.TESTFLAGS_DOCKER || env.TESTFLAGS }} --run=//worker=${{ matrix.worker }}$" diff --git a/hack/test b/hack/test index 9dbb8104..82fabf1a 100755 --- a/hack/test +++ b/hack/test @@ -6,11 +6,10 @@ set -eu -o pipefail : "${CACHE_FROM=}" : "${CACHE_TO=}" -: ${TEST_INTEGRATION=} -: ${TEST_REPORT_SUFFIX=} -: ${TEST_KEEP_CACHE=} -: ${TEST_DOCKERD=} -: ${TEST_BUILDKIT_IMAGE=} +: "${TEST_REPORT_SUFFIX=}" +: "${TEST_KEEP_CACHE=}" +: "${TEST_DOCKERD=}" +: "${TEST_BUILDKIT_IMAGE=}" if [ -n "$CACHE_FROM" ]; then for cfrom in $CACHE_FROM; do @@ -23,20 +22,6 @@ if [ -n "$CACHE_TO" ]; then done fi -if [ "$#" == 0 ]; then TEST_INTEGRATION=1; fi - -while test $# -gt 0; do - case "$1" in - integration) - TEST_INTEGRATION=1 - ;; - *) - echo "unknown arg $1" - ;; - esac - shift -done - iid="buildx-tests" testReportsDir="$(pwd)/bin/testreports" @@ -52,10 +37,8 @@ if ! docker container inspect "$cacheVolume" >/dev/null 2>/dev/null; then docker create -v /root/.cache -v /root/.cache/registry -v /go/pkg/mod --name "$cacheVolume" alpine fi -if [ "$TEST_INTEGRATION" == 1 ]; then - cid=$(docker create --rm -v /tmp $testReportsVol --volumes-from=$cacheVolume -e GITHUB_REF -e TEST_DOCKERD -e TEST_BUILDKIT_IMAGE -e SKIP_INTEGRATION_TESTS -e GOTESTSUM_FORMAT ${BUILDKIT_INTEGRATION_SNAPSHOTTER:+"-eBUILDKIT_INTEGRATION_SNAPSHOTTER"} -e BUILDKIT_REGISTRY_MIRROR_DIR=/root/.cache/registry --privileged $iid gotestsum $gotestsumArgs --packages="${TESTPKGS:-./...}" -- $gotestArgs ${TESTFLAGS:--v}) - docker start -a -i $cid -fi +cid=$(docker create --rm -v /tmp $testReportsVol --volumes-from=$cacheVolume -e GITHUB_REF -e TEST_DOCKERD -e TEST_BUILDKIT_IMAGE -e SKIP_INTEGRATION_TESTS -e GOTESTSUM_FORMAT ${BUILDKIT_INTEGRATION_SNAPSHOTTER:+"-eBUILDKIT_INTEGRATION_SNAPSHOTTER"} -e BUILDKIT_REGISTRY_MIRROR_DIR=/root/.cache/registry --privileged $iid gotestsum $gotestsumArgs --packages="${TESTPKGS:-./...}" -- $gotestArgs ${TESTFLAGS:--v}) +docker start -a -i $cid if [ "$TEST_KEEP_CACHE" != "1" ]; then docker rm -v $cacheVolume