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

Be consistent and safe in our bash options. #184

Merged
merged 4 commits into from
Dec 14, 2023
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
2 changes: 1 addition & 1 deletion bin/run-all-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -eo pipefail
set -euxo pipefail

BIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_DIR="${BIN_DIR%/*}"
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -eux pipefail
set -euxo pipefail

function wait_until_service_healthy() {
while ! docker ps | grep "$1" | grep -q healthy ;do
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ services:
environment:
POSTGRES_USER: ${PIXL_DB_USER}
POSTGRES_PASSWORD: ${PIXL_DB_PASSWORD}
PIXL_DB_NAME: ${PIXL_DB_NAME}
POSTGRES_DB: ${PIXL_DB_NAME}
PGTZ: Europe/London
env_file:
- ./docker/common.env
Expand Down
2 changes: 1 addition & 1 deletion pixl_dcmd/bin/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -eo pipefail
set -euxo pipefail

BIN_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
PACKAGE_DIR="${BIN_DIR%/*}"
Expand Down
2 changes: 1 addition & 1 deletion pixl_ehr/tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ services:
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
PIXL_DB_NAME: pixl
POSTGRES_DB: pixl
PGTZ: Europe/London
PIXL_DB_EHR_SCHEMA_NAME: emap_data
env_file:
Expand Down
8 changes: 2 additions & 6 deletions postgres/pixl-db_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set -o nounset

psql -U "${POSTGRES_USER}" -tc "SELECT 1 FROM pg_database WHERE datname = '${PIXL_DB_NAME}'" |\
grep -q 1 | \
psql -U "${POSTGRES_USER}" -c "CREATE DATABASE ${PIXL_DB_NAME}"
set -euxo pipefail

# Create the EHR schema and associated tables
columns_and_types="mrn text, accession_number text, age integer, sex text, ethnicity text, height real, weight real, gcs integer, xray_report text"
ehr_create_command="CREATE SCHEMA emap_data AUTHORIZATION ${POSTGRES_USER}
CREATE TABLE ehr_raw ($columns_and_types)
CREATE TABLE ehr_anon ($columns_and_types)
"
psql -U "${POSTGRES_USER}" --dbname "${PIXL_DB_NAME}" -c "$ehr_create_command"
psql -U "${POSTGRES_USER}" --dbname "${POSTGRES_DB}" -c "$ehr_create_command"
2 changes: 1 addition & 1 deletion test/run-system-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -eux pipefail
set -euxo pipefail
BIN_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
PACKAGE_DIR="${BIN_DIR%/*}"
cd "${PACKAGE_DIR}/test"
Expand Down
2 changes: 1 addition & 1 deletion test/scripts/check_entry_in_orthanc_anon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -eux pipefail
set -euxo pipefail

# This could be much improved by having more realistic test data some of
# which actually was persisted
Expand Down
2 changes: 1 addition & 1 deletion test/scripts/check_entry_in_pixl_anon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -eux pipefail
set -euxo pipefail

_sql_command="select * from emap_data.ehr_anon"
_result=$(docker exec -it test-postgres-1 /bin/bash -c \
Expand Down
2 changes: 1 addition & 1 deletion test/scripts/check_max_storage_in_orthanc_raw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -eux pipefail
set -euxo pipefail

# This could be much improved by having more realistic test data some of
# which actually was persisted
Expand Down
2 changes: 1 addition & 1 deletion test/scripts/insert_test_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -eux pipefail
set -euxo pipefail

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

Expand Down