-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
To new CLI #5
base: main
Are you sure you want to change the base?
To new CLI #5
Changes from all commits
de4ba92
cdb97c2
9368189
227307e
81af9c1
db815bd
f4906e4
3d002eb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,55 @@ | ||
# Turtlesim Demo Project | ||
|
||
This project demonstrates how to run a basic ros2 end to end tests in simulation (here turtlesim). | ||
This project demonstrates how to run a basic ROS2 end-to-end test in simulation (here turtlesim). | ||
|
||
## Prerequisite | ||
|
||
You will need ROS2 galactic or humble installed. | ||
This demo runs either natively or in containers. Native runs work only on Ubuntu version compatible with the tested ROS2 Humble versions (originally working with Galactic too). Container runs work on Linux, Darwin and Windows, with the later run in X11-compatible shells. | ||
|
||
See instructions [here](https://docs.ros.org/en/humble/Installation.html) | ||
|
||
## ROS2 tests | ||
## Prerequisite | ||
|
||
You can run the tests with: | ||
### Container for Linux/Darwin/Windows | ||
|
||
``` | ||
launch_test launch_turtle.py | ||
``` | ||
* Container system: Docker (Podman coming) | ||
* X11 window system, like XQuartz on Darwin and MobaXterm on Windows, configured to accept local network connections. | ||
|
||
As it is, the test will fail. | ||
### Native for supported Ubuntu | ||
|
||
If you take a look at the code, you should be able to find what is wrong and make the test pass. | ||
This is tested and likely to work only on ROS2 Humble Ubuntu systems. | ||
|
||
See instructions for example [here for Humble](https://docs.ros.org/en/humble/Installation.html) | ||
|
||
## Tests with ArtefactsCI | ||
## Usage | ||
|
||
Usage assumes you clone this repository where you intend to run the demo: | ||
|
||
You can use one of the 2 options below. | ||
git clone https://github.com/art-e-fact/example-turtlesim.git | ||
cd example-turtlesim | ||
|
||
### With local ROS2 install | ||
From this point on, you can either run natively (supported Ubuntu versions only), or through containers. | ||
|
||
Additionally, you can use ArtefactsCI to keep track of your tests results. | ||
### Native for supported Ubuntu | ||
|
||
1. Create an account and project on ArtefactsCI | ||
#### Preliminary: Direct test run | ||
|
||
2. Install the artefacts client | ||
You can run the tests directly with: | ||
|
||
``` | ||
pip install artefacts-client --extra-index-url https://d5cw4z7oemmfd.cloudfront.net/pep503/ -U | ||
launch_test launch_turtle.py | ||
``` | ||
|
||
2. Edit the project name in artefacts.yaml | ||
|
||
3. Run the tests with tracking enabled | ||
The test should succeed. One way to make it fail for demo purpose is to, say, increment by 0 the turtle velocity, so it never reaches the edge expeced by the test case (see line 19 in `sample_node.py`). | ||
|
||
``` | ||
artefacts run basic_tests | ||
``` | ||
#### Tests with Artefacts | ||
|
||
### Using Docker | ||
1. Create a free account and project on [Artefacts](https://app.artefacts.com) | ||
2. Install the Artefacts CLI: `pip3 install artefacts-cli` | ||
3. Edit the project name in `artefacts.yaml` to the name of your project in Artefacts (step 1). | ||
4. Run the tests with tracking enabled: `artefacts run basic_tests` | ||
5. Results and detail should shortly be available in your Artefacts dashboard. | ||
|
||
### Container runs | ||
|
||
Tests on MacOS and Ubuntu 20 often require explictly authorizing access to X11: | ||
Runs should work out of the box, assuming complete X11 configuration: | ||
|
||
[MacOS] xhost +127.0.0.1: This will start an X11 server if needed, and allow the container to connect. | ||
[Ubuntu 20] xhost +local:docker | ||
artefacts run --in-package basic_tests | ||
|
||
Then build and run the docker container: | ||
|
||
``` | ||
git clone [email protected]:art-e-fact/warp-client.git | ||
docker build -t turtle2 . | ||
docker run --env ARTEFACTS_KEY=[YOUR-API-KEY] --net host --env DISPLAY=$DISPLAY -v $(pwd):/turtle turtle2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I may have missed it, but I don't see where you specify the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is that necessary on Linux? For Darwin, and most likely Windows (TBC), it is done in the code. I see that as part of CLI UX, so definitely interested in iterating toward very useful experience. |
||
``` | ||
This command will build any missing image before running a container. Please add `--repackage` to force a rebuild as needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we should keep the menton that you need to clone before doing the artefacts run?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added on cloning under the Usage section. Does that flow well for now?