Skip to content

Commit a53b4ce

Browse files
gazebo headless integration tests with github actions
1 parent 20aeeb7 commit a53b4ce

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed

.github/workflows/build-arm32v7.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
needs: [unit-tests]
3535
steps:
3636
- uses: actions/checkout@v4
37-
- name: Start roslaunch in Docker container
37+
- name: Integration Test dcmotor
3838
working-directory: ./PiCar-X
3939
run: |
4040
docker run --rm --name dcmotor-integration-test -v /sys/class/gpio:/sys/class/gpio -v /dev/i2c-11:/dev/i2c-11 --privileged abarbie/picarx-dcmotor-driver:latest-arm32v7 rostest picarx_dcmotor_driver integration_tests.test i2c_port:=/dev/i2c-11

.github/workflows/build-arm64v8.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
needs: [unit-tests]
3434
steps:
3535
- uses: actions/checkout@v4
36-
- name: Start roslaunch in Docker container
36+
- name: Integration Test dcmotor
3737
working-directory: ./PiCar-X
3838
run: |
3939
docker run --rm --name dcmotor-integration-test -v /sys/class/gpio:/sys/class/gpio -v /dev/i2c-11:/dev/i2c-11 --privileged abarbie/picarx-dcmotor-driver:latest-arm64v8 rostest picarx_dcmotor_driver integration_tests.test i2c_port:=/dev/i2c-11

.github/workflows/build-x64.yml

+16-1
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,26 @@ jobs:
3434
needs: [unit-tests]
3535
steps:
3636
- uses: actions/checkout@v4
37-
- name: Start roslaunch in Docker container
37+
- name: Integration Test dcmotor
3838
working-directory: ./PiCar-X
3939
run: |
4040
docker run --rm --name dcmotor-integration-test -v /sys/class/gpio:/sys/class/gpio -v /dev/i2c-0:/dev/i2c-0 --privileged abarbie/picarx-dcmotor-driver:latest rostest picarx_dcmotor_driver integration_tests.test i2c_port:=/dev/i2c-0
4141
42+
- name: Speed tests using Gazebo headless
43+
uses: actions/checkout@v4
44+
working-directory: ./PiCar-X
45+
run: |
46+
i2c=/dev/i2c-0 docker compose -f docker-compose-dtp-inttest.yml up -d
47+
docker exec -it picar-x-picarx-gazebo-control-1 /bin/bash -c "source ./install/setup.bash && python3 ./src/simulation/picarx_control/tests/steering_integration_test.py"
48+
49+
- name: Remove running containers after tests
50+
uses: actions/checkout@v4
51+
if: success() || failure()
52+
working-directory: ./PiCar-X
53+
run: |
54+
docker compose -f docker-compose-dtp-inttest.yml down
55+
56+
4257
release:
4358
runs-on: [self-hosted, Linux, X64]
4459
needs: [integration-tests]

PiCar-X/simulation/picarx_control/tests/steering_integration_test.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,10 @@ def test_dt_pub_data(self):
5151
right_wheel_stop_position = self.final_message.pose[right_wheel_stop_index]
5252
left_wheel_stop_position = self.final_message.pose[left_wheel_stop_index]
5353
rospy.loginfo(right_wheel_start_position)
54-
self.assertAlmostEqual(right_wheel_start_position.position.x + 1, right_wheel_stop_position.position.x, delta=0.03)
55-
self.assertAlmostEqual(left_wheel_start_position.position.x + 1, left_wheel_stop_position.position.x, delta=0.03)
54+
self.assertAlmostEqual(right_wheel_start_position.position.x + 1, right_wheel_stop_position.position.x, delta=0.04)
55+
self.assertAlmostEqual(left_wheel_start_position.position.x + 1, left_wheel_stop_position.position.x, delta=0.04)
5656

5757

5858
if __name__ == '__main__':
5959
rosunit.unitrun("ackermann_skill", 'test_pt_speed',
60-
Test_Speed)
61-
62-
# python3 src/simulation/picarx_control/tests/steering_integration_test.py
60+
Test_Speed)

0 commit comments

Comments
 (0)