-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #97 from zitadel/run-tests-on-pr
chore: run tests on PR
- Loading branch information
Showing
10 changed files
with
182 additions
and
18 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,14 @@ | ||
### Definition of Ready | ||
|
||
- [ ] Short description of the feature/issue is added in the pr description | ||
- [ ] PR is linked to the corresponding user story | ||
- [ ] Acceptance criteria are met | ||
- [ ] All open todos and follow ups are defined in a new ticket and justified | ||
- [ ] Deviations from the acceptance criteria and design are agreed with the PO and documented. | ||
- [ ] No debug or dead code | ||
- [ ] My code has no repetitions | ||
- [ ] All non-functional requirements are met | ||
- [ ] The generic lifecycle acceptance test passes for affected resources. | ||
- [ ] Examples are up-to-date and meaningful. The provider version is incremented. | ||
- [ ] Docs are generated. | ||
- [ ] Code is generated where possible. |
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,55 @@ | ||
name: Test Provider | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
test: | ||
|
||
runs-on: ubuntu-20.04 | ||
|
||
permissions: | ||
contents: read | ||
|
||
steps: | ||
|
||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Make Machinekey Directory Writable | ||
working-directory: acceptance | ||
run: "chmod -R 777 machinekey" | ||
|
||
- name: Set up ZITADEL | ||
working-directory: acceptance | ||
run: docker compose up -d zitadel | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
|
||
- name: Download Go Modules | ||
run: go mod download | ||
|
||
- name: Await ZITADEL | ||
working-directory: acceptance | ||
run: docker compose run wait_for_zitadel | ||
|
||
- name: Run Acceptance Tests | ||
run: TF_ACC=1 TF_ACC_ZITADEL_TOKEN=$(pwd)/acceptance/machinekey/zitadel-admin-sa.json go test ./... | ||
|
||
- name: Save ZITADEL Logs | ||
working-directory: acceptance | ||
if: always() | ||
run: docker compose logs zitadel > .zitadel.log | ||
|
||
- name: Archive ZITADEL Logs | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: pull-request-tests | ||
path: | | ||
acceptance/.zitadel.log | ||
retention-days: 30 |
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,34 @@ | ||
version: '3.8' | ||
|
||
services: | ||
zitadel: | ||
user: '${ZITADEL_DEV_UID}' | ||
image: '${ZITADEL_IMAGE:-ghcr.io/zitadel/zitadel:latest}' | ||
command: 'start-from-init --masterkey "MasterkeyNeedsToHave32Characters" --tlsMode disabled --config /zitadel.yaml --steps /zitadel.yaml' | ||
ports: | ||
- "8080:8080" | ||
volumes: | ||
- ./machinekey:/machinekey | ||
- ./zitadel.yaml:/zitadel.yaml | ||
depends_on: | ||
db: | ||
condition: 'service_healthy' | ||
|
||
db: | ||
image: 'cockroachdb/cockroach:v22.2.2' | ||
command: 'start-single-node --insecure --http-addr :9090' | ||
healthcheck: | ||
test: ['CMD', 'curl', '-f', 'http://localhost:9090/health?ready=1'] | ||
interval: '10s' | ||
timeout: '30s' | ||
retries: 5 | ||
start_period: '20s' | ||
ports: | ||
- "26257:26257" | ||
- "9090:9090" | ||
|
||
wait_for_zitadel: | ||
image: curlimages/curl:8.00.1 | ||
command: [ "/bin/sh", "-c", "i=0; while ! curl http://zitadel:8080/debug/ready && [ $$i -lt 30 ]; do sleep 1; i=$$((i+1)); done; [ $$i -eq 30 ] && exit 1 || exit 0" ] | ||
depends_on: | ||
- zitadel |
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 @@ | ||
zitadel-admin-sa.json |
Empty file.
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,18 @@ | ||
FirstInstance: | ||
MachineKeyPath: /machinekey/zitadel-admin-sa.json | ||
Org: | ||
Machine: | ||
Machine: | ||
Username: zitadel-admin-sa | ||
Name: Admin | ||
MachineKey: | ||
Type: 1 | ||
|
||
Database: | ||
Cockroach: | ||
Host: db | ||
|
||
Logstore: | ||
Access: | ||
Stdout: | ||
Enabled: true |
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