Skip to content
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

[core] Dynamically generate invalid config files in unit tests #209

Closed
t1m0thyj opened this issue Aug 29, 2023 · 2 comments · Fixed by #220
Closed

[core] Dynamically generate invalid config files in unit tests #209

t1m0thyj opened this issue Aug 29, 2023 · 2 comments · Fixed by #220
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers priority-low tech-debt

Comments

@t1m0thyj
Copy link
Member

t1m0thyj commented Aug 29, 2023

Instead of adding a new zowe.config.json and zowe.schema.json file to the repo for every combination of invalid config/schema that we want to test, could we generate the invalid JSON files programmatically?

For example, in the test that requires "invalid.zowe.config.json" we could do something like this:

with open(self.original_file_path, 'r') as f:
    original_config = commentjson.load(f)
original_config["$schema"] = "./invalid.zowe.schema.json"
with open(os.path.join(self.custom_dir, "invalid.zowe.config.json"), 'w') as f:
    commentjson.dump(original_config, f)

Originally posted by @t1m0thyj in #192 (comment)

@t1m0thyj t1m0thyj added enhancement New feature or request good first issue Good for newcomers priority-low tech-debt labels Aug 29, 2023
@github-actions
Copy link

Thank you for raising this enhancement request.
The community has 90 days to vote on it.
If the enhancement receives at least 5 upvotes, it is added to our development backlog.
If it receives fewer votes, the issue is closed.

@aadityasinha-dotcom
Copy link
Contributor

aadityasinha-dotcom commented Oct 6, 2023

Please assign this to me 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers priority-low tech-debt
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants