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

Refactor setup_test_cache to allow for simply updating local cache #966

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ General
-------

- Removed python 3.8 check from ci.yml [#934]

- Removed references to ICD-47 in users guide [#936]

- translate 'ANY' as equal to '*' when selecting match rules in rmap changes. Prevents equal weight special case errors from occurring unnecessarily [#939]

- Refactor setup_test_cache to allow for simply updating local cache [#966]

JWST
----

Expand Down
13 changes: 8 additions & 5 deletions setup_test_cache
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#! /bin/sh -x
#! /bin/bash -x
usage="Usage: setup_test_cache CRDS_TEST_ROOT <c/u> where 'c' means clean and 'u' means update"
update=${2:-"c"}
export CRDS_TEST_ROOT=${1?$usage}

export CRDS_TEST_ROOT=$1

(cd $CRDS_TEST_ROOT; rm -rf crds-cache-test; git clone https://github.com/spacetelescope/crds-cache-test.git;)
(cd $CRDS_TEST_ROOT; rm -rf crds-cache-default-test; mkdir crds-cache-default-test;)
if [ "$update" = "c" ]; then
(cd $CRDS_TEST_ROOT; rm -rf crds-cache-test; git clone https://github.com/spacetelescope/crds-cache-test.git;)
Copy link
Collaborator

Choose a reason for hiding this comment

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

should be a '==', no?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks good otherwise.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nope, that is the way the [ operator works. Reference here. Yes, it is bash and opaque is the best description.

Copy link
Collaborator

@hbrown-ST hbrown-ST Sep 20, 2023

Choose a reason for hiding this comment

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

Ah interesting, I was looking at this page to make sure and saw

#!/bin/bash
# elif statements
if [ $1 -ge 18 ]
then
echo You may go to the party.
elif [ $2 == 'yes' ]
then
echo You may go to the party but be back before midnight.
else
echo You may not go to the party.
fi

as an example. If it works, it works.

(cd $CRDS_TEST_ROOT; rm -rf crds-cache-default-test; mkdir crds-cache-default-test;)
fi

export CRDS_PATH=$CRDS_TEST_ROOT/crds-cache-default-test
export CRDS_TESTING_CACHE=$CRDS_TEST_ROOT/crds-cache-test
Expand Down
Loading