Skip to content

Commit b2d17c7

Browse files
author
Hatim Chahout
committed
Amended jobout path. #66
1 parent 6269ee2 commit b2d17c7

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

tests/run_test_setup.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function setup_test_env() {
1818

1919
# Create an empty param.bash and add the mock paths to it
2020
> "param.bash"
21-
cp run_proc.bash "$TMP_DIR/run_proc.bash"
21+
# cp run_proc.bash "$TMP_DIR/run_proc.bash"
2222
echo "export MARINE_VAL=$TMP_DIR" >> "param.bash"
2323
echo "export MSKPATH=$TMP_DIR/MESH_MASK_DIR" >> "param.bash"
2424
echo "export CDFPATH=$TMP_DIR/CDFTOOLS_DIR/bin" >> "param.bash"

tests/test_valid_run.bash

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
set -e
2+
set -ex
33

44
echo "--- Test 1: A valid run ---"
55

@@ -9,25 +9,27 @@ source ./tests/run_test_setup.bash
99
echo "Setting up test environment..."
1010
setup_test_env
1111

12-
echo "Changing to temporary directory..."
13-
cd "$TMP_DIR"
12+
# echo "Changing to temporary directory..."
13+
# cd "$TMP_DIR"
14+
15+
JOBOUT="$TMP_DIR/test_valid_run_out.txt"
1416

1517
echo "Running the process with valid parameters..."
16-
source ./run_proc.bash -B bathy.nc -C 1 mesh_mask.nc 2020 2020 1m RUNID_TEST > output.txt 2>&1
18+
source ./run_proc.bash -B bathy.nc -C 1 mesh_mask.nc 2020 2020 1m RUNID_TEST > "$JOBOUT" 2>&1
1719

18-
if ! grep -q "MOCK SBATCH: --output=.*mk_msks.out /.*/mk_msks.bash" output.txt; then
20+
if ! grep -q "MOCK SBATCH: --output=.*mk_msks.out /.*/mk_msks.bash" "$JOBOUT"; then
1921
echo "Test failed: Expected 'mk_msks.bash' job was not submitted."
2022
cleanup_test_env
2123
exit 1
2224
fi
2325

24-
if ! grep -q "MOCK SBATCH: --job-name=moo_1m_grid-._20200101 --output=.*moo_1m_grid-._20200101.out /.*/get_data.bash" output.txt; then
26+
if ! grep -q "MOCK SBATCH: --job-name=moo_1m_grid-._20200101 --output=.*moo_1m_grid-._20200101.out /.*/get_data.bash" "$JOBOUT"; then
2527
echo "Test failed: Expected a data retrieval job to be submitted."
2628
cleanup_test_env
2729
exit 1
2830
fi
2931

30-
if ! grep -q "data processing is done for RUNID_TEST between 2020 and 2020" output.txt; then
32+
if ! grep -q "data processing is done for RUNID_TEST between 2020 and 2020" "$JOBOUT"; then
3133
echo "Test failed: Expected success message not found."
3234
cleanup_test_env
3335
exit 1

0 commit comments

Comments
 (0)