-
Notifications
You must be signed in to change notification settings - Fork 55
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
Integration tests for auth0 apps commands and flags [CLI-95] #278
Conversation
contains: | ||
- NAME integration-test-nativeapp1 | ||
- DESCRIPTION NativeApp1 | ||
- TYPE Native |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test is failing for me due to N
being uppercase in contains
but lower case in the result:
✗ [local] 'apps create type native and check output', on property 'Stdout'
Expected
[...]
TYPE native
[...]
to contain
TYPE Native
- TYPE Native | |
- TYPE native |
I can see that we're already testing this command here but this command is the plain format. Have you considered removing this plain format test all together?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✋ Ignore this. Error was on my side. I was running an older version of auth0
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the plain format tests that duplicate json format tests is a good question, though. I included it in case we want an indication when the formatting changes unexpectedly but it could be fussy to maintain.
Makefile
Outdated
@@ -71,4 +71,10 @@ $(GOBIN)/auth0-cli-config-generator: | |||
|
|||
integration: $(GOBIN)/auth0-cli-config-generator $(GOBIN)/commander | |||
auth0-cli-config-generator && commander test commander.yaml | |||
$(MAKE) integration-cleanup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps a nitpick here, but we could replace recursive use of make
with:
run-integration:
auth0-cli-config-generator && commander test commander.yaml
.PHONY: run-integration
integration: $(GOBIN)/auth0-cli-config-generator $(GOBIN)/commander run-integration integration-cleanup
.PHONY: integration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This an awesome PR and a great step forward for auth0-cli. Nice work 💯
Perhaps an issue on my end but when running
|
@rene00 Was that before commander started executing the tests or during? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent, thanks for going the extra mile with this one.
clientid=$(_jq '.ClientID') | ||
name=$(_jq '.Name') | ||
|
||
if [[ $name = integration-test-* ]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if this would only remove the apps created during the same tests execution, otherwise it might cause issues with other CI running at the same time.
thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jfatta if we have multiple integration tests on this tenant running at once, we'll want something smarter that deletes by client id. When we get CI running we'll also want to split out the test and cleanup steps so that the cleanup step is sure to run even if the tests fail.
Description
Use Commander to add integration tests for the following commands, with tests for every flag and flag value.
apps create
apps update
apps show
Added two small helper scripts to store an app id for tests that require an existing app as well as a cleanup script to delete the fixtures created during testing.
Also fixed two small typos found during development.
Testing
These updates can be tested by running
make integration
. Verified that the apps not prefixed withintegration-test-
were not deleted during test cleanup.Checklist
master