-
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
DXCDT-386: Expand apps test cases and move to own test file #652
Conversation
|
||
settingsURL := fmt.Sprintf("%s%s", manageTenantURL, path) | ||
|
||
if cli.noInput { |
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.
Issue with the no input flag surfaced through the test and it is now fixed.
inherit-env: true | ||
|
||
tests: | ||
01 - it successfully lists all apps: |
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.
Unfortunately all tests run in alphabetical order, so we're trying to enforce an order like this.
@@ -92,6 +92,10 @@ build: ## Build the cli binary for the native platform | |||
${call print, "Building the cli binary"} | |||
go build -v -ldflags "$(GO_LINKER_FLAGS)" -o "${BUILD_DIR}/auth0" cmd/auth0/main.go | |||
|
|||
build-with-cover: ## Build the cli binary for the native platform with coverage support. |
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.
These will be used later when adding the coverage badge on the README.
380f19e
to
64516f1
Compare
@@ -272,6 +273,7 @@ func RunLoginAsMachine(ctx context.Context, inputs LoginInputs, cli *cli, cmd *c | |||
} | |||
|
|||
t := Tenant{ | |||
Name: strings.Split(inputs.Domain, ".")[0], |
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 fixes a bug where all the dashboard URLs were empty when using client credentials because the name of the tenant was missing.
json: | ||
web_origins: "[https://example.com]" | ||
|
||
021 - given a test app: |
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.
Should this be a test case?
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.
We need some way to assert that the app used in the below steps is created, otherwise they will all fail. Not the perfect solution unfortunately, as we're quite limited by this commander test runner. Long term I'd love for us to get rid of this way of testing and take https://github.com/cli/cli/blob/trunk/pkg/cmd/issue/list/list_test.go as an example instead.
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.
Note that by using sequential numbering, adding e.g. a new 'create' test for a future new flag may require re-numbering all the tests below, unless new tests are just appended at the end (and thus placed outside their CRUD 'group').
Yep that's something we are aware of @Widcket 👍🏻 and I was planning on adding a make command that uses yq to regenerate the numbering automatically when new tests are introduced. I decided however to defer this for later due to time constraints. |
🔧 Changes
Expands the apps test cases and moves them to their own test file. While adding more test cases a few bugs surfaced and were fixes as well, see comments below.
📚 References
🔬 Testing
📝 Checklist