Skip to content

Commit

Permalink
Try #1554:
Browse files Browse the repository at this point in the history
  • Loading branch information
mayastor-bors committed Nov 30, 2023
2 parents aee08d3 + a66c478 commit f350670
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 4 deletions.
1 change: 1 addition & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ pipeline {
// They could be lingering if there were previous test failures.
sh 'docker system prune -f'
sh 'nix-shell --run "./scripts/pytest-tests.sh" ci.nix'
sh 'nix-shell --run "./scripts/pytest-tests.sh --clean-all-exit" ci.nix'
sh 'docker system prune -f'
}
}
Expand Down
4 changes: 3 additions & 1 deletion io-engine/src/bin/io-engine-client/v1/controller_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ async fn controller_stats(
"READS",
"WRITES",
"READ/B",
"WRITTEN/B, NUM_UNMAPS, BYTES_UNMAPPED",
"WRITTEN/B",
"NUM_UNMAPS",
"BYTES_UNMAPPED",
];
ctx.print_list(hdr, vec![row]);
}
Expand Down
38 changes: 36 additions & 2 deletions scripts/pytest-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

set -eu -o pipefail

function clean_all()
{
echo "Cleaning up all docker-compose clusters..."
for file in $(find . -name docker-compose.yml); do
(
cd $(dirname $file)
docker-compose down 2>/dev/null || true
)
done
echo "Done"
}

function run_tests()
{
while read name extra
Expand All @@ -20,12 +32,12 @@ function run_tests()
set -x
python -m pytest --tc-file='test_config.ini' --docker-compose="$name" "$name"
)
fi
if [ -f "$name" ]
elif [ -f "$name" ] || [ -f "${name%::*}" ]
then
(
set -x
base=$(dirname "$name")
( cd $base; docker-compose down 2>/dev/null || true )
python -m pytest --tc-file='test_config.ini' --docker-compose="$base" "$name"
)
fi
Expand All @@ -40,6 +52,28 @@ fi

cd "$SRCDIR/test/python" && source ./venv/bin/activate

TEST_LIST=
while [ "$#" -gt 0 ]; do
case "$1" in
--clean-all)
clean_all
;;
--clean-all-exit)
clean_all
exit 0
;;
*)
TEST_LIST="$TEST_LIST \n$1"
;;
esac
shift
done

if [ -n "$TEST_LIST" ]; then
echo -e "$TEST_LIST" | run_tests
exit 0
fi

run_tests << 'END'
tests/cli_controller
Expand Down
2 changes: 1 addition & 1 deletion utils/dependencies

0 comments on commit f350670

Please sign in to comment.