From e2b2cff0383375f951d5227be520fd65c66dfb1f Mon Sep 17 00:00:00 2001 From: Toni Spets Date: Sun, 24 Dec 2023 20:11:48 +0200 Subject: [PATCH] Re-enable integration tests --- .github/workflows/commit.yml | 97 +++++++++++++++++++----------------- 1 file changed, 52 insertions(+), 45 deletions(-) diff --git a/.github/workflows/commit.yml b/.github/workflows/commit.yml index 99d5e2ab..d7d02b85 100644 --- a/.github/workflows/commit.yml +++ b/.github/workflows/commit.yml @@ -65,15 +65,6 @@ jobs: - run: go test -v ./... -# - name: Build integration test -# run: go test -c ./integration -# -# - uses: actions/upload-artifact@v2 -# with: -# name: integration.test -# path: integration.test -# if-no-files-found: error - # long-running-test: # name: Run Long Running Unit Test # runs-on: ubuntu-latest @@ -114,43 +105,59 @@ jobs: - run: ./etc/s3_mock.py go test -v ./replica_client_test.go -integration s3 -# s3-integration-test: -# name: Run S3 Integration Tests -# runs-on: ubuntu-latest -# needs: build -# steps: -# - uses: actions/download-artifact@v2 -# with: -# name: integration.test -# - run: chmod +x integration.test -# -# - run: ./integration.test -test.v -test.run=TestReplicaClient -replica-type s3 -# env: -# LITESTREAM_S3_ACCESS_KEY_ID: ${{ secrets.LITESTREAM_S3_ACCESS_KEY_ID }} -# LITESTREAM_S3_SECRET_ACCESS_KEY: ${{ secrets.LITESTREAM_S3_SECRET_ACCESS_KEY }} -# LITESTREAM_S3_REGION: us-east-1 -# LITESTREAM_S3_BUCKET: integration.litestream.io + s3-integration-test: + name: Run S3 Integration Tests + runs-on: ubuntu-latest + needs: build + if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/fix/integration-tests' + concurrency: + group: integration-test-s3 + steps: + - uses: actions/checkout@v4 -# gcp-integration-test: -# name: Run GCP Integration Tests -# runs-on: ubuntu-latest -# needs: build -# steps: -# - name: Extract GCP credentials -# run: 'echo "$GOOGLE_APPLICATION_CREDENTIALS" > /opt/gcp.json' -# shell: bash -# env: -# GOOGLE_APPLICATION_CREDENTIALS: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}} -# -# - uses: actions/download-artifact@v2 -# with: -# name: integration.test -# - run: chmod +x integration.test -# -# - run: ./integration.test -test.v -test.run=TestReplicaClient -replica-type gcs -# env: -# GOOGLE_APPLICATION_CREDENTIALS: /opt/gcp.json -# LITESTREAM_GCS_BUCKET: integration.litestream.io + - uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + + - run: go env + + - run: go install ./cmd/litestream + + - run: go test -v ./replica_client_test.go -integration s3 + env: + LITESTREAM_S3_ACCESS_KEY_ID: ${{ secrets.LITESTREAM_S3_ACCESS_KEY_ID }} + LITESTREAM_S3_SECRET_ACCESS_KEY: ${{ secrets.LITESTREAM_S3_SECRET_ACCESS_KEY }} + LITESTREAM_S3_REGION: us-east-1 + LITESTREAM_S3_BUCKET: integration.litestream.io + + gcp-integration-test: + name: Run GCP Integration Tests + runs-on: ubuntu-latest + needs: build + if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/fix/integration-tests' + concurrency: + group: integration-test-gcp + steps: + - name: Extract GCP credentials + run: 'echo "$GOOGLE_APPLICATION_CREDENTIALS" > /opt/gcp.json' + shell: bash + env: + GOOGLE_APPLICATION_CREDENTIALS: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}} + + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + + - run: go env + + - run: go install ./cmd/litestream + + - run: go test -v ./replica_client_test.go -integration gcs + env: + GOOGLE_APPLICATION_CREDENTIALS: /opt/gcp.json + LITESTREAM_GCS_BUCKET: integration.litestream.io # abs-integration-test: # name: Run Azure Blob Store Integration Tests