fix: missing tenantId on user resource #587
Workflow file for this run
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
name: Tests | |
on: | |
pull_request: | |
paths-ignore: | |
- 'README.md' | |
push: | |
paths-ignore: | |
- 'README.md' | |
# schedule: | |
# - cron: '0 13 * * *' | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.20' | |
id: go | |
- name: Get dependencies | |
run: | | |
go mod download | |
- name: Build | |
run: | | |
go build -v . | |
test: | |
name: Matrix Test | |
needs: build | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
strategy: | |
fail-fast: false | |
matrix: | |
terraform: | |
- '1.3.9' | |
- '1.4.6' | |
- '1.5.2' | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ github.token }} | |
- name: Build the docker-compose stack | |
env: | |
APPLICATION_SECRETS: ${{ secrets.APPLICATION_SECRETS }} | |
run: | | |
echo $APPLICATION_SECRETS | base64 -d > .github/docker/application-secrets.yml | |
docker compose -f docker-compose-ci.yml pull | |
docker compose -f docker-compose-ci.yml up -d zookeeper kafka elasticsearch vault | |
sleep 30 | |
docker compose -f docker-compose-ci.yml up -d | |
sleep 30 | |
echo "\echo 'path \"*\" {capabilities = [\"create\", \"read\", \"update\", \"delete\", \"list\", \"sudo\"]}' | vault policy write admins -" | docker exec --interactive terraform-provider-kestra-vault-1 sh - | |
docker compose -f docker-compose-ci.yml exec vault vault auth enable userpass | |
docker compose -f docker-compose-ci.yml exec vault vault write auth/userpass/users/john \ | |
password=foo \ | |
policies=admins \ | |
token_period=1s | |
curl "127.27.27.27:9200" > /dev/null | |
curl -X POST "127.27.27.27:8080/api/v1/users" > /dev/null | |
curl -u [email protected]:pass -X POST -H 'Content-Type: application/json' -d '{"id":"unit_test","name":"Unit Test"}' "127.27.27.27:8080/api/v1/tenants" > /dev/null | |
curl -H "Content-Type: application/x-ndjson" -XPOST "127.27.27.27:9200/_bulk?pretty" --data-binary @.github/workflows/index.jsonl | |
sleep 3 | |
curl -H "Content-Type: multipart/form-data" -u [email protected]:pass -X POST -F fileContent=@internal/resources/flow.py "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/files?path=/flow.py" | |
curl -H "Content-Type: text/plain" -u [email protected]:pass -X PUT -d '"stringValue"' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/string" | |
curl -H "Content-Type: text/plain" -u [email protected]:pass -X PUT -d '1' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/int" | |
curl -H "Content-Type: text/plain" -u [email protected]:pass -X PUT -d '1.5' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/double" | |
curl -H "Content-Type: text/plain" -u [email protected]:pass -X PUT -d 'false' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/falseBoolean" | |
curl -H "Content-Type: text/plain" -u [email protected]:pass -X PUT -d 'true' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/trueBoolean" | |
curl -H "Content-Type: text/plain" -u [email protected]:pass -X PUT -d '2022-05-01T03:02:01Z' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/dateTime" | |
curl -H "Content-Type: text/plain" -u [email protected]:pass -X PUT -d '2022-05-01' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/date" | |
curl -H "Content-Type: text/plain" -u [email protected]:pass -X PUT -d 'P3DT3H2M1S' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/duration" | |
curl -H "Content-Type: application/json" -u [email protected]:pass -X PUT -d '{"some":"value","in":"object"}' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/object" | |
curl -H "Content-Type: application/json" -u [email protected]:pass -X PUT -d '[{"some":"value","in":"object"},{"yet":"another","array":"object"}]' "127.27.27.27:8080/api/v1/namespaces/io.kestra.terraform.data/kv/array" | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.18' | |
id: go | |
- name: Get dependencies | |
run: | | |
go mod download | |
- name: Terraform acceptance tests | |
timeout-minutes: 10 | |
env: | |
TF_ACC: "1" | |
TF_ACC_TERRAFORM_VERSION: ${{ matrix.terraform }} | |
KESTRA_URL: "http://127.27.27.27:8080" | |
KESTRA_USERNAME: [email protected] | |
KESTRA_PASSWORD: pass | |
run: | | |
go test -v -cover ./internal/provider/ | |
# Slack | |
- name: Slack notification | |
uses: 8398a7/action-slack@v3 | |
if: failure() && github.event_name != 'pull_request' | |
with: | |
status: ${{ job.status }} | |
job_name: Matrix Test | |
fields: repo,commit,action,ref,job,took | |
username: GitHub Actions | |
icon_emoji: ':github-actions:' | |
channel: 'C02DQ1A7JLR' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
MATRIX_CONTEXT: ${{ toJson(matrix) }} |