authgear / authgear/authgear-server
[e2e testing] Validation error if I use "000000" as fixed code
- Dominant language
- Go
- Stars
- 2k
- Forks
- 125
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 32
Description
Add this section to the config:
```
test_mode:
oob_otp:
enabled: true
rules:
- fixed_code: "aaaaaa"
regex: ".*"
```
Got this error
```
cmd.go:75: 2024/04/29 16:14:47 maxprocs: Leaving GOMAXPROCS=8: CPU quota undefined
Error: json: cannot unmarshal number into Go struct field TestModeOOBOTPRule.test_mode.oob_otp.rules.fixed_code of type string
Usage:
create-configsource [flags]
Flags:
--app-id string App ID (default "")
--config-override string Config override (default "")
--config-source string Config source (default "")
-h, --help help for create-configsource
testcase.go:61: failed to create config source: exit status 1
```
Contributor guide
Research direction
Reproduce the e2e configuration in the create-configsource path and start by reading the TestModeOOBOTPRule.fixed_code handling shown in the error. Check cmd.go and testcase.go for how the config source is created. Done means a fixed code such as "000000" is accepted and the end-to-end test no longer fails during config parsing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100