Refactor json output match through out the test script #3823
Labels
area/refactoring
Issues or PRs related to code refactoring
area/testing
Issues or PRs related to testing, Quality Assurance or Quality Engineering
estimated-size/S (5-10)
Rough sizing for Epics. Less then one sprint of work for one person
triage/needs-information
Indicates an issue needs more information in order to work on it.
/kind code-refactoring
What versions of software are you using?
Operating System:
All supported
Output of
odo version
:master
How did you run odo exactly?
Actual behavior
As part of json match is concern it looks pretty weird when we match the whole json (size of a paragraph). If we have a better json parser test script will also look clean and good.
Expected behavior
Instead of matching the whole json we can match the few key field of that. So we need a proper json parser.
Any logs, error output, etc?
Proposed solution
We can use the GJSON (https://github.com/tidwall/gjson) package as it meets the requirements and provides additional flexibility.
Implications:
Will have to refactor all test scripts using the current MatchJSON parser
Acceptance criteria
Refactor test scripts using the MatchJSON parser from ginkgo:
The following tests were updated but reported failures on areas where the changes were not introduced. A new issue will be opened to track their delivery once all other issues are resolved
cmd_dev_file_storage_test.go
cmd_devfile_describe_test.go
cmd_docker_devfile_url_test.go
cmd_storage_test.go
comd_url_test.go
component.go (called by cmd_cmp_test.go and cmd_cmp_sub_test.go)
generic_test.go
cmd_project_test.go
Executed each test as:
ginkgo -randomizeAllSpecs -slowSpecThreshold=120 -timeout 7200s -nodes=1 -focus="[test string in describe section of the test]" [test_path, e.g. tests/integration]
The text was updated successfully, but these errors were encountered: