-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add integration test for pre-sync-mode
- Loading branch information
Showing
2 changed files
with
95 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,8 @@ jobs: | |
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.22 | ||
go-version-file: go.mod | ||
cache-dependency-path: go.sum | ||
|
||
- name: Test | ||
run: make test | ||
|
@@ -29,7 +30,8 @@ jobs: | |
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.22 | ||
go-version-file: go.mod | ||
cache-dependency-path: go.sum | ||
|
||
- name: Build | ||
run: make build | ||
|
@@ -46,6 +48,32 @@ jobs: | |
- name: Validate Cluster End State | ||
run: ./testing/validate.sh | ||
|
||
integration-test-presync: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: go.mod | ||
cache-dependency-path: go.sum | ||
|
||
- name: Build | ||
run: make build | ||
|
||
- name: Create k8s Kind Cluster | ||
uses: helm/[email protected] | ||
|
||
- name: Create Testdata in Cluster | ||
run: ./testing/init.sh | ||
|
||
- name: Run PVMigrate | ||
run: ./bin/pvmigrate --source-sc int-source --dest-sc int-dest --pre-sync-mode | ||
|
||
- name: Validate Cluster End State | ||
run: ./testing/validate.sh | ||
|
||
integration-test-incluster: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -54,7 +82,8 @@ jobs: | |
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.22 | ||
go-version-file: go.mod | ||
cache-dependency-path: go.sum | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
|
@@ -74,3 +103,31 @@ jobs: | |
|
||
- name: Validate Cluster End State | ||
run: ./testing/validate.sh | ||
|
||
# this job will validate that all the tests passed | ||
# it is used for the github branch protection rule | ||
validate-success: | ||
name: Validate success | ||
runs-on: ubuntu-24.04 | ||
needs: | ||
- unit-test | ||
- integration-test | ||
- integration-test-presync | ||
- integration-test-incluster | ||
if: always() | ||
steps: | ||
# https://docs.github.com/en/actions/learn-github-actions/contexts#needs-context | ||
- name: fail if unit-test job was not successful | ||
if: needs.unit-test.result != 'success' | ||
run: exit 1 | ||
- name: fail if integration-test job was not successful | ||
if: needs.integration-test.result != 'success' | ||
run: exit 1 | ||
- name: fail if integration-test-presync job was not successful | ||
if: needs.integration-test-presync.result != 'success' | ||
run: exit 1 | ||
- name: fail if integration-test-incluster job was not successful | ||
if: needs.integration-test-incluster.result != 'success' | ||
run: exit 1 | ||
- name: succeed if everything else passed | ||
run: echo "Validation succeeded" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,8 @@ jobs: | |
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.22 | ||
go-version-file: go.mod | ||
cache-dependency-path: go.sum | ||
|
||
- name: Test | ||
run: make test | ||
|
@@ -28,7 +29,8 @@ jobs: | |
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.22 | ||
go-version-file: go.mod | ||
cache-dependency-path: go.sum | ||
|
||
- name: Build | ||
run: make build | ||
|
@@ -45,6 +47,32 @@ jobs: | |
- name: Validate Cluster End State | ||
run: ./testing/validate.sh | ||
|
||
integration-test-presync: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: go.mod | ||
cache-dependency-path: go.sum | ||
|
||
- name: Build | ||
run: make build | ||
|
||
- name: Create k8s Kind Cluster | ||
uses: helm/[email protected] | ||
|
||
- name: Create Testdata in Cluster | ||
run: ./testing/init.sh | ||
|
||
- name: Run PVMigrate | ||
run: ./bin/pvmigrate --source-sc int-source --dest-sc int-dest --pre-sync-mode | ||
|
||
- name: Validate Cluster End State | ||
run: ./testing/validate.sh | ||
|
||
integration-test-incluster: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -53,7 +81,8 @@ jobs: | |
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.22 | ||
go-version-file: go.mod | ||
cache-dependency-path: go.sum | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
|
@@ -80,6 +109,7 @@ jobs: | |
- unit-test | ||
- integration-test | ||
- integration-test-incluster | ||
- integration-test-presync | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
steps: | ||
- name: Checkout | ||
|
@@ -90,7 +120,8 @@ jobs: | |
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.22 | ||
go-version-file: go.mod | ||
cache-dependency-path: go.sum | ||
|
||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v6 | ||
|