Skip to content

lc-gcr test and other improvements - #528

Open
richard-mladek wants to merge 5 commits into
ecmwf:developfrom
richard-mladek:feature/DGOV-513_lcgcr_new
Open

lc-gcr test and other improvements#528
richard-mladek wants to merge 5 commits into
ecmwf:developfrom
richard-mladek:feature/DGOV-513_lcgcr_new

Conversation

@richard-mladek

Copy link
Copy Markdown
Contributor

Description

https://jira.ecmwf.int/browse/ECC-2314

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

Comment thread samples/lc-gcr_sttd_grib2.tmpl Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please don't upload binary files to the repository.

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.

file deleted
Please take the test file from /perm/marm/sd/DGOV-513_lcgcr/convert/ok/lc-gcr_sttd_grib2.tmpl

@joobog joobog left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The test needs improvement

Comment thread tests/grib_lc-gcr.sh

. ./include.ctest.sh

grib2_sample=$ECCODES_SAMPLES_PATH/lc-gcr_sttd_grib2.tmpl

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Instead of using a new files, it should be possible to create new LCGCR file from GRIB2.tmpl sample, by setting corresponding keys using grib_set or grib_filter. It's also an important part of the test.

Another advantage of removing the dependency on a test file is that this test no longer needs to be in EXTRA_TESTS. It can be moved to the regular tests.

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 could see similar dedicated test files in the repo like for Destine. I would prefer to keep that new dedicated test file for LC-GCR (and even to add another similar one in the future)
Originally I started from GRIB2.tmpl but to add all details to get fully compliant lc-gcr file (passing grib-check) requires comprehensive grib_filter. Thus I rather created a test file with all that metadata already there, so that the test scripts is rather short and understandable, similar to other test scripts.

Comment thread tests/grib_lc-gcr.sh
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
#

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Description of the test is missing. Please add and fill the following:

# ---------------------------------------------------------
# This is the test for JIRA issue ECC-XXXX
# < Add issue summary here >
# ---------------------------------------------------------

Please note, you can use ./tests/create_test.sh script to create test templates.

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.

done

Comment thread definitions/grib2/products_lcgcr.def Outdated
Comment on lines +14 to +18
#if (modelName isnot "unknown") {
# concept modelVersion(unknown, "modelVersionConcept.[modelName].def", conceptsDir2, conceptsLocalDirAll): no_copy, dump, read_only;
# alias ls.model = modelName;
# alias mars.model = modelName;
#}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why do we need these comments?

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.

Older solution removed now.

Comment thread tests/grib_lc-gcr.sh Outdated


# Clean up
#rm -f $temp1 $temp2 $temp3 $tempLog

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This test is creating temporary data. Please clean up.

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.

fixed

Comment thread tests/CMakeLists.txt Outdated
grib_ecc-2254
grib_ecc-2264
grib_ecc-2265
grib_lc-gcr

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The test is using test data, but is located in basic checks. Tests, which depend on test data, which must be downloaded, must be located in extra tests.

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.

OK will fix it. Still my test worked even under standard tests..
Maybe amend FAQ for similar cases
https://confluence.ecmwf.int/spaces/ECC/pages/233246465/ecCodes+developer+FAQ+-+General#ecCodesdeveloperFAQGeneral-HowdoIaddanewtest?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants