-
Notifications
You must be signed in to change notification settings - Fork 437
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add github action for integration tests
- Loading branch information
Showing
20 changed files
with
195 additions
and
30 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
on: | ||
push: | ||
|
||
jobs: | ||
integration-tests: | ||
strategy: | ||
matrix: | ||
db: [cockroach, postgres] | ||
runs-on: ubuntu-20.04 | ||
env: | ||
DOCKER_BUILDKIT: 1 | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
- name: Source checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
with: | ||
driver: docker | ||
install: true | ||
- name: Generate gRPC definitions | ||
run: docker build -f build/grpc/Dockerfile -t zitadel-base:local . | ||
- name: Copy gRPC definitions | ||
run: docker build -f build/zitadel/Dockerfile . -t zitadel-go-base --target go-copy -o . | ||
- name: Download Go modules | ||
run: go mod download | ||
- name: Start ${{ matrix.db }} database | ||
run: docker compose -f e2e/config/integration/docker-compose.yaml up --wait ${{ matrix.db }} | ||
- name: Run integration test | ||
env: | ||
INTEGRATION_DB_FLAVOR: ${{ matrix.db }} | ||
run: go test -tags=integration -v ./internal/integration ./internal/api/grpc/... |
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,24 @@ | ||
version: '3.8' | ||
|
||
services: | ||
cockroach: | ||
extends: | ||
file: '../localhost/docker-compose.yaml' | ||
service: 'db' | ||
|
||
postgres: | ||
restart: 'always' | ||
image: 'postgres:15' | ||
environment: | ||
- POSTGRES_USER=zitadel | ||
- PGUSER=zitadel | ||
- POSTGRES_DB=zitadel | ||
- POSTGRES_HOST_AUTH_METHOD=trust | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready"] | ||
interval: '10s' | ||
timeout: '30s' | ||
retries: 5 | ||
start_period: '20s' | ||
ports: | ||
- 5432:5432 |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//go:build !integration | ||
|
||
package admin | ||
|
||
import ( | ||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//go:build !integration | ||
|
||
package admin | ||
|
||
import ( | ||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//go:build !integration | ||
|
||
package admin | ||
|
||
import ( | ||
|
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//go:build !integration | ||
|
||
package errors | ||
|
||
import ( | ||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//go:build !integration | ||
|
||
package grpc | ||
|
||
import ( | ||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//go:build !integration | ||
|
||
package management | ||
|
||
import ( | ||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//go:build !integration | ||
|
||
package middleware | ||
|
||
import ( | ||
|
2 changes: 2 additions & 0 deletions
2
internal/api/grpc/server/middleware/error_interceptor_test.go
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//go:build !integration | ||
|
||
package middleware | ||
|
||
import ( | ||
|
2 changes: 2 additions & 0 deletions
2
internal/api/grpc/server/middleware/instance_interceptor_test.go
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//go:build !integration | ||
|
||
package middleware | ||
|
||
import ( | ||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//go:build !integration | ||
|
||
package server | ||
|
||
import ( | ||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//go:build !integration | ||
|
||
package system_test | ||
|
||
import ( | ||
|
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,10 @@ | ||
Database: | ||
cockroach: | ||
Host: localhost | ||
Port: 26257 | ||
Database: zitadel | ||
Options: "" | ||
User: | ||
Username: zitadel | ||
Admin: | ||
Username: root |
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,15 @@ | ||
Database: | ||
postgres: | ||
Host: localhost | ||
Port: 5432 | ||
Database: zitadel | ||
MaxOpenConns: 20 | ||
MaxIdleConns: 10 | ||
User: | ||
Username: zitadel | ||
SSL: | ||
Mode: disable | ||
Admin: | ||
Username: zitadel | ||
SSL: | ||
Mode: disable |
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,38 @@ | ||
Log: | ||
Level: debug | ||
|
||
TLS: | ||
Enabled: false | ||
|
||
FirstInstance: | ||
Org: | ||
Human: | ||
PasswordChangeRequired: false | ||
|
||
LogStore: | ||
Access: | ||
Database: | ||
Enabled: true | ||
Debounce: | ||
MinFrequency: 0s | ||
MaxBulkSize: 0 | ||
Execution: | ||
Database: | ||
Enabled: true | ||
Stdout: | ||
Enabled: true | ||
|
||
Quotas: | ||
Access: | ||
ExhaustedCookieKey: "zitadel.quota.limiting" | ||
ExhaustedCookieMaxAge: "60s" | ||
|
||
Projections: | ||
Customizations: | ||
NotificationsQuotas: | ||
RequeueEvery: 1s | ||
|
||
DefaultInstance: | ||
LoginPolicy: | ||
MfaInitSkipLifetime: "0" | ||
|
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 |
---|---|---|
@@ -1,18 +1,17 @@ | ||
//go:build integration | ||
|
||
package integration | ||
|
||
import ( | ||
"context" | ||
"strings" | ||
"testing" | ||
"time" | ||
) | ||
|
||
const commandLine = `start-from-init --masterkey MasterkeyNeedsToHave32Characters --tlsMode disabled --config ../../e2e/config/localhost/zitadel.yaml --steps ../../e2e/config/localhost/zitadel.yaml` | ||
|
||
func TestNewTester(t *testing.T) { | ||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) | ||
defer cancel() | ||
|
||
s := NewTester(ctx, strings.Split(commandLine, " ")) | ||
s := NewTester(ctx) | ||
defer s.Done() | ||
} |