Skip to content

Commit

Permalink
Fix commander tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiught committed Dec 14, 2023
1 parent 23833d7 commit ace6d7d
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions test/integration/api-test-cases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ tests:
exit-code: 1
stderr:
contains:
- "failed to parse command inputs: invalid json data given"
- "Failed to parse command inputs: invalid json data given"

007 - it fails to use the api command if an invalid method is given:
command: auth0 api conquer "tenants/settings"
exit-code: 1
stderr:
contains:
- "failed to parse command inputs: invalid method given"
- "Failed to parse command inputs: invalid method given"

008 - it throws a warning when both piped data and the data flag are present:
command: cat ./test/integration/fixtures/update-tenant-settings.json | auth0 api patch "tenants/settings" --data "{\"idle_session_lifetime\":72}"
Expand Down
2 changes: 1 addition & 1 deletion test/integration/apis-test-cases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tests:
exit-code: 1
stderr:
contains:
- number flag invalid, please pass a number between 1 and 1000
- Number flag invalid, please pass a number between 1 and 1000

003 - apis create and check data:
command: auth0 apis create --name integration-test-api-def1 --identifier http://integration-test-api-def1 --scopes read:todos,write:todos --signing-alg RS256 --json
Expand Down
6 changes: 3 additions & 3 deletions test/integration/apps-test-cases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tests:
exit-code: 1
stderr:
contains:
- "number flag invalid, please pass a number between 1 and 1000"
- "Number flag invalid, please pass a number between 1 and 1000"

003 - it successfully creates a native app:
command: auth0 apps create --name integration-test-app-nativeapp1 --type native --description NativeApp1
Expand Down Expand Up @@ -76,7 +76,7 @@ tests:
exit-code: 1
stderr:
contains:
- "Unable to create application"
- "Failed to create application"

010 - it successfully creates a regular app with auth method set to post and outputs in json:
command: auth0 apps create --name integration-test-app-regapp2 --type regular --description RegApp2 --auth-method Post --json
Expand Down Expand Up @@ -132,7 +132,7 @@ tests:
exit-code: 1
stderr:
contains:
- "Unable to create application"
- "Failed to create application"

018 - it successfully creates a native app with logout urls and outputs in json:
command: auth0 apps create --name integration-test-app-regapp6 --type native --description RegularApp --logout-urls https://*.example.com/logout,https://example.com/logout --json
Expand Down
2 changes: 1 addition & 1 deletion test/integration/custom-domains-test-cases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ tests:
exit-code: 1
stderr:
contains:
- "An unexpected error occurred while attempting to create the custom domain 'custom-domain.com': 409 Conflict: The specified custom domain already exists"
- "Failed to create custom domain \"custom-domain.com\": 409 Conflict: The specified custom domain already exists"

005 - show domain:
command: auth0 domains show $(./test/integration/scripts/get-custom-domain-id.sh) --no-input
Expand Down
4 changes: 2 additions & 2 deletions test/integration/logs-test-cases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ tests:
exit-code: 1
stderr:
contains:
- "number flag invalid, please pass a number between 1 and 1000"
- "Number flag invalid, please pass a number between 1 and 1000"

005 - it errors because of invalid number arg:
command: auth0 logs list --number 1001 --json
exit-code: 1
stderr:
contains:
- "number flag invalid, please pass a number between 1 and 1000"
- "Number flag invalid, please pass a number between 1 and 1000"

006 - it successfully lists all log streams with no data:
command: auth0 logs streams list
Expand Down
12 changes: 6 additions & 6 deletions test/integration/organizations-test-cases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ tests:
exit-code: 1
stderr:
contains:
- number flag invalid, please pass a number between 1 and 1000
- Number flag invalid, please pass a number between 1 and 1000

004 - create organization and check json output:
command: auth0 orgs create --name integration-test-org-new --display "Integration Test Organization" --json --no-input
Expand All @@ -49,7 +49,7 @@ tests:
exit-code: 1
stderr:
contains:
- failed to create an organization with name 'integration-test-org-new2'
- Failed to create organization with name "integration-test-org-new2"

007 - list organizations with data:
command: auth0 orgs list
Expand Down Expand Up @@ -81,7 +81,7 @@ tests:
exit-code: 1
stderr:
contains:
- "Unable to get an organization with ID 'this-org-id-does-not-exist'"
- "Failed to read organization with ID \"this-org-id-does-not-exist\""

011 - update organization with minimal flags:
command: auth0 orgs update $(./test/integration/scripts/get-org-id.sh) --no-input
Expand Down Expand Up @@ -151,7 +151,7 @@ tests:
exit-code: 1
stderr:
contains:
- number flag invalid, please pass a number between 1 and 1000
- Number flag invalid, please pass a number between 1 and 1000
config:
retries: 3

Expand All @@ -164,7 +164,7 @@ tests:
exit-code: 1
stderr:
contains:
- number flag invalid, please pass a number between 1 and 1000
- Number flag invalid, please pass a number between 1 and 1000

021 - list organization roles members:
command: auth0 orgs roles members list $(./test/integration/scripts/get-org-id.sh)
Expand All @@ -175,4 +175,4 @@ tests:
exit-code: 1
stderr:
contains:
- number flag invalid, please pass a number between 1 and 1000
- Number flag invalid, please pass a number between 1 and 1000
4 changes: 2 additions & 2 deletions test/integration/roles-test-cases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ tests:
exit-code: 1
stderr:
contains:
- number flag invalid, please pass a number between 1 and 1000
- Number flag invalid, please pass a number between 1 and 1000

007 - roles show json:
command: auth0 roles show $(./test/integration/scripts/get-role-id.sh) --json
Expand Down Expand Up @@ -97,7 +97,7 @@ tests:
exit-code: 1
stderr:
contains:
- number flag invalid, please pass a number between 1 and 1000
- Number flag invalid, please pass a number between 1 and 1000

014 - add role permissions:
command: auth0 roles permissions add $(./test/integration/scripts/get-role-id.sh) --api-id $(./test/integration/scripts/get-api-id.sh) --permissions read:todos
Expand Down
4 changes: 2 additions & 2 deletions test/integration/terraform-test-cases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ tests:
exit-code: 1
stderr:
contains:
- "unsupported resource type: auth0_computer"
- "Unsupported resource type: auth0_computer"

005 - it errors if AUTH0_DOMAIN values for provider and CLI do not match:
command: AUTH0_DOMAIN=some-other-domain.us.auth0.com auth0 tf generate --output-dir tmp-tf-gen
exit-code: 1
stderr:
contains:
- "Terraform provider tenant domain 'some-other-domain.us.auth0.com' does not match current CLI tenant '"
- "Terraform provider tenant domain \"some-other-domain.us.auth0.com\" does not match current CLI tenant"
4 changes: 2 additions & 2 deletions test/integration/test-commands-test-cases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ tests:
exit-code: 1
stderr:
contains:
- "cannot test the Universal Login with a Machine to Machine application."
- "Cannot test the Universal Login with a Machine to Machine application."

003 - test token without client grant:
command: auth0 test token $(./test/integration/scripts/get-m2m-app-id.sh) --audience "$(./test/integration/scripts/get-manage-api-audience.sh)" --no-input
exit-code: 1
stderr:
contains:
- "failed to log in with client credentials for client with ID "
- "Failed to log in with client credentials for client with ID "
- "the integration-test-app-m2m application is not authorized to request access tokens for this API "
- ".auth0.com/api/v2/."

Expand Down
2 changes: 1 addition & 1 deletion test/integration/universal-login-test-cases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ tests:
exit-code: 1
stderr:
contains:
- "failed to fetch the Universal Login template data: this feature requires at least one custom domain to be set and verified for the tenant, use 'auth0 domains create' to create one and 'auth0 domains verify' to have it verified"
- "Failed to fetch the Universal Login template data: this feature requires at least one custom domain to be set and verified for the tenant, use 'auth0 domains create' to create one and 'auth0 domains verify' to have it verified"

010 - update universal login branding prompts (login):
command: cat ./test/integration/fixtures/update-ul-prompts-login.json | auth0 ul prompts update login
Expand Down
4 changes: 2 additions & 2 deletions test/integration/users-test-cases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ tests:
exit-code: 1
stderr:
contains:
- number flag invalid, please pass a number between 1 and 1000
- Number flag invalid, please pass a number between 1 and 1000

007 - users update minimal flags:
command: auth0 users update $(./test/integration/scripts/get-user-id.sh) --json --no-input
Expand Down Expand Up @@ -93,7 +93,7 @@ tests:
exit-code: 1
stderr:
contains:
- number flag invalid, please pass a number between 1 and 1000
- Number flag invalid, please pass a number between 1 and 1000

013 - users roles add:
command: auth0 users roles add $(./test/integration/scripts/get-user-id.sh) -r $(./test/integration/scripts/get-role-id.sh)
Expand Down

0 comments on commit ace6d7d

Please sign in to comment.