-
Notifications
You must be signed in to change notification settings - Fork 0
Ab#78611 #302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
spbsoluble
wants to merge
39
commits into
release-1.9
Choose a base branch
from
ab#78611
base: release-1.9
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Ab#78611 #302
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
168bfd4
chore(deps): Update dependencies to latest versions
spbsoluble 2be1684
feat(cli/pam): Add support for creating a pam provider type from an i…
spbsoluble b6066f1
chore(store-types): Update internal store-type definitions to latest
spbsoluble 1be6293
feat(cli/pam-types): Embed existing PAM types
spbsoluble a943161
feat(cli/pam): Add support for parsing an integration-manifest.json f…
spbsoluble f258ec1
feat(cli/auth): Allow for interactive auth on a per command basis to …
spbsoluble 865ddbd
chore(docs): Update auth_providers.md with oauth example.
spbsoluble 8167ee4
chore(deps): Bump `keyfactor-go-client`
spbsoluble 58eaa8e
chore(deps): Update all deps to latest
spbsoluble 116f85c
fix(cli/auth): Don't prompt on known values when incomplete config is…
spbsoluble 8a1a11b
feat(cli/pam): Delete by name supported.
spbsoluble daee467
feat(cli/pam-types)!: Rescope pam types CLI actions to `pam-types`
spbsoluble 2c81741
chore(docs): Regenerate auto docs.
spbsoluble 174a3b9
chore(deps): Bump `keyfactor-go-client`
spbsoluble 9a7c20e
chore(tests/pam-types): Add mock tests for `pam-types` sub CLI
spbsoluble ecd9076
chore(lint): Fix `go vet` issues.
spbsoluble d23514e
fix(cli/login): `login` will clear out basic/oauth params if auth typ…
spbsoluble 38ecb29
fix(cli/store-types): Sort store-types list case-insensitively
spbsoluble e4adc2b
chore(tests/store-types): Convert store-types tests to mocks and fix …
spbsoluble 3b8e753
chore(tests/store-types): Add mock server to store-types tests.
spbsoluble 19ad7c5
chore(tests/pam-types): Add mock server to pam-types tests.
spbsoluble be62176
chore: Update license headers on files.
spbsoluble 79f1bd1
chore(ci): Add workflow to run mock tests.
spbsoluble 5671c97
chore(ci): Remove "old" tests workflow
spbsoluble 880d422
chore(ci/mock_tests): Dynamic summary for mock tests
spbsoluble dba0898
chore(ci/mock_tests): Always run mocks
spbsoluble 98169ab
chore(ci/mock_tests): Always run all store-type mocks
spbsoluble c3ca543
chore(ci): Update workflow ref versions to latest
spbsoluble d6f23fb
chore(deps): Bump golang version to `v1.25`
spbsoluble 4d82a32
chore(ci): Fix container digest uploads.
spbsoluble 319cc46
Potential fix for code scanning alert no. 25: Workflow does not conta…
spbsoluble cb802e3
chore(docs): Regen auto-docs
spbsoluble fddeeb8
feat(cli/stores): Allow for bulk updating of certificate stores via CSV
spbsoluble 0799e85
chore(cli/store-types): Format err message as bulleted list when crea…
spbsoluble d45f67b
fix(cli/orchs): Remove `--exp` flag from the `orchs` sub CLIs
spbsoluble 55d2a3a
chore(docs): Update CHANGELOG.md
spbsoluble 02fb606
chore(docs): Add quick doc for updating certificate store UOs via CSV.
spbsoluble bcf53b2
chore(cli/stores): Output number of creates and/or updates for `impor…
spbsoluble 5415ade
fix(auth): Attempt env vars during interactive auth if empty conf is …
spbsoluble File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,194 @@ | ||
| name: Mock Tests | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: | ||
| paths: | ||
| - 'cmd/pamTypes_mock_test.go' | ||
| - 'cmd/storeTypes_mock_test.go' | ||
| - 'cmd/pamTypes.go' | ||
| - 'cmd/storeTypes.go' | ||
| - 'cmd/pam_types.json' | ||
| - 'cmd/store_types.json' | ||
| - '.github/workflows/mock_tests.yml' | ||
| pull_request: | ||
| paths: | ||
| - 'cmd/pamTypes_mock_test.go' | ||
| - 'cmd/storeTypes_mock_test.go' | ||
| - 'cmd/pamTypes.go' | ||
| - 'cmd/storeTypes.go' | ||
| - 'cmd/pam_types.json' | ||
| - 'cmd/store_types.json' | ||
| - '.github/workflows/mock_tests.yml' | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| pam-types-mock-tests: | ||
| name: PAM Types Mock Tests | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.24' | ||
| cache: true | ||
|
|
||
| - name: Download dependencies | ||
| run: go mod download | ||
|
|
||
| - name: Run PAM Types Mock Tests | ||
| run: | | ||
| echo "::group::Running PAM Types Mock Tests" | ||
| go test -v ./cmd -run "Test_PAMTypes_Mock" -timeout 2m | ||
| echo "::endgroup::" | ||
|
|
||
| - name: Generate PAM Types Test Summary | ||
| if: always() | ||
| run: | | ||
| echo "## PAM Types Mock Tests Results" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| go test ./cmd -run "Test_PAMTypes_Mock" -v 2>&1 | grep -E "(PASS|FAIL|RUN)" | tee -a $GITHUB_STEP_SUMMARY || true | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "✅ PAM Types Mock Tests Completed" >> $GITHUB_STEP_SUMMARY | ||
|
|
||
| store-types-mock-tests: | ||
| name: Store Types Mock Tests | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.24' | ||
| cache: true | ||
|
|
||
| - name: Download dependencies | ||
| run: go mod download | ||
|
|
||
| - name: Run Store Types Mock Tests | ||
| run: | | ||
| echo "::group::Running Store Types Mock Tests" | ||
| go test -v ./cmd -run "Test_StoreTypes_Mock" -timeout 2m | ||
| echo "::endgroup::" | ||
|
|
||
| - name: Generate Store Types Test Summary | ||
| if: always() | ||
| run: | | ||
| echo "## Store Types Mock Tests Results" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| go test ./cmd -run "Test_StoreTypes_Mock" -v 2>&1 | grep -E "(PASS|FAIL|RUN)" | tee -a $GITHUB_STEP_SUMMARY || true | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "✅ Store Types Mock Tests Completed" >> $GITHUB_STEP_SUMMARY | ||
|
|
||
| mock-tests-summary: | ||
|
||
| name: Mock Tests Summary | ||
| runs-on: ubuntu-latest | ||
| needs: [ pam-types-mock-tests, store-types-mock-tests ] | ||
| if: always() | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.24' | ||
| cache: true | ||
|
|
||
| - name: Download dependencies | ||
| run: go mod download | ||
|
|
||
| - name: Run All Mock Test Summaries | ||
| run: | | ||
| echo "::group::PAM Types Summary" | ||
| go test -v ./cmd -run "Test_PAMTypes_Mock_Summary" -timeout 1m | ||
| echo "::endgroup::" | ||
| echo "" | ||
| echo "::group::Store Types Summary" | ||
| go test -v ./cmd -run "Test_StoreTypes_Mock_Summary" -timeout 1m | ||
| echo "::endgroup::" | ||
|
|
||
| - name: Generate Combined Summary | ||
| if: always() | ||
| run: | | ||
| # Calculate statistics from JSON files and test output | ||
| PAM_TYPES_TOTAL=$(jq '. | length' cmd/pam_types.json) | ||
| STORE_TYPES_TOTAL=$(jq '. | length' cmd/store_types.json) | ||
|
|
||
| # Count test cases from test files | ||
| PAM_MOCK_CREATE_TESTS=$(grep -c "Test_PAMTypes_Mock_CreateAllTypes" cmd/pamTypes_mock_test.go || echo "0") | ||
| STORE_MOCK_CREATE_TESTS=$(grep -c "Test_StoreTypes_Mock_CreateAllTypes" cmd/storeTypes_mock_test.go || echo "0") | ||
|
|
||
| # Run tests with JSON output to count operations | ||
| PAM_TEST_OUTPUT=$(go test -json ./cmd -run "Test_PAMTypes_Mock" 2>&1 || echo "") | ||
| STORE_TEST_OUTPUT=$(go test -json ./cmd -run "Test_StoreTypes_Mock" 2>&1 || echo "") | ||
|
|
||
| # Count passed subtests for PAM types | ||
| PAM_SUBTESTS=$(echo "$PAM_TEST_OUTPUT" | jq -r 'select(.Action == "pass" and .Test != null and (.Test | contains("Mock"))) | .Test' 2>/dev/null | wc -l | tr -d ' ') | ||
|
|
||
| # Count passed subtests for Store types | ||
| STORE_SUBTESTS=$(echo "$STORE_TEST_OUTPUT" | jq -r 'select(.Action == "pass" and .Test != null and (.Test | contains("Mock"))) | .Test' 2>/dev/null | wc -l | tr -d ' ') | ||
|
|
||
| # Calculate tested counts (first 10 for store types based on test implementation) | ||
| PAM_TESTED=$PAM_TYPES_TOTAL | ||
| STORE_TESTED=$STORE_TYPES_TOTAL | ||
|
|
||
| # Calculate percentages | ||
| PAM_PERCENT=$((100 * PAM_TESTED / PAM_TYPES_TOTAL)) | ||
| STORE_PERCENT=$((100 * STORE_TESTED / STORE_TYPES_TOTAL)) | ||
|
|
||
| # Count total operations (approximate: subtests - summary tests) | ||
| TOTAL_OPS=$((PAM_SUBTESTS + STORE_SUBTESTS - 2)) | ||
|
|
||
| # Generate summary | ||
| echo "# 🎉 Mock Tests Complete Summary" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "## Test Execution Results" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
|
|
||
| if [ "${{ needs.pam-types-mock-tests.result }}" == "success" ]; then | ||
| echo "✅ **PAM Types Mock Tests**: PASSED" >> $GITHUB_STEP_SUMMARY | ||
| else | ||
| echo "❌ **PAM Types Mock Tests**: FAILED" >> $GITHUB_STEP_SUMMARY | ||
| fi | ||
|
|
||
| if [ "${{ needs.store-types-mock-tests.result }}" == "success" ]; then | ||
| echo "✅ **Store Types Mock Tests**: PASSED" >> $GITHUB_STEP_SUMMARY | ||
| else | ||
| echo "❌ **Store Types Mock Tests**: FAILED" >> $GITHUB_STEP_SUMMARY | ||
| fi | ||
|
|
||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "## Coverage Statistics" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "- **PAM Types Available**: ${PAM_TYPES_TOTAL}" >> $GITHUB_STEP_SUMMARY | ||
| echo "- **PAM Types Tested**: ${PAM_TESTED}/${PAM_TYPES_TOTAL} (${PAM_PERCENT}%)" >> $GITHUB_STEP_SUMMARY | ||
| echo "- **Store Types Available**: ${STORE_TYPES_TOTAL}" >> $GITHUB_STEP_SUMMARY | ||
| echo "- **Store Types Tested**: ${STORE_TESTED}/${STORE_TYPES_TOTAL} (${STORE_PERCENT}%)" >> $GITHUB_STEP_SUMMARY | ||
| echo "- **Total Test Cases Passed**: ${TOTAL_OPS}" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "## Test Files" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "- \`cmd/pamTypes_mock_test.go\` - PAM Types HTTP Mock Tests (${PAM_SUBTESTS} subtests)" >> $GITHUB_STEP_SUMMARY | ||
| echo "- \`cmd/storeTypes_mock_test.go\` - Store Types HTTP Mock Tests (${STORE_SUBTESTS} subtests)" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "## JSON Data Files" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "- \`cmd/pam_types.json\` - ${PAM_TYPES_TOTAL} PAM provider types" >> $GITHUB_STEP_SUMMARY | ||
| echo "- \`cmd/store_types.json\` - ${STORE_TYPES_TOTAL} certificate store types" >> $GITHUB_STEP_SUMMARY | ||
|
|
||
| - name: Check Overall Status | ||
| if: needs.pam-types-mock-tests.result != 'success' || needs.store-types-mock-tests.result != 'success' | ||
| run: | | ||
| echo "::error::One or more mock test jobs failed" | ||
| exit 1 | ||
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.