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

Cucumber test cases for B15.0 I&T #1026

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
58 changes: 58 additions & 0 deletions src/test/resources/features/integration.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Feature: Running integration tests for validate module

Scenario Outline: Execute validate command for tests below.
Given a test <testName> at dir <testDir> at resource <resourceDir> sending report to <reportDir> with <commandArgs> as arguments
When with test property count <messageCount> text <messageText> problem <problemEnum> reference <refOutputValue>
When execute a validate command
Then produced output from validate command should be similar to reference <refOutputValue> or no error reported.

@v3.6.0
Examples:
| testName | testDir | messageCount | messageText | problemEnum | resourceDir | reportDir | commandArgs | refOutputValue |

# In .csv, Line1 good; L2,Field1=11.111 for %6.2f; L3,F2=22.22 for $4.2f; L4,F3=33333333 (no 'e') for %8.3e; L5,F4=4.4 for %3d
#|"NASA-PDS/validate#816 Throw WARNING for unmatched field_format in table char" | "github816" | 5 | "1 errors expected, 4 warnings expected" | "FIELD_VALUE_FORMAT_PRECISION_MISMATCH,FIELD_VALUE_TOO_LONG,FIELD_VALUE_FORMAT_SPECIFIER_MISMATCH,FIELD_VALUE_DATA_TYPE_MISMATCH,FIELD_VALUE_FORMAT_SPECIFIER_MISMATCH" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github816a.json -s json -t {resourceDir}/github816/ff_char.xml" | "report_github816a.json" |
|"NASA-PDS/validate#816 Throw WARNING for unmatched field_format in delimited" | "github816" | 5 | "1 errors expected, 4 warnings expected" | "FIELD_VALUE_FORMAT_PRECISION_MISMATCH,FIELD_VALUE_TOO_LONG,FIELD_VALUE_FORMAT_SPECIFIER_MISMATCH,FIELD_VALUE_DATA_TYPE_MISMATCH" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github816b.json -s json -t {resourceDir}/github816/ff_del.xml" | "report_github816b.json" |

# validate3.4.1 reported 0 errors or warnings.
|"NASA-PDS/validate#822 check for unlabeled files" | "github822" | 1 | "1 errors expected" | "UNLABELED_FILE" | "src/test/resources" | "target/test" | "-R pds4.bundle -r {reportDir}/report_github822.json -s json -t {resourceDir}/github822" | "report_github822.json" |

# validate3.4.1 reported ~10 fatal errors
|"NASA-PDS/validate#823 clear file read errors" | "github823" | 0 | "0 errors expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github823.json -s json -t {resourceDir}/github823/mvn_swi_l2_onboardsvymom_20230827_v02_r01.xml" | "report_github823.json" |

# validate3.4.1 complained about not PDF/A-1b even though Product_Document
|"NASA-PDS/validate#824 clear file read errors" | "github824" | 0 | "0 errors expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github824.json -s json -t {resourceDir}/github824/1203_12.xml" | "report_github824.json" |

# validate3.4.1 WARNs that 3 values are below min even though they match other constants
|"NASA-PDS/validate#831 Check specific constants before min or max constants" | "github831" | 0 | "0 errors expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github831.json -s json -t {resourceDir}/github831/kplo.xml" | "report_github831.json" |

# someday line 3 in data (or line 88 of .xml) may reasonably throw an error for bad format
|"NASA-PDS/validate#837 Check constants before data_type" | "github837" | 0 | "0 errors expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github837.json -s json -t {resourceDir}/github837/x.xml" | "report_github837.json" |

# validate3.4.1 froze on this
|"NASA-PDS/validate#849 Stalls when collection.csv has duplicates" | "github849" | 2 | "2 errors expected" | "INVENTORY_DUPLICATE_LIDVID" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github849.json -s json -t {resourceDir}/github849/collection.xml" | "report_github849.json" |

# previous versions gave no errors or warnings, which is bad
|"NASA-PDS/validate#857 WARNING when Observing_System_Component.name mismatches context product" | "github857" | 2 | "2 warnings expected" | "CONTEXT_REFERENCE_FOUND_MISMATCH_WARN" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github857.json -s json -t {resourceDir}/github857/highi_183_istria_fam3.xml" | "report_github857.json" |

# validate3.4.1 gave no errors or warnings
|"NASA-PDS/validate#861 WARNING when Observing_System_Component.name mismatches context product" | "github861" | 1 | "1 warnings expected" | "CONTEXT_REFERENCE_FOUND_MISMATCH_WARN" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github861.json -s json -t {resourceDir}/github861/PVO_OMAG_OEFD_ANC_ENG_0001.xml" | "report_github861.json" |

# target is parent directory, not either subdir. validate3.4.1 threw ERROR
|"NASA-PDS/validate#873 Allow same filenames in different subdirs" | "github873" | 0 | "0 errors expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github873.json -s json -t {resourceDir}/github873/." | "report_github873.json" |

# same as github873
|"NASA-PDS/validate#902 Allow same filenames in different subdirs" | "github902" | 0 | "0 errors expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github902.json -s json -t {resourceDir}/github902/s_00168901_thm.xml" | "report_github902.json" |

# validate3.4.1 throws incorrect ERROR
|"NASA-PDS/validate#905 Allow multiple Product_Documents to point to same file" | "github905" | 0 | "0 errors expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github905.json -s json -t {resourceDir}/github905/." | "report_github905.json" |

# validate3.4.1 context_ref_mismatch fires only if -R pds4.label is specified
|"NASA-PDS/validate#915 Allow multiple Product_Documents to point to same file" | "github915" | 3 | "3 warnings expected" | "CONTEXT_REFERENCE_FOUND_MISMATCH_WARN" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github915.json -s json -R pds4.collection -t {resourceDir}/github915" | "report_github915.json" |

# validate3.4.1: Error while getting field value: Bit field spans bytes that are wider than a long (9 > 8)
|"NASA-PDS/validate#919 make --disable-context-mismatch-warnings work generally" | "github919" | 0 | "0 errors expected" | "totalErrors" | "src/test/resources" | "target/test" | "-r {reportDir}/report_github919.json -s json -t {resourceDir}/github919/uh0003b_draft.xml" | "report_github919.json" |

# No old version of validate of mine had this error. Eh, too bad
|"NASA-PDS/validate#950 make --disable-context-mismatch-warnings work generally" | "github950" | 0 | "0 errors expected" | "totalErrors" | "src/test/resources" | "target/test" | "--disable-context-mismatch-warnings -R pds4.bundle -r {reportDir}/report_github950.json -s json -t {resourceDir}/github950" | "report_github950.json" |

82 changes: 82 additions & 0 deletions src/test/resources/github816/ff_char.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1K00.sch" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<Product_Observational xmlns="http://pds.nasa.gov/pds4/pds/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pds.nasa.gov/pds4/pds/v1 https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1K00.xsd">
<Identification_Area>
<logical_identifier>urn:nasa:pds:bundle:collection:ff_char_test</logical_identifier>
<version_id>1.0</version_id>
<title>Field Format Character Test</title>
<information_model_version>1.20.0.0</information_model_version>
<product_class>Product_Observational</product_class>
</Identification_Area>
<Observation_Area>
<Time_Coordinates>
<start_date_time>2023Z</start_date_time>
<stop_date_time>2023Z</stop_date_time>
</Time_Coordinates>
<Investigation_Area>
<name>No Specific Investigation</name>
<type>Individual Investigation</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:investigation:individual.none</lid_reference>
<reference_type>data_to_investigation</reference_type>
</Internal_Reference>
</Investigation_Area>
<Observing_System>
<Observing_System_Component>
<name>telescope</name>
<type>Instrument</type>
</Observing_System_Component>
</Observing_System>
<Target_Identification>
<name>target</name>
<type>Comet</type>
</Target_Identification>
</Observation_Area>
<File_Area_Observational>
<File>
<file_name>ff_test.csv</file_name>
</File>
<Table_Character>
<offset unit="byte">0</offset>
<records>5</records>
<record_delimiter>Carriage-Return Line-Feed</record_delimiter>
<Record_Character>
<fields>4</fields>
<groups>0</groups>
<record_length unit="byte">27</record_length>
<Field_Character>
<name>field 1</name>
<field_number>1</field_number>
<field_location unit="byte">1</field_location>
<data_type>ASCII_Real</data_type>
<field_length unit="byte">6</field_length>
<field_format>%6.2f</field_format>
</Field_Character>
<Field_Character>
<name>field 2</name>
<field_number>2</field_number>
<field_location unit="byte">8</field_location>
<data_type>ASCII_Real</data_type>
<field_length unit="byte">5</field_length>
<field_format>%4.2f</field_format>
</Field_Character>
<Field_Character>
<name>field 3</name>
<field_number>3</field_number>
<field_location unit="byte">14</field_location>
<data_type>ASCII_Real</data_type>
<field_length unit="byte">8</field_length>
<field_format>%8.3e</field_format>
</Field_Character>
<Field_Character>
<name>field 4</name>
<field_number>3</field_number>
<field_location unit="byte">23</field_location>
<data_type>ASCII_Integer</data_type>
<field_length unit="byte">3</field_length>
<field_format>%3d</field_format>
</Field_Character>
</Record_Character>
</Table_Character>
</File_Area_Observational>
</Product_Observational>
75 changes: 75 additions & 0 deletions src/test/resources/github816/ff_del.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1K00.sch" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<Product_Observational xmlns="http://pds.nasa.gov/pds4/pds/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pds.nasa.gov/pds4/pds/v1 https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1K00.xsd">
<Identification_Area>
<logical_identifier>urn:nasa:pds:bundle:collection:ff_del_test</logical_identifier>
<version_id>1.0</version_id>
<title>Field Format Delimited Test</title>
<information_model_version>1.20.0.0</information_model_version>
<product_class>Product_Observational</product_class>
</Identification_Area>
<Observation_Area>
<Time_Coordinates>
<start_date_time>2023Z</start_date_time>
<stop_date_time>2023Z</stop_date_time>
</Time_Coordinates>
<Investigation_Area>
<name>No Specific Investigation</name>
<type>Individual Investigation</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:investigation:individual.none</lid_reference>
<reference_type>data_to_investigation</reference_type>
</Internal_Reference>
</Investigation_Area>
<Observing_System>
<Observing_System_Component>
<name>telescope</name>
<type>Instrument</type>
</Observing_System_Component>
</Observing_System>
<Target_Identification>
<name>target</name>
<type>Comet</type>
</Target_Identification>
</Observation_Area>
<File_Area_Observational>
<File>
<file_name>ff_test.csv</file_name>
</File>
<Table_Delimited>
<offset unit="byte">0</offset>
<parsing_standard_id>PDS DSV 1</parsing_standard_id>
<records>5</records>
<record_delimiter>Carriage-Return Line-Feed</record_delimiter>
<field_delimiter>Comma</field_delimiter>
<Record_Delimited>
<fields>4</fields>
<groups>0</groups>
<Field_Delimited>
<name>field 1</name>
<field_number>1</field_number>
<data_type>ASCII_Real</data_type>
<field_format>%6.2f</field_format>
</Field_Delimited>
<Field_Delimited>
<name>field 2</name>
<field_number>2</field_number>
<data_type>ASCII_Real</data_type>
<field_format>%4.2f</field_format>
</Field_Delimited>
<Field_Delimited>
<name>field 3</name>
<field_number>3</field_number>
<data_type>ASCII_Real</data_type>
<field_format>%8.3e</field_format>
</Field_Delimited>
<Field_Delimited>
<name>field 4</name>
<field_number>4</field_number>
<data_type>ASCII_Integer</data_type>
<field_format>%3d</field_format>
</Field_Delimited>
</Record_Delimited>
</Table_Delimited>
</File_Area_Observational>
</Product_Observational>
5 changes: 5 additions & 0 deletions src/test/resources/github816/ff_test.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
111.11,22.2 ,3.333e33,444
11.111,2.22 ,3.333e3 ,444
111.11,22.22,3.333e3 ,444
111.11, 2.22,33333333,444
111.11, 2.22,3.333e3 ,4.4
76 changes: 76 additions & 0 deletions src/test/resources/github822/bundle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-model
href="https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1J00.sch"
schematypens="http://purl.oclc.org/dsdl/schematron"?>
<?xml-model
href="https://pds.nasa.gov/pds4/ctli/v1/PDS4_CTLI_1G00_1200.sch"
schematypens="http://purl.oclc.org/dsdl/schematron"?>
<Product_Bundle
xmlns="http://pds.nasa.gov/pds4/pds/v1"
xmlns:ctli="http://pds.nasa.gov/pds4/ctli/v1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://pds.nasa.gov/pds4/pds/v1
https://pds.nasa.gov/pds4/pds/v1/PDS4_PDS_1J00.xsd
http://pds.nasa.gov/pds4/ctli/v1
https://pds.nasa.gov/pds4/ctli/v1/PDS4_CTLI_1G00_1200.xsd">
<Identification_Area>
<logical_identifier>urn:nasa:pds:clps_to_2ab_pll.pitms</logical_identifier>
<version_id>1.0</version_id>
<title> CLPS Task Order 2AB Peregrine Ion-Trap Mass Spectrometer (PITMS) for Lunar Surface Volatiles</title>
<information_model_version>1.19.0.0</information_model_version>
<product_class>Product_Bundle</product_class>
<Citation_Information>
<author_list>Cohen, Barbara</author_list>
<publication_year>2024</publication_year>
<!-- <doi> </doi> -->
<description> This bundle contains the data collected by the Peregine Ion Trap Mass Spectormeter aboard the Peregrine lander, along with the documents and other information necessary for the interpretation of that data. </description>
</Citation_Information>
<Modification_History>
<Modification_Detail>
<modification_date>2024-06-10</modification_date>
<version_id>1.0</version_id>
<description>Initial version.</description>
</Modification_Detail>
</Modification_History>
</Identification_Area>
<Context_Area>
<Investigation_Area>
<name>CLPS Task Order 2AB</name>
<type>Mission</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:investigation:mission.clps_to_2ab</lid_reference>
<reference_type>bundle_to_investigation</reference_type>
</Internal_Reference>
</Investigation_Area>
<Observing_System>
<name>PITMS onboard the Peregrine Lunar Lander</name>
<Observing_System_Component>
<name>CLPS Task Order 2 AB Peregrine Lunar Lander</name>
<type>Host</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:instrument_host:spacecraft.clps_to_2ab_pll</lid_reference>
<reference_type>is_instrument_host</reference_type>
</Internal_Reference>
</Observing_System_Component>
</Observing_System>
<Target_Identification>
<name>Moon</name>
<type>Satellite</type>
<Internal_Reference>
<lid_reference>urn:nasa:pds:context:target:satellite.earth.moon</lid_reference>
<reference_type>collection_to_target</reference_type>
</Internal_Reference>
</Target_Identification>
</Context_Area>
<Bundle>
<bundle_type>Archive</bundle_type>
</Bundle>

<Bundle_Member_Entry>
<lid_reference>urn:nasa:pds:clps_to_2ab_pll.pitms:data_raw</lid_reference>
<member_status>Primary</member_status>
<reference_type>bundle_has_data_collection</reference_type>
</Bundle_Member_Entry>

</Product_Bundle>
Empty file.
2 changes: 2 additions & 0 deletions src/test/resources/github822/data_raw/PITMS_RAW_AUX.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
TIME,PITMS_PACKET_ID,PACKET_COUNT,PACKET_LENGTH,TIME_IN_SECONDS,FRACTIONS_OF_SECONDS,OPERATING_FREQUENCY,VOLTS_PER_AMU,DAC_SCALING_GRADIENT,DAC_SCALING_INTERCEPT,START_SCALING,FINAL_SCALING,CALCULATED_DAC_SCALING_GRADIENT,CALCULATED_DAC_SCALING_INTERCEPT,CALCULATED_OPERATING_FREQUENCY,CALCULATED_VOLTS_PER_AMU,CALIBRATION_APPLIED,SCIENCE_SEQUENCE_NUMBER,SCAN_FUNCTION_NUMBER,
2024-01-09T18:36:19Z,388,49152,193,1446,445,592000,2.102783,10.226335,886.992493,930.000000,3790.000000,10.226335,886.992493,592000,2.102783,1,1,1
Loading
Loading