Skip to content

Commit

Permalink
Feature/setup tests (#711)
Browse files Browse the repository at this point in the history
* Add C1247485682-LARC_CLOUD

* remove ids

* add temp limit

* update cleanup

* remove temp limit


---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: jamesfwood <[email protected]>
Co-authored-by: James Wood <[email protected]>
  • Loading branch information
4 people authored Apr 26, 2024
1 parent 25f083e commit a147820
Show file tree
Hide file tree
Showing 12 changed files with 163 additions and 152 deletions.
25 changes: 10 additions & 15 deletions .github/workflows/diff.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run every third day starting from the 2nd of the month 1 am pacific
# check for new collection associations to the l2ss-py UMM-S record
# check for new collection associations to the concise UMM-S record
# in UAT and OPS. If a new association is found, a PR is opened to add the new collection concept id to the
# cmr/concise/*_associations.txt file.

Expand Down Expand Up @@ -33,21 +33,17 @@ jobs:
run: |
poetry install
ls $GITHUB_WORKSPACE/tests/cmr/concise/uat/ > $GITHUB_WORKSPACE/tests/cmr/concise/uat_associations.txt
ls $GITHUB_WORKSPACE/tests/cmr/concise/ops/ > $GITHUB_WORKSPACE/tests/cmr/concise/ops_associations.txt
ls $GITHUB_WORKSPACE/tests/cmr/concise/uat/ > uat_associations.txt
ls $GITHUB_WORKSPACE/tests/cmr/concise/ops/ > ops_associations.txt
poetry run cmr_association_diff -e uat -t service -p POCLOUD -n 'PODAAC Concise' -a $GITHUB_WORKSPACE/tests/cmr/concise/uat_associations.txt --token $UAT_TOKEN_TEMP > $GITHUB_WORKSPACE/tests/cmr/concise/new_uat_associations.txt
poetry run cmr_association_diff -e ops -t service -p POCLOUD -n 'PODAAC Concise' -a $GITHUB_WORKSPACE/tests/cmr/concise/ops_associations.txt --token $OPS_TOKEN_TEMP > $GITHUB_WORKSPACE/tests/cmr/concise/new_ops_associations.txt
poetry run cmr_association_diff -e uat -t service -p POCLOUD -n 'PODAAC Concise' -a uat_associations.txt --token $UAT_TOKEN_TEMP > new_uat_associations.txt
poetry run cmr_association_diff -e ops -t service -p POCLOUD -n 'PODAAC Concise' -a ops_associations.txt --token $OPS_TOKEN_TEMP > new_ops_associations.txt
echo "new_uat_associations=$(poetry run python tests/collection_names.py --env uat --token $UAT_TOKEN_TEMP --file $GITHUB_WORKSPACE/tests/cmr/concise/new_uat_associations.txt)" >> $GITHUB_OUTPUT
echo "new_ops_associations=$(poetry run python tests/collection_names.py --env ops --token $OPS_TOKEN_TEMP --file $GITHUB_WORKSPACE/tests/cmr/concise/new_ops_associations.txt)" >> $GITHUB_OUTPUT
echo "new_uat_associations=$(poetry run python tests/collection_names.py --env uat --token $UAT_TOKEN_TEMP --file new_uat_associations.txt)" >> $GITHUB_OUTPUT
echo "new_ops_associations=$(poetry run python tests/collection_names.py --env ops --token $OPS_TOKEN_TEMP --file new_ops_associations.txt)" >> $GITHUB_OUTPUT
rm $GITHUB_WORKSPACE/tests/cmr/concise/uat_associations.txt
rm $GITHUB_WORKSPACE/tests/cmr/concise/ops_associations.txt
rm $GITHUB_WORKSPACE/tests/cmr/concise/new_uat_associations.txt
rm $GITHUB_WORKSPACE/tests/cmr/concise/new_ops_associations.txt
rm *_associations.txt
open_pr_uat:
if: false
needs: find_new
strategy:
fail-fast: false
Expand Down Expand Up @@ -80,7 +76,7 @@ jobs:
delete-branch: true
title: UAT ${{ matrix.data.concept_id }} (${{ matrix.data.short_name }})
body: |
New association between l2ss-py and ${{ matrix.data.concept_id }} found in UAT.
New association between concise and ${{ matrix.data.concept_id }} found in UAT.
Beginning verification of collection.
labels: |
unverified
Expand All @@ -92,7 +88,6 @@ jobs:


open_pr_ops:
if: false
needs: find_new
strategy:
fail-fast: false
Expand Down Expand Up @@ -125,7 +120,7 @@ jobs:
delete-branch: true
title: OPS ${{ matrix.data.concept_id }} (${{ matrix.data.short_name }})
body: |
New association between l2ss-py and ${{ matrix.data.concept_id }} found in OPS.
New association between concise and ${{ matrix.data.concept_id }} found in OPS.
Beginning verification of collection.
labels: |
unverified
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/.idea/inspectionProfiles/Project_Default.xml
/.idea/.gitignore
/.idea/encodings.xml
/.idea/l2ss-py-autotest.iml
/.idea/concise-autotest.iml
/.idea/misc.xml
/.idea/modules.xml
/.idea/vcs.xml
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# l2ss-py-autotest
# concise-autotest

This repository contains functional/integration tests for l2ss-py. It also includes github
This repository contains functional/integration tests for concise. It also includes github
action workflows for automatically running these tests whenever a new collection gets
associated to the l2ss-py UMM-S record.
associated to the concise UMM-S record.

## How it works

Expand All @@ -17,7 +17,7 @@ associated to the l2ss-py UMM-S record.
## What to do if tests fail

If a test fails, meaning an assertion did not succeed, or an unknown error occurs action must be taken. The cause of the failure should be determined and fixed.
A failing test generally indicates an issue with either metadata or l2ss-py itself and may require additional steps.
A failing test generally indicates an issue with either metadata or concise itself and may require additional steps.
In some cases, the test may need to be updated to account for a unique edge case.

## What to do if tests are skipped
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[tool.poetry]
name = "l2ss-py-autotest"
name = "concise-autotest"
version = "0.1.0"
description = "Automated tests for new associations to l2ss-py service"
description = "Automated tests for new associations to concise service"
authors = ["PO.DAAC <[email protected]>"]
license = "Apache 2.0"
readme = "README.md"
packages = [{include = "l2ss_py_autotest"}]
packages = [{include = "concise_autotest"}]

[tool.poetry.dependencies]
python = "^3.9"
Expand Down Expand Up @@ -34,4 +34,4 @@ requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
cmr_association_diff = "l2ss_py_autotest.cmr_association_diff:run"
cmr_association_diff = "concise_autotest.cmr_association_diff:run"
1 change: 1 addition & 0 deletions tests/cmr/concise/ops/C1940473819-POCLOUD
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
C1940473819-POCLOUD
1 change: 1 addition & 0 deletions tests/cmr/concise/uat/C1234724470-POCLOUD
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
C1234724470-POCLOUD
2 changes: 1 addition & 1 deletion tests/collection_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def main():

parser = argparse.ArgumentParser(description="Get Collection Names from CMR")
parser.add_argument("--token", help="launchpad token")
parser.add_argument("--file", help="file with list of l2ss associations")
parser.add_argument("--file", help="file with list of concise associations")
parser.add_argument("--env", help="CMR environment")

args = parser.parse_args()
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def pytest_addoption(parser):

def pytest_generate_tests(metafunc):
if metafunc.config.option.regression:
cmr_dirpath = pathlib.Path('cmr')
cmr_dirpath = pathlib.Path('cmr/concise')

association_dir = 'uat' if metafunc.config.option.env == 'uat' else 'ops'
associations = os.listdir(cmr_dirpath.joinpath(association_dir))
Expand Down
2 changes: 1 addition & 1 deletion tests/remove_prs.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

# Replace these variables with your own values
repo_owner = 'podaac'
repo_name = 'l2ss-py-autotest'
repo_name = 'concise-autotest'
github_token = os.getenv("GITHUB_TOKEN")

# Initialize a Github instance
Expand Down
Loading

0 comments on commit a147820

Please sign in to comment.