Skip to content

Commit

Permalink
Merge pull request #142 from UN-OCHA/test-fixes
Browse files Browse the repository at this point in the history
Fix test shell script
  • Loading branch information
Pl217 authored Mar 21, 2024
2 parents c119045 + d802466 commit 5ae2e58
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
16 changes: 8 additions & 8 deletions bin/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ where:
KEEP=0
FORCE_STOP_JEST='--forceExit'
ONLY_CONTAINERS=0
STOP_CONTAINERS=0
COMMAND_ARGS=''

function moveToTestDir {
Expand Down Expand Up @@ -52,21 +53,20 @@ while [ "$1" != "" ]; do
shift
done

# ONLY_CONTAINERS must be 1 and STOP_CONTAINERS must be 0
if [ $ONLY_CONTAINERS -eq 1 ] && [ "$STOP_CONTAINERS" -eq 1 ]; then
echo "$USAGE"
exit 1
fi

# STOP_CONTAINERS is a final option
if [ "$STOP_CONTAINERS" -eq 1 ]; then
if [[ "$STOP_CONTAINERS" -eq 1 ]]; then
echo 'Stopping Docker containers'
moveToTestDir
docker compose down
exit 0
fi

# ONLY_CONTAINERS must be 1 and STOP must be 0
if [ $ONLY_CONTAINERS -eq 1 ] && [ "$STOP" -eq 1 ]; then
echo 'Invalid options - when using option -oc, option -ns must be used as well'
echo "$USAGE"
exit 1
fi

echo 'Starting Docker containers'
moveToTestDir
docker compose up -d
Expand Down
2 changes: 1 addition & 1 deletion tests/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ services:
- POSTGRES_USER=postgres
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- ./migration/schema-2024-02-29.sql:/docker-entrypoint-initdb.d/init.sql
- ./migration/schema-2024-03-13.sql:/docker-entrypoint-initdb.d/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2772,8 +2772,7 @@ CREATE TABLE public."planVersion" (
"updatedAt" timestamp with time zone NOT NULL,
"lastPublishedReportingPeriodId" integer,
"clusterSelectionType" character varying(255),
"isDisaggregationVisibleForCaseloads" boolean DEFAULT true,
"isDisaggregationVisibleForIndicators" boolean DEFAULT true
"visibilityPreferences" jsonb DEFAULT '{"isDisaggregationForCaseloads": true, "isDisaggregationForIndicators": true}'::jsonb NOT NULL
);


Expand Down

0 comments on commit 5ae2e58

Please sign in to comment.