Skip to content

Commit

Permalink
gazebo headless integration tests with github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderBarbie committed Jun 21, 2024
1 parent b5161b4 commit ee631a6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-arm32v7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
needs: [unit-tests]
steps:
- uses: actions/checkout@v4
- name: Start roslaunch in Docker container
- name: Integration Test dcmotor
working-directory: ./PiCar-X
run: |
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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-arm64v8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
needs: [unit-tests]
steps:
- uses: actions/checkout@v4
- name: Start roslaunch in Docker container
- name: Integration Test dcmotor
working-directory: ./PiCar-X
run: |
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
Expand Down
17 changes: 16 additions & 1 deletion .github/workflows/build-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,26 @@ jobs:
needs: [unit-tests]
steps:
- uses: actions/checkout@v4
- name: Start roslaunch in Docker container
- name: Integration Test dcmotor
working-directory: ./PiCar-X
run: |
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
- name: Speed tests using Gazebo headless
uses: actions/checkout@v4
working-directory: ./PiCar-X
run: |
i2c=/dev/i2c-0 docker compose -f docker-compose-dtp-inttest.yml up -d
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"
- name: Remove running containers after tests
uses: actions/checkout@v4
if: success() || failure()
working-directory: ./PiCar-X
run: |
docker compose -f docker-compose-dtp-inttest.yml down

release:
runs-on: [self-hosted, Linux, X64]
needs: [integration-tests]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,10 @@ def test_dt_pub_data(self):
right_wheel_stop_position = self.final_message.pose[right_wheel_stop_index]
left_wheel_stop_position = self.final_message.pose[left_wheel_stop_index]
rospy.loginfo(right_wheel_start_position)
self.assertAlmostEqual(right_wheel_start_position.position.x + 1, right_wheel_stop_position.position.x, delta=0.03)
self.assertAlmostEqual(left_wheel_start_position.position.x + 1, left_wheel_stop_position.position.x, delta=0.03)
self.assertAlmostEqual(right_wheel_start_position.position.x + 1, right_wheel_stop_position.position.x, delta=0.04)
self.assertAlmostEqual(left_wheel_start_position.position.x + 1, left_wheel_stop_position.position.x, delta=0.04)


if __name__ == '__main__':
rosunit.unitrun("ackermann_skill", 'test_pt_speed',
Test_Speed)

# python3 src/simulation/picarx_control/tests/steering_integration_test.py
Test_Speed)

0 comments on commit ee631a6

Please sign in to comment.