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

pswi schema validation tests #3746

Draft
wants to merge 4 commits into
base: v2.x/staging
Choose a base branch
from

Conversation

MarkAckert
Copy link
Member

@MarkAckert MarkAckert commented Feb 28, 2024

  • Tests for the changes have been added (for bug fixes / features)
  • Necessary documentation (if appropriate) have been added / updated
  • DCO signoffs have been added to all commits, including this PR

PR type

This PR adds tests which attempt to detect desync between the zowe.yaml schema files and the zowe.yaml which is embedded and configured as part of the z/OSMF workflows.

This PR adds tests which cover the following cases:

  • Comments are desync'd. This test fails fast (early in file), and could be brittle. Please review and comment on if it's worth keeping.
  • Fields and values are desync'd. This will cover anything added, deleted, or changed in the example-zowe.yaml, relative to the current workflow with no special configuration provided.
  • Simple (default) workflow zowe.yaml schema validation. Currently, the wf zowe.yaml is invalid due to missing java.home and node.home defaults and the tests are adjusting for that.
  • Branch coverage for workflow zowe.yaml schema validation. There's some simple if/else logic embedded in the workflow VTL, and this test exercises all possible branching paths to pre-emptively cover an ugly edge case popping up.

In both schema validation cases, we are using a popular JSON schema validator, ajv. This is not the same schema validation happening in the zwe configMgr tool, but a few manual tests show their results look to be the same. I think these schema tests are very high confidence, but if we want perfect confidence results, we need new server-side configMgr-driven schema validation tests.

To run these tests:
npm install and npx mocha or npm run test. No server-side dependencies required.

Relevant issues

@MarkAckert MarkAckert changed the title pswi schema validation local tests init pswi schema validation tests Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant