Skip to content

[skip changelog] Simplified how integration tests are run #831

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

Merged
merged 1 commit into from
Jul 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:

- name: Run integration tests
run: |
pip install -r test/requirements.txt
pip install poetry
task test-integration

- name: Send unit tests coverage to Codecov
Expand Down
3 changes: 2 additions & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ tasks:
test-integration:
desc: Run integration tests only
cmds:
- pytest test
- poetry install --no-root
- poetry run pytest test

test-legacy:
desc: Run tests for the `legacy` package
Expand Down
33 changes: 7 additions & 26 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ see following paragraph):
```shell
task test-integration
```

### Running only some tests

By default, all tests from all go packages are run. To run only unit
Expand Down Expand Up @@ -136,43 +137,23 @@ your Operating System.

Some dependencies need to be installed before running the tests and to avoid
polluting your global Python environment with dependencies that might be only
used by the Arduino CLI, you can use a [virtual environment][4]. There are many
ways to manage virtual environments, for example you can use a productivity tool
called [hatch][5]. First you need to install it (you might need to `sudo`
used by the Arduino CLI, to do so we use [Poetry][poetry-website]. First you need to install it (you might need to `sudo`
the following command):

```shell
pip3 install --user hatch
pip3 install --user poetry
```

Then you can create a virtual environment to be used while working on Arduino
CLI:

```shell
hatch env arduino-cli
```
For more installation options read the [official documentation][poetry-docs].

At this point the virtual environment was created and you need to make it active
every time you open a new terminal session with the following command:

```shell
hatch shell arduino-cli
```

From now on, every package installed by Python will be confined to the
`arduino-cli` virtual environment, so you can proceed installing the
dependencies required with:

```shell
pip install -r test/requirements.txt
```

If the last step was successful, you should be able to run the tests with:
After Poetry has been installed you should be able to run the tests with:

```shell
task test-integration
```

This will automatically install the necessary dependencies, if not already installed, and run the integration tests automatically.

## Working on docs

Documentation is provided to final users in form of static HTML content generated
Expand Down
Loading