-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #432 This PR uses upstream's test setup to create a local testing keycloak harness. The deleted test files were copy and pasted from upstream originally, so nothing significant has changed in their contents, excepting that they were updated for keycloak's modern API paths.
- Loading branch information
Showing
16 changed files
with
216 additions
and
202 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 |
---|---|---|
@@ -1,14 +1,18 @@ | ||
provider: keycloak | ||
docker: true | ||
setup-script: "testing/setup.sh" | ||
major-version: 5 | ||
env: # these are in plaintext in the setup script | ||
KEYCLOAK_CLIENT_ID: "terraform" | ||
KEYCLOAK_CLIENT_SECRET: "884e0f95-0f42-4a63-9b1f-94274655669e" | ||
KEYCLOAK_PASSWORD: "password" | ||
KEYCLOAK_URL: "http://localhost:8080/auth" | ||
KEYCLOAK_URL: "http://localhost:8080" | ||
KEYCLOAK_USER: "keycloak" | ||
makeTemplate: bridged | ||
plugins: | ||
- name: aws | ||
version: "4.2.0" | ||
actions: | ||
preTest: | ||
- name: Ensure upstream | ||
run: make upstream | ||
- name: Setup local Keycloak | ||
run: make -C upstream local |
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 |
---|---|---|
|
@@ -12,7 +12,7 @@ env: | |
KEYCLOAK_CLIENT_ID: terraform | ||
KEYCLOAK_CLIENT_SECRET: 884e0f95-0f42-4a63-9b1f-94274655669e | ||
KEYCLOAK_PASSWORD: password | ||
KEYCLOAK_URL: http://localhost:8080/auth | ||
KEYCLOAK_URL: http://localhost:8080 | ||
KEYCLOAK_USER: keycloak | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
NODEVERSION: 20.x | ||
|
@@ -133,6 +133,7 @@ jobs: | |
- dotnet | ||
- go | ||
- java | ||
|
||
generate_coverage_data: | ||
continue-on-error: true | ||
env: | ||
|
@@ -217,12 +218,15 @@ jobs: | |
ref: deca2c5c6015ad7aaea6f572a1c2b198ca323592 | ||
- name: Unshallow clone for tags | ||
run: git fetch --prune --unshallow --tags | ||
- name: Prepare upstream code | ||
run: make upstream | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
cache-dependency-path: | | ||
sdk/go.sum | ||
go-version: 1.21.x | ||
cache-dependency-path: | | ||
provider/*.sum | ||
upstream/*.sum | ||
- name: Install pulumictl | ||
uses: jaxxstorm/[email protected] | ||
with: | ||
|
@@ -237,8 +241,14 @@ jobs: | |
uses: jaxxstorm/[email protected] | ||
with: | ||
repo: pulumi/schema-tools | ||
- name: Build tfgen & provider binaries | ||
run: make provider | ||
- name: Build schema generator binary | ||
run: make tfgen_build_only | ||
- name: Install plugins | ||
run: make install_plugins | ||
- name: Generate schema | ||
run: make tfgen_no_deps | ||
- name: Build provider binary | ||
run: make provider_no_deps | ||
- name: Unit-test provider code | ||
run: make test_provider | ||
- if: github.event_name == 'pull_request' | ||
|
@@ -265,6 +275,33 @@ jobs: | |
Maintainer note: consult the [runbook](https://github.com/pulumi/platform-providers-team/blob/main/playbooks/tf-provider-updating.md) for dealing with any breaking changes. | ||
- if: github.event_name == 'pull_request' | ||
name: Check Configuration section | ||
run: | | ||
sed -n '/## Configuration/,$p' README.md | sed -n '/## Reference/q;p' >> config_section.txt | ||
jq -r '.config | select(.variables) | .variables | keys[]' < provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> keys.txt | ||
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) | ||
{ | ||
echo "MISSING_CONFIG<<$EOF"; | ||
xargs -I {} sh -c "grep -q {} config_section.txt || echo \\\`{}\\\` not found in Configuration section" < keys.txt | ||
echo "$EOF"; | ||
} >> "$GITHUB_ENV" | ||
- if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' | ||
name: Comment on PR with Details of Configuration check | ||
uses: thollander/actions-comment-pull-request@v2 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
comment_tag: configurationCheck | ||
message: >+ | ||
### Is README.md missing any configuration options? | ||
${{ env.MISSING_CONFIG || 'No missing config!' }} | ||
${{ env.MISSING_CONFIG && 'Please add a description for each of these options to `README.md`.' }} | ||
${{ env.MISSING_CONFIG && 'Details about them can be found in either the upstream docs or `schema.json`.' }} | ||
- name: Tar provider binaries | ||
run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ | ||
github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }} | ||
|
@@ -462,17 +499,17 @@ jobs: | |
run: |- | ||
pip3 install virtualenv==20.0.23 | ||
pip3 install pipenv | ||
- name: Run docker-compose | ||
run: docker-compose -f testing/docker-compose.yml up --build -d | ||
- name: Run setup script | ||
run: testing/setup.sh | ||
- name: Install dependencies | ||
run: make install_${{ matrix.language}}_sdk | ||
- name: Install gotestfmt | ||
uses: GoTestTools/gotestfmt-action@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
version: v2.5.0 | ||
- name: Ensure upstream | ||
run: make upstream | ||
- name: Setup local Keycloak | ||
run: make -C upstream local | ||
- name: Run tests | ||
run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ | ||
matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt | ||
|
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 |
---|---|---|
|
@@ -13,7 +13,7 @@ env: | |
KEYCLOAK_CLIENT_ID: terraform | ||
KEYCLOAK_CLIENT_SECRET: 884e0f95-0f42-4a63-9b1f-94274655669e | ||
KEYCLOAK_PASSWORD: password | ||
KEYCLOAK_URL: http://localhost:8080/auth | ||
KEYCLOAK_URL: http://localhost:8080 | ||
KEYCLOAK_USER: keycloak | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
NODEVERSION: 20.x | ||
|
@@ -117,6 +117,7 @@ jobs: | |
with: | ||
name: ${{ matrix.language }}-sdk.tar.gz | ||
path: ${{ github.workspace}}/sdk/${{ matrix.language }}.tar.gz | ||
retention-days: 30 | ||
- if: failure() && github.event_name == 'push' | ||
name: Notify Slack | ||
uses: 8398a7/action-slack@v3 | ||
|
@@ -133,6 +134,7 @@ jobs: | |
- dotnet | ||
- go | ||
- java | ||
|
||
lint: | ||
name: lint | ||
uses: ./.github/workflows/lint.yml | ||
|
@@ -155,12 +157,15 @@ jobs: | |
ref: deca2c5c6015ad7aaea6f572a1c2b198ca323592 | ||
- name: Unshallow clone for tags | ||
run: git fetch --prune --unshallow --tags | ||
- name: Prepare upstream code | ||
run: make upstream | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
cache-dependency-path: | | ||
sdk/go.sum | ||
go-version: 1.21.x | ||
cache-dependency-path: | | ||
provider/*.sum | ||
upstream/*.sum | ||
- name: Install pulumictl | ||
uses: jaxxstorm/[email protected] | ||
with: | ||
|
@@ -175,8 +180,14 @@ jobs: | |
uses: jaxxstorm/[email protected] | ||
with: | ||
repo: pulumi/schema-tools | ||
- name: Build tfgen & provider binaries | ||
run: make provider | ||
- name: Build schema generator binary | ||
run: make tfgen_build_only | ||
- name: Install plugins | ||
run: make install_plugins | ||
- name: Generate schema | ||
run: make tfgen_no_deps | ||
- name: Build provider binary | ||
run: make provider_no_deps | ||
- name: Unit-test provider code | ||
run: make test_provider | ||
- if: github.event_name == 'pull_request' | ||
|
@@ -203,6 +214,33 @@ jobs: | |
Maintainer note: consult the [runbook](https://github.com/pulumi/platform-providers-team/blob/main/playbooks/tf-provider-updating.md) for dealing with any breaking changes. | ||
- if: github.event_name == 'pull_request' | ||
name: Check Configuration section | ||
run: | | ||
sed -n '/## Configuration/,$p' README.md | sed -n '/## Reference/q;p' >> config_section.txt | ||
jq -r '.config | select(.variables) | .variables | keys[]' < provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> keys.txt | ||
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) | ||
{ | ||
echo "MISSING_CONFIG<<$EOF"; | ||
xargs -I {} sh -c "grep -q {} config_section.txt || echo \\\`{}\\\` not found in Configuration section" < keys.txt | ||
echo "$EOF"; | ||
} >> "$GITHUB_ENV" | ||
- if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' | ||
name: Comment on PR with Details of Configuration check | ||
uses: thollander/actions-comment-pull-request@v2 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
comment_tag: configurationCheck | ||
message: >+ | ||
### Is README.md missing any configuration options? | ||
${{ env.MISSING_CONFIG || 'No missing config!' }} | ||
${{ env.MISSING_CONFIG && 'Please add a description for each of these options to `README.md`.' }} | ||
${{ env.MISSING_CONFIG && 'Details about them can be found in either the upstream docs or `schema.json`.' }} | ||
- name: Tar provider binaries | ||
run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ | ||
github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }} | ||
|
@@ -382,17 +420,17 @@ jobs: | |
run: |- | ||
pip3 install virtualenv==20.0.23 | ||
pip3 install pipenv | ||
- name: Run docker-compose | ||
run: docker-compose -f testing/docker-compose.yml up --build -d | ||
- name: Run setup script | ||
run: testing/setup.sh | ||
- name: Install dependencies | ||
run: make install_${{ matrix.language}}_sdk | ||
- name: Install gotestfmt | ||
uses: GoTestTools/gotestfmt-action@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
version: v2.5.0 | ||
- name: Ensure upstream | ||
run: make upstream | ||
- name: Setup local Keycloak | ||
run: make -C upstream local | ||
- name: Run tests | ||
run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ | ||
matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt | ||
|
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 |
---|---|---|
|
@@ -12,7 +12,7 @@ env: | |
KEYCLOAK_CLIENT_ID: terraform | ||
KEYCLOAK_CLIENT_SECRET: 884e0f95-0f42-4a63-9b1f-94274655669e | ||
KEYCLOAK_PASSWORD: password | ||
KEYCLOAK_URL: http://localhost:8080/auth | ||
KEYCLOAK_URL: http://localhost:8080 | ||
KEYCLOAK_USER: keycloak | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
NODEVERSION: 20.x | ||
|
@@ -116,6 +116,7 @@ jobs: | |
with: | ||
name: ${{ matrix.language }}-sdk.tar.gz | ||
path: ${{ github.workspace}}/sdk/${{ matrix.language }}.tar.gz | ||
retention-days: 30 | ||
- if: failure() && github.event_name == 'push' | ||
name: Notify Slack | ||
uses: 8398a7/action-slack@v3 | ||
|
@@ -132,6 +133,7 @@ jobs: | |
- dotnet | ||
- go | ||
- java | ||
|
||
create_docs_build: | ||
name: create_docs_build | ||
needs: tag_sdk | ||
|
@@ -169,12 +171,15 @@ jobs: | |
ref: deca2c5c6015ad7aaea6f572a1c2b198ca323592 | ||
- name: Unshallow clone for tags | ||
run: git fetch --prune --unshallow --tags | ||
- name: Prepare upstream code | ||
run: make upstream | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
cache-dependency-path: | | ||
sdk/go.sum | ||
go-version: 1.21.x | ||
cache-dependency-path: | | ||
provider/*.sum | ||
upstream/*.sum | ||
- name: Install pulumictl | ||
uses: jaxxstorm/[email protected] | ||
with: | ||
|
@@ -189,8 +194,14 @@ jobs: | |
uses: jaxxstorm/[email protected] | ||
with: | ||
repo: pulumi/schema-tools | ||
- name: Build tfgen & provider binaries | ||
run: make provider | ||
- name: Build schema generator binary | ||
run: make tfgen_build_only | ||
- name: Install plugins | ||
run: make install_plugins | ||
- name: Generate schema | ||
run: make tfgen_no_deps | ||
- name: Build provider binary | ||
run: make provider_no_deps | ||
- name: Unit-test provider code | ||
run: make test_provider | ||
- if: github.event_name == 'pull_request' | ||
|
@@ -217,6 +228,33 @@ jobs: | |
Maintainer note: consult the [runbook](https://github.com/pulumi/platform-providers-team/blob/main/playbooks/tf-provider-updating.md) for dealing with any breaking changes. | ||
- if: github.event_name == 'pull_request' | ||
name: Check Configuration section | ||
run: | | ||
sed -n '/## Configuration/,$p' README.md | sed -n '/## Reference/q;p' >> config_section.txt | ||
jq -r '.config | select(.variables) | .variables | keys[]' < provider/cmd/pulumi-resource-${{ env.PROVIDER }}/schema.json >> keys.txt | ||
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) | ||
{ | ||
echo "MISSING_CONFIG<<$EOF"; | ||
xargs -I {} sh -c "grep -q {} config_section.txt || echo \\\`{}\\\` not found in Configuration section" < keys.txt | ||
echo "$EOF"; | ||
} >> "$GITHUB_ENV" | ||
- if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' | ||
name: Comment on PR with Details of Configuration check | ||
uses: thollander/actions-comment-pull-request@v2 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
comment_tag: configurationCheck | ||
message: >+ | ||
### Is README.md missing any configuration options? | ||
${{ env.MISSING_CONFIG || 'No missing config!' }} | ||
${{ env.MISSING_CONFIG && 'Please add a description for each of these options to `README.md`.' }} | ||
${{ env.MISSING_CONFIG && 'Details about them can be found in either the upstream docs or `schema.json`.' }} | ||
- name: Tar provider binaries | ||
run: tar -zcf ${{ github.workspace }}/bin/provider.tar.gz -C ${{ | ||
github.workspace }}/bin/ pulumi-resource-${{ env.PROVIDER }} | ||
|
@@ -430,17 +468,17 @@ jobs: | |
run: |- | ||
pip3 install virtualenv==20.0.23 | ||
pip3 install pipenv | ||
- name: Run docker-compose | ||
run: docker-compose -f testing/docker-compose.yml up --build -d | ||
- name: Run setup script | ||
run: testing/setup.sh | ||
- name: Install dependencies | ||
run: make install_${{ matrix.language}}_sdk | ||
- name: Install gotestfmt | ||
uses: GoTestTools/gotestfmt-action@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
version: v2.5.0 | ||
- name: Ensure upstream | ||
run: make upstream | ||
- name: Setup local Keycloak | ||
run: make -C upstream local | ||
- name: Run tests | ||
run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ | ||
matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt | ||
|
Oops, something went wrong.