-
Notifications
You must be signed in to change notification settings - Fork 1
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
153-End to End build test. #266
Merged
Merged
Changes from 14 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
aeb978e
Updated functions in cli.py to use argv[Optional[Sequence[str]] inste…
charles-turner-1 9e785f4
Skeleton of e2e test
charles-turner-1 6206a7e
Peelin apart argparse for e2e test
charles-turner-1 a4aab12
Pass build in using argparse
charles-turner-1 c7efe95
End to end build test working - now to add queries
charles-turner-1 1f4feea
Pre-commit
charles-turner-1 02fdd23
Updated workflow to only run tests in 'tests' dir
charles-turner-1 e194ead
Lots of tests working - mostly just the content tests to finish
charles-turner-1 be30446
Pre-commit
charles-turner-1 37d3a68
End to end test done & working. Now just needs a workflow trigger
charles-turner-1 436676a
formatting
charles-turner-1 9be91f3
Merge branch 'main' into 153-e2e
charles-turner-1 1d69c30
Removed unused build_subset.sh file
charles-turner-1 5071f0b
Merge branch '153-e2e' of https://github.com/ACCESS-NRI/access-nri-in…
charles-turner-1 6511acc
Removed some redundant stuff (Marc's comments)
charles-turner-1 ab511ab
Moved end to end test into tests dir (yet to see if we can get it all…
charles-turner-1 efd3fcd
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 7a56289
Added workflow & shell script to submit it to Gadi
charles-turner-1 b91d1df
Clean up test file (remove unused string, etc etc)
charles-turner-1 823613b
Clean up test file (remove unused string, scope=session => module)
charles-turner-1 d7715be
Merge branch '153-e2e' of https://github.com/ACCESS-NRI/access-nri-in…
charles-turner-1 04d14c4
Merge branch 'main' into 153-e2e
charles-turner-1 40918c0
Added reference to e2e tests in docs
charles-turner-1 96b88a6
Merge branch '153-e2e' of https://github.com/ACCESS-NRI/access-nri-in…
charles-turner-1 dd8c090
Cleaned up fixture, removed redundant second conftest.py, fixed confi…
charles-turner-1 268c98f
Cleaning up a few tests where mocks no longer necessary
charles-turner-1 a63bdab
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 4629f27
Merge remote-tracking branch 'origin/main' into 153-e2e
marc-white 54abc39
Fixed workflow trigger & type hint that disappeared
charles-turner-1 6d543fd
Pre-commit
charles-turner-1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
builder: AccessOm2Builder | ||
|
||
translator: DefaultTranslator | ||
|
||
sources: | ||
|
||
- metadata_yaml: /g/data/ik11/outputs/access-om2/1deg_jra55_ryf9091_gadi/metadata.yaml | ||
path: | ||
- /g/data/ik11/outputs/access-om2/1deg_jra55_ryf9091_gadi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
builder: null | ||
|
||
translator: Cmip5Translator | ||
|
||
sources: | ||
|
||
- metadata_yaml: /g/data/xp65/admin/access-nri-intake-catalog/config/metadata_sources/cmip5-al33/metadata.yaml | ||
path: | ||
- /g/data/al33/catalog/v2/esm/catalog.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# Copyright 2023 ACCESS-NRI and contributors. See the top-level COPYRIGHT file for details. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
import os | ||
import warnings | ||
from datetime import datetime | ||
from pathlib import Path | ||
|
||
from pytest import fixture | ||
|
||
here = os.path.abspath(os.path.dirname(__file__)) | ||
|
||
|
||
def _get_xfail(): | ||
""" | ||
Get the XFAILS environment variable. We use a default of 1, indicating we expect | ||
to add xfail marker to `test_parse_access_ncfile[AccessOm2Builder-access-om2/output000/ocean/ocean_grid.nc-expected0-True]` | ||
unless specified. | ||
""" | ||
xfails_default = 1 | ||
|
||
try: | ||
return int(os.environ["XFAILS"]) | ||
except KeyError: | ||
warnings.warn( | ||
message=( | ||
"XFAILS enabled by default as coordinate discovery disabled by default. " | ||
"This will be deprecated when coordinate discovery is enabled by default" | ||
), | ||
category=PendingDeprecationWarning, | ||
) | ||
return xfails_default | ||
|
||
|
||
_add_xfail = _get_xfail() | ||
|
||
|
||
@fixture(scope="session") | ||
def test_data(): | ||
return Path(os.path.join(here, "data")) | ||
|
||
|
||
@fixture(scope="session") | ||
def BASE_DIR(tmp_path_factory): | ||
yield tmp_path_factory.mktemp("catalog-dir") | ||
|
||
|
||
@fixture(scope="session") | ||
def v_num(): | ||
return datetime.now().strftime("v%Y-%m-%d") | ||
|
||
|
||
def pytest_collection_modifyitems(config, items): | ||
""" | ||
This function is called by pytest to modify the items collected during test | ||
collection. We use it here to mark the xfail tests in | ||
test_builders::test_parse_access_ncfile when we check the file contents & to | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above |
||
ensure we correctly get xfails if we don't have cordinate discovery enabled | ||
in intake-esm. | ||
""" | ||
for item in items: | ||
if ( | ||
item.name | ||
in ( | ||
"test_parse_access_ncfile[AccessOm2Builder-access-om2/output000/ocean/ocean_grid.nc-expected0-True]", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above |
||
) | ||
and _add_xfail | ||
): | ||
item.add_marker("xfail") |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably should be updated to reference which test a value of
1
will point to.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good spot