Skip to content

Commit 3758583

Browse files
NiallEgansusodapop
authored andcommitted
Dockerize Python tests
This PR migrates an initial few tests to be run in a docker container. For now, it just migrates: - Unit tests - Cmdexec timestamp integration test Follow up PRs will continue with a gradual migration of tests to keep everything under control. Re-running unit tests, Timestamp integration test and old integration tests to verify nothing breaks - Did you add usage logs or metrics? Please mention them here. - Create dashboards or monitoring notebooks? Please link them here. - See http://go/obs/user for docs on our observability tools.
1 parent e129fe4 commit 3758583

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM python:3.7-slim-buster
2+
3+
RUN pip install grpcio==1.41.0 \
4+
pyarrow==5.0.0 \
5+
protobuf==3.18.1 \
6+
cryptography==35.0.0 \
7+
thrift==0.13.0
8+
9+
ENTRYPOINT ["./docker-entrypoint.sh"]
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
3+
set -e
4+
export PYTHONPATH=$(pwd)
5+
6+
unit() {
7+
python cmdexec/clients/python/tests/tests.py
8+
}
9+
10+
integration() {
11+
# This is just a temporary hack until we have done the full migration and can change the import
12+
# names across the board
13+
touch qa/__init__.py
14+
touch qa/test/__init__.py
15+
touch qa/test/bi/__init__.py
16+
python test_executor.py "$@"
17+
}
18+
19+
case "$1" in
20+
unit)
21+
shift
22+
unit
23+
;;
24+
integration)
25+
shift
26+
integration "$@"
27+
;;
28+
*)
29+
echo "unrecognised command $1"
30+
exit 1
31+
;;
32+
esac
33+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
docker run $(./cmdexec/clients/cmdexec-python-test-container-full_binary_loader) unit

0 commit comments

Comments
 (0)