Skip to content

Commit

Permalink
Create contribute.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanpadams committed Sep 4, 2024
1 parent 25f83ea commit 3cc2029
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/site/markdown/developer/contribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Contribute

## Adding New Test Cases

### Pre-requisites
* Eclipse installed (`brew cask install eclipse-java`)
* maven installed (`brew install maven`)
* Cloned validate repo

### Procedure
* Create new directory with test data src/test/resources/github123
* Add new line(s) for test cases to src/test/resources/features/v3.6.0.feature
* testName - title for the test, e.g. `NASA-PDS/validate#693 Invalid PDF/A Checks`, `NASA-PDS/validate#693 Valid PDF/A File Checks`
* testDir - `github123`
* messageCount - number of expected errors or warnings
* messageText - the expected output should match very closely to messageCount, e.g. `4 errors expected`, `8 warnings expected` (not sure how this is really used or why we have this right now...)
* problemEnum - `totalErrors`, `totalWarnings`, or specific error you expect from validate output
* for specific error, search `src/main/java/gov/nasa/pds/tools/validate/ProblemType.java` for the error identifier, and put the all caps value in the file, e.g. for `error.pdf.file.not_pdfa_compliant`, if I search the file I see this line `NON_PDFA_FILE("error.pdf.file.not_pdfa_compliant")`, so the problemEnum value == `NON_PDFA_FILE`
* resourceDir - always `src/test/resources`
* reportDir - always `target/test`
* commandArgs - at minimum, the following must be specified:
* `--report-style json`
* `--report-file {reportDir}/report_github123.json`
* `--target {resourceDir}/github123/myfile.xml` (could also just point to a directory or a regex or --target-manifest instead)
* refOutputValue - same filename as the `--report-file` specified above
* Now run the test(s):
* Via Eclipse: right-click `Run as` -> `Cucumber Feature`
* Via Maven: `mvn test -Dtest=\!ReferenceIntegrityTest* -Dcucumber.filter.tags='@v3.6.0'` (this now skips that long test and only runs the tests in that file)

0 comments on commit 3cc2029

Please sign in to comment.