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

Validate throws incorrect overlap error when first Field_Bit has length 1 #392

Closed
radiosci opened this issue Aug 25, 2021 · 4 comments Β· Fixed by #398 or #399
Closed

Validate throws incorrect overlap error when first Field_Bit has length 1 #392

radiosci opened this issue Aug 25, 2021 · 4 comments Β· Fixed by #398 or #399
Assignees
Labels
B12.0 bug Something isn't working s.medium

Comments

@radiosci
Copy link

πŸ› Describe the bug

πŸ“œ To Reproduce

Steps to reproduce the behavior:

  1. Unzip and untar the attached file
  2. Type 'validate test1.xml'
  3. See error

πŸ•΅οΈ Expected behavior

πŸ“š Version of Software Used

🩺 Test Data / Additional context

🏞Screenshots

πŸ–₯ System Info


πŸ¦„ Related requirements

βš™οΈ Engineering Details

@radiosci radiosci added bug Something isn't working needs:triage labels Aug 25, 2021
@jordanpadams jordanpadams changed the title <Validate> <throws incorrect overlap error> <when first Field_Bit has length 1> Validate throws incorrect overlap error when first Field_Bit has length 1 Aug 25, 2021
@jordanpadams
Copy link
Member

@radiosci we will take a look!

btw, per the template title, feel free to remove the < > to make it an actual sentence. but appreciate you trying to use the template! really helps us a lot in the triage and development workflow

@qchaupds
Copy link
Contributor

@radiosci Could you post the error message you got and the error you think you should get.

The current snapshot of validate today shows this message:

%validate -R pds4.label --skip-context-validation -r report_github392_label_valid.json -s json -t src/test/resources/github392/test1.xml > & t1

  "productLevelValidationResults": [
    {
      "status": "FAIL",
      "label": "file:/home/qchau/sandbox/validate/src/test/resources/github392/test1.xml",
      "messages": [],
      "fragments": [],
      "dataContents": [
        {
          "dataFile": "file:/home/qchau/sandbox/validate/src/test/resources/github392/test1.dat",
          "messages": [
            {
              "severity": "ERROR",
              "type": "error.table.field_value_overlap",
              "table": 1,
              "record": 1,
              "field": 5,
              "message": "This field overlaps the next field. Current field ends at 3. Next field starts at 3 but should be at least at 4"
            }
          ]
        }
      ]

@radiosci
Copy link
Author

Complete output from Validate run is below. It says the current field ends at 4, the next field starts at 3. I was expecting no error message.

rsimpson% validate test1.xml

PDS Validate Tool Report

Configuration:
Version 2.0.7
Date 2021-08-27T22:57:01Z

Parameters:
Targets [file:/Users/rsimpson/Data/DOCUMENT_BUNDLE/WORKING/DSN_REDR/VALIDATE_BUG/test1.xml]
Severity Level WARNING
Recurse Directories true
File Filters Used [*.xml, *.XML]
Data Content Validation on
Product Level Validation on
Max Errors 100000
Registered Contexts File /usr/local/validate-2.0.7/resources/registered_context_products.json

Product Level Validation Results

FAIL: file:/Users/rsimpson/Data/DOCUMENT_BUNDLE/WORKING/DSN_REDR/VALIDATE_BUG/test1.xml
Begin Content Validation: file:/Users/rsimpson/Data/DOCUMENT_BUNDLE/WORKING/DSN_REDR/VALIDATE_BUG/test1.dat
ERROR [error.table.field_value_overlap] table 1, record 1, field 5: This field overlaps the next field. Current field ends at 4. Next field starts at 3
End Content Validation: file:/Users/rsimpson/Data/DOCUMENT_BUNDLE/WORKING/DSN_REDR/VALIDATE_BUG/test1.dat
1 product validation(s) completed

Summary:

1 error(s)
0 warning(s)

Product Validation Summary:
0 product(s) passed
1 product(s) failed
0 product(s) skipped

Referential Integrity Check Summary:
0 check(s) passed
0 check(s) failed
0 check(s) skipped

Message Types:
1 error.table.field_value_overlap

End of Report
Completed execution in 5061 ms

@qchaupds
Copy link
Contributor

@radiosci Thank you. I think we have a solution. The label now validates OK.

Will check the code in soon.

qchaupds pushed a commit that referenced this issue Sep 1, 2021
1. Add test resource : src/test/resources/github392
2. Add logic to check for data_type of field before making the offset checks : src/main/java/gov/nasa/pds/tools/validate/content/table/FieldValueValidator.java
3. Add 3 new tests : src/test/resources/features/validate.feature

Refs:

#392 Validate throws incorrect overlap error when first Field_Bit has length 1
jordanpadams added a commit that referenced this issue Sep 9, 2021
Fix bug when checking for offset for fields that are not of BIT type
qchaupds pushed a commit that referenced this issue Sep 9, 2021
1. Use enum type defined in FieldType instead of hard-coded string : src/main/java/gov/nasa/pds/tools/validate/content/table/FieldValueValidator.java

Refs:

#392 Validate throws incorrect overlap error when first Field_Bit has length 1
jordanpadams added a commit that referenced this issue Sep 9, 2021
Use enum type defined in FieldType instead of hard-coded string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment