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

CSD02 mandatory tests #3

Merged
merged 12 commits into from
Apr 6, 2022
Merged

CSD02 mandatory tests #3

merged 12 commits into from
Apr 6, 2022

Conversation

domachine
Copy link
Contributor

@domachine domachine commented Mar 30, 2022

This PR includes the additional mandatory tests from CSD02.

@tschmidtb51
Copy link
Contributor

@domachine Do you have a small script that imports the library and validates a file against one test? That would help me to test some edge cases of the implementation.

Just from looking at the code I couldn't spot anything obvious...

@domachine
Copy link
Contributor Author

@domachine Do you have a small script that imports the library and validates a file against one test? That would help me to test some edge cases of the implementation.

Just from looking at the code I couldn't spot anything obvious...

Yes, I can throw one together. But if you want, you could add these edge cases to the documentTests.js file to include them in the test-suite. Just copy and paste the JSON into the content field. Since JSON is also valid JS, no changes are needed.

@tschmidtb51
Copy link
Contributor

Yes, I can throw one together.

I wouldn't mind if you could do that. I would like to use that in the TC's repo to make sure the example files fail the right tests...

@domachine domachine mentioned this pull request Apr 1, 2022
@domachine
Copy link
Contributor Author

Yes, I can throw one together.

I wouldn't mind if you could do that. I would like to use that in the TC's repo to make sure the example files fail the right tests...

Here is a git-patch. Save it on your disk and run git apply <patch-file-path> from within the csaf-validator-lib repo. Then you can run the script using the following command: ./scripts/runTest.js <doc-file> mandatoryTest_6_1_1. mandatoryTest_6_1_1 is a sample here. You can insert any test name from lib/mandatoryTests.js, lib/optionalTests.js, lib/schemaTests.js and lib/schemaTests.js.

run_test_script.patch

lib/mandatoryTests/mandatoryTest_6_1_30.js Outdated Show resolved Hide resolved
lib/mandatoryTests/mandatoryTest_6_1_31.js Outdated Show resolved Hide resolved
lib/mandatoryTests/mandatoryTest_6_1_33.js Outdated Show resolved Hide resolved
lib/mandatoryTests/mandatoryTest_6_1_21.js Outdated Show resolved Hide resolved
Copy link
Contributor

@tschmidtb51 tschmidtb51 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see my comments.

lib/mandatoryTests/mandatoryTest_6_1_33.js Outdated Show resolved Hide resolved
tests/shared/minimalSecurityAdvisoryDoc.js Outdated Show resolved Hide resolved
lib/mandatoryTests/mandatoryTest_6_1_21.js Outdated Show resolved Hide resolved
lib/mandatoryTests/mandatoryTest_6_1_33.js Outdated Show resolved Hide resolved
@domachine
Copy link
Contributor Author

Alright I addressed the issues and rebased the history.

valentinkoe
valentinkoe previously approved these changes Apr 6, 2022
Copy link
Contributor

@tschmidtb51 tschmidtb51 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor wording change suggested...

@domachine
Copy link
Contributor Author

Just a minor wording change suggested...

Fixed 🙂

@domachine domachine requested review from tschmidtb51 and removed request for cloeser April 6, 2022 14:01
Copy link
Contributor

@tschmidtb51 tschmidtb51 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@domachine domachine merged commit 3af8b69 into main Apr 6, 2022
@domachine domachine deleted the feat/csd02-mandatory-tests branch April 6, 2022 14:20
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.

Adopt 6.1.21 minimalSecurityAdvisoryDoc.js and minimalVexDoc.js invalid
3 participants