-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TT-10430: add integration tests for mserv and mservctl
- Loading branch information
Showing
5 changed files
with
107 additions
and
37 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 |
---|---|---|
|
@@ -8,21 +8,46 @@ jobs: | |
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Go ${{ matrix.go-version }} | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.15.x' | ||
go-version: '1.20.x' | ||
|
||
- name: Setup Golang caches | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-golang- | ||
- name: Test | ||
run: make test | ||
|
||
- name: Lint | ||
run: make lint | ||
# - name: Lint | ||
# run: make lint | ||
|
||
- name: Build server and client | ||
run: make build | ||
|
||
- name: Cache Docker images. | ||
uses: ScribeMD/[email protected] | ||
with: | ||
key: docker-${{ runner.os }}-${{ hashFiles('docker-compose.yaml') }} | ||
|
||
- name: Start Docker Compose with MongoDB and Tyk Mserv | ||
run: make start | ||
|
||
- name: Build and bundle plugins | ||
run: | | ||
make plugin | ||
make bundles | ||
- name: Build server | ||
if: always() | ||
run: make build-binary | ||
- name: Install Venom command line tool | ||
run: go install github.com/ovh/venom/cmd/venom@latest | ||
|
||
- name: Build cli | ||
if: always() | ||
run: make build-cli | ||
- name: Run Venom tests | ||
run: make integration |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Integration tests for mserv and mservctl | ||
|
||
testcases: | ||
- name: List | ||
steps: | ||
- script: ../bin/mservctl list -e http://localhost:8989 | ||
assertions: | ||
- result.code ShouldEqual 0 | ||
- result.systemout MustContainSubstring "ID ACTIVE SERVE ONLY LAST UPDATE" | ||
- result.systemout MustNotContainSubstring true # Should not have any other rows as header row. | ||
- result.systemout MustNotContainSubstring false # Should not have any other rows as header row. | ||
|
||
- name: Push | ||
steps: | ||
- script: ../bin/mservctl push -e http://localhost:8989 ../bundles/simple/bundle.zip | ||
assertions: | ||
- result.code ShouldEqual 0 | ||
- result.systemerr MustContainSubstring Middleware uploaded successfully, ID | ||
vars: | ||
bundle: | ||
from: result.systemerr | ||
regex: "Middleware uploaded successfully, ID: ([a-z0-9-]+)" | ||
|
||
- name: Fetch | ||
steps: | ||
- script: ../bin/mservctl fetch -e http://localhost:8989 {{.Push.bundle}} | ||
assertions: | ||
- result.code ShouldEqual 0 | ||
- result.systemout MustContainSubstring {{.Push.bundle}} | ||
|
||
- name: Delete | ||
steps: | ||
- script: ../bin/mservctl delete -e http://localhost:8989 {{.Push.bundle}} | ||
assertions: | ||
- result.code ShouldEqual 0 | ||
- result.systemerr MustContainSubstring "Middleware deleted successfully, ID" | ||
|
||
- name: List | ||
steps: | ||
- script: ../bin/mservctl list -e http://localhost:8989 | ||
assertions: | ||
- result.code ShouldEqual 0 | ||
- result.systemout MustContainSubstring "ID ACTIVE SERVE ONLY LAST UPDATE" | ||
- result.systemout MustNotContainSubstring true # Should not have any other rows as header row. | ||
- result.systemout MustNotContainSubstring false # Should not have any other rows as header row. |