-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathrun_integration_test.sh
executable file
·61 lines (47 loc) · 1.66 KB
/
run_integration_test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env bash
set -ex
if [[ ${ROS_DISTRO} = "dashing" || ${ROS_DISTRO} = "foxy" ]]
then
./run_ros2_integration_test.sh ${ROS_DISTRO}
exit 0
fi
# Clean up
rm -rf integration/v1_bundle
rm -rf integration/v2_bundle
rm -rf integration/v1.tar.gz
rm -rf integration/v2.tar
# Preparing dependencies generated by tox to requirements.txt for docker use
pip freeze > requirements.txt
# Remove colcon-bundle because we are going to install it as editable
sed -i.old '/^colcon-bundle.*/d' requirements.txt
# Build bundles
if [[ ${TEST} = "create" ]]
then
docker build -f Dockerfile.${ROS_DISTRO} -t test-container .
else
docker build -f Dockerfile.backwards -t test-container .
fi
# Copy bundles into local directory
docker run -v=$(pwd):/workspace test-container /workspace/integration/copy-bundles.sh
cd integration
# Extract bundles
rm -rf ./v2_bundle
mkdir ./v2_bundle
mkdir ./v2_bundle/dependencies
tar -xOf ./v2.tar dependencies.tar.gz | tar -xzf - --directory ./v2_bundle/dependencies
mkdir ./v2_bundle/workspace
tar -xOf ./v2.tar workspace.tar.gz | tar -xzf - --directory ./v2_bundle/workspace
rm -rf ./v1_bundle
mkdir ./v1_bundle
tar -xzOf ./v1.tar.gz bundle.tar | tar -xf - --directory ./v1_bundle
# Run tests
if [[ ${ROS_DISTRO} = "kinetic" ]]
then
docker run -v $(pwd):/workspace ubuntu:xenial /workspace/test_v1.sh
docker run -v $(pwd):/workspace ubuntu:xenial /workspace/test_v2.sh
docker run -v $(pwd):/workspace ubuntu:xenial /workspace/test_v2.bash
else
docker run -v $(pwd):/workspace ubuntu:bionic /workspace/test_v1.sh
docker run -v $(pwd):/workspace ubuntu:bionic /workspace/test_v2.sh
docker run -v $(pwd):/workspace ubuntu:bionic /workspace/test_v2.bash
fi