Skip to content

Commit

Permalink
Merge pull request #165 from lsst/tickets/DM-35544
Browse files Browse the repository at this point in the history
DM-35544: Fix test for existing environment.
  • Loading branch information
ktlim committed Jul 12, 2022
2 parents 9b7fa8b + 93b208c commit a7b00e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 1 addition & 8 deletions scripts/lsstinstall
Original file line number Diff line number Diff line change
Expand Up @@ -274,14 +274,7 @@ fi
rubinenv_name=${rubinenv_name:-lsst-scipipe-$rubinenv_version}
[ "$exact" = true ] && [ -z "$env_hash" ] && rubinenv_name="${rubinenv_name}-exact"

use_existing=false
if [ -z "$dryrun" ] && conda info --envs --json | grep "\"$rubinenv_name\"" > /dev/null 2>&1; then
use_existing=true
fi
if [ -n "$dryrun" ] && [ -d "$conda_path/envs/$rubinenv_name" ]; then
use_existing=true
fi
if [ "$use_existing" = true ]; then
if [ -d "$conda_path/envs/$rubinenv_name" ]; then
echo "Using existing environment $rubinenv_name"
if [ "$update" = true ] && [ "$exact" != true ] && [ -z "$env_hash" ]; then
echo "Updating rubin-env=$rubinenv_version"
Expand Down
2 changes: 2 additions & 0 deletions test-lsstinstall.bash
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ testdir=./testconda$$
./scripts/lsstinstall -n | grepf '\$ mamba create '

mkdir -p "$testdir"/envs/foo-lsst
./scripts/lsstinstall -n -e foo-lsst | grepf 'Using existing environment foo-lsst'
./scripts/lsstinstall -n -e foo-lsst | xfail grep 'Updating rubin-env='
./scripts/lsstinstall -n -u -e foo-lsst | grepf 'Updating rubin-env='

rm -rf "$testdir"
Expand Down

0 comments on commit a7b00e9

Please sign in to comment.