Skip to content

ACES-11360 Fix Int Test: ISO 19115 roundtrip strips trailing whitespace from Quality.QualityContentDetails.Strengths - #2461

Merged
jaortega527 merged 4 commits into
masterfrom
CMR-11360
Jul 21, 2026
Merged

ACES-11360 Fix Int Test: ISO 19115 roundtrip strips trailing whitespace from Quality.QualityContentDetails.Strengths#2461
jaortega527 merged 4 commits into
masterfrom
CMR-11360

Conversation

@jaortega527

@jaortega527 jaortega527 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Overview

What is the objective?

This PR addresses where ISO 19115 roundtrips were silently removing trailing whitespace from QualityContentDetails.Strengths (and similar terminal quality detail fields) by aligning expected normalization to trim-based behavior.

What are the changes?

  • Updated test helper expected-quality in umm-spec-lib/src/cmr/umm_spec/test/iso_shared.clj to:

    • trim each :QualityContentDetails value
    • remove empty/nil detail values
    • remove :QualityContentDetails when empty after normalization
  • Updated XML→UMM quality unit tests to match trim-normalized behavior and removed redundant edge-whitespace cases.

  • Updated UMM→XML quality unit test expectation to match normalized serialized output behavior.

  • Updated seeded generative roundtrip test in umm-spec-lib/test/cmr/umm_spec/test/generate_and_parse.clj from 1496683985472 to 1783446834701 for deterministic reproduction of the original issue.

What areas of the application does this impact?

  • umm-spec-lib

Required Checklist

  • New and existing unit and int tests pass locally and remotely
  • clj-kondo has been run locally and all errors in changed files are corrected
  • I have commented my code, particularly in hard-to-understand areas
  • I have made changes to the documentation (if necessary)
  • My changes generate no new warnings

Additional Checklist

  • I have removed unnecessary/dead code and imports in files I have changed
  • I have cleaned up integration tests by doing one or more of the following:
    • migrated any are2 tests to are3 in files I have changed
    • de-duped, consolidated, removed dead int tests
    • transformed applicable int tests into unit tests
    • reduced number of system state resets by updating fixtures. Ex) (use-fixtures :each (ingest/reset-fixture {})) to be :once instead of :each

@jaortega527
jaortega527 marked this pull request as ready for review July 14, 2026 13:20
@codecov-commenter

codecov-commenter commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.91%. Comparing base (73533d2) to head (838fb8b).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2461   +/-   ##
=======================================
  Coverage   57.90%   57.91%           
=======================================
  Files        1073     1073           
  Lines       74616    74623    +7     
  Branches     2169     2167    -2     
=======================================
+ Hits        43209    43217    +8     
- Misses      29379    29380    +1     
+ Partials     2028     2026    -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jaortega527 jaortega527 changed the title [ACES-11360] Fix Int Test: ISO 19115 roundtrip strips trailing whitespace from Quality.QualityContentDetails.Strengths ACES-11360 Fix Int Test: ISO 19115 roundtrip strips trailing whitespace from Quality.QualityContentDetails.Strengths Jul 15, 2026
Comment thread umm-spec-lib/src/cmr/umm_spec/umm_to_xml_mappings/iso_shared/quality.clj Outdated
Comment thread umm-spec-lib/src/cmr/umm_spec/xml_to_umm_mappings/iso_shared/quality.clj Outdated
;; expected output with the result of the actual conversions. This test runs a record
;; through all of the supported formats.
(deftest roundtrip-generated-collection-records-with-seed
(checking-with-seed "collection round tripping seed" 100 1496683985472

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I am willing to remove this change. I changed the value to the seed value that reproduces the issue.

@eereiter eereiter Jul 16, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, the original seed number also tested a specific issue from years ago. I think I am OK leaving it here as is or removing the checking-with-seed, but if we do remove this test, document on line 216 how to add a seed number because I won't remember how to do it when the time comes to use a different seed number to reproduce an error. With this test and the one above, 200 tests are run using "random" values in the schema elements. It just seems excessive to use 100 different tests, but on the other hand the tests "catch" these types of issues - although now we are coding to the test and not necessarily what the end user cares about.

Comment thread umm-spec-lib/src/cmr/umm_spec/xml_to_umm_mappings/iso_shared/quality.clj Outdated

@eereiter eereiter left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should "fix" this issue in the expected conversion test code.

…ed quality detail fields by restoring the raw content if parsing trim caused whitespace loss.
…so trimmed quality details like Strength are expected to be trimmed.
@jaortega527
jaortega527 merged commit 83f95c5 into master Jul 21, 2026
6 checks passed
@jaortega527
jaortega527 deleted the CMR-11360 branch July 21, 2026 13:31
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.

4 participants