Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

Commit

Permalink
Update migration test
Browse files Browse the repository at this point in the history
  • Loading branch information
disq committed Jan 19, 2022
1 parent cda6943 commit 4eb2f8e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 48 deletions.
40 changes: 11 additions & 29 deletions .github/workflows/test_migration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
id: cache-migrations
uses: actions/cache@v2
with:
path: resources/migrations
key: ${{ runner.os }}-${{ hashFiles('resources/migrations') }}
path: resources/provider/migrations
key: ${{ runner.os }}-${{ hashFiles('resources/provider/migrations') }}

test_migration:
needs: should_run
Expand Down Expand Up @@ -58,39 +58,21 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Cache CQ
id: cache-cq-binary
uses: actions/cache@v2
with:
path: cloudquery
key: ${{ runner.os }}-${{ hashFiles('cloudquery') }}

- name: Download Cloudquery
if: steps.cache-cq-binary.cache-hit != 'true'
run: |
curl -L https://github.com/cloudquery/cloudquery/releases/latest/download/cloudquery_${OS}_x86_64 -o cloudquery
chmod a+x cloudquery
env:
OS: Linux

- name: Build initial schema
run: |
CQ_NO_TELEMETRY=1 ./cloudquery provider build-schema aws --config ./client/testdata/initial_migration.hcl --enable-console-log
- name: Get dependencies
run: |
go get -v -t -d ./...
- name: Build
run: go build -v .
- name: Run upgrade
- name: Test migrations for Postgres
run: |
go test -v resources/provider_test.go
env:
CQ_MIGRATION_TEST_DSN: postgres://postgres:pass@localhost:5432/postgres?sslmode=disable

- name: Test migrations for Timescale
run: |
rm -rf .cq_reattach
go run main.go & while [ ! -f .cq_reattach ]; do sleep 1; done && \
./cloudquery provider upgrade aws --config ./client/testdata/default.hcl --enable-console-log
go test -v resources/provider_test.go
env:
CQ_PROVIDER_DEBUG: 1
CQ_REATTACH_PROVIDERS: .cq_reattach
CQ_NO_TELEMETRY: 1
CQ_MIGRATION_TEST_DSN: tsdb://postgres:pass@localhost:5432/postgres?sslmode=disable

- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
Expand Down
19 changes: 0 additions & 19 deletions client/testdata/initial_migration.hcl

This file was deleted.

0 comments on commit 4eb2f8e

Please sign in to comment.