Skip to content
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

Update admin_setting_saml_integration_test.go #1005

Merged
merged 3 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/nightly-tfe-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ jobs:
exit 1

slack-notify:
needs: [ tests ]
if: ${{ needs.tests.result == 'failure' }}
needs: [ tests-summarize ]
if: always() && (needs.tests-summarize.result == 'failure')
runs-on: ubuntu-latest
steps:
- name: Send slack notification on failure
uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.0
with:
payload: |
{
"text": ":x::moon::sob: Nightly TFE tests *FAILED*",
"text": ":x::moon::sob: Nightly TFE tests *FAILED* on ${{ github.repository }}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

"attachments": [
{
"color": "#C41E3A",
Expand Down
24 changes: 10 additions & 14 deletions admin_setting_saml_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,20 +116,16 @@ func TestAdminSettings_SAML_Update(t *testing.T) {
})
require.Error(t, err)
})
}

func TestAdminSettings_SAML_RevokeIdpCert(t *testing.T) {
skipUnlessEnterprise(t)

client := testClient(t)
ctx := context.Background()
t.Run("revoke IDP cert", func(t *testing.T) {
_, err := client.Admin.Settings.SAML.Update(ctx, AdminSAMLSettingsUpdateOptions{
Enabled: Bool(true),
IDPCert: String("anotherTestCert"),
})
require.NoError(t, err)

samlSettings, err := client.Admin.Settings.SAML.Read(ctx)
require.NoError(t, err)
if !samlSettings.Enabled {
t.Skip("SAML is not enabled, skipping Revoke IDP Cert test.")
}
samlSettings, err = client.Admin.Settings.SAML.RevokeIdpCert(ctx)
require.NoError(t, err)
assert.NotNil(t, samlSettings.IDPCert)
samlSettings, err = client.Admin.Settings.SAML.RevokeIdpCert(ctx)
require.NoError(t, err)
assert.NotNil(t, samlSettings.IDPCert)
})
}
Loading