Skip to content

Commit 8603487

Browse files
authored
[skip changelog] Simplified how integration tests are run (#831)
1 parent 72c9655 commit 8603487

File tree

9 files changed

+484
-77
lines changed

9 files changed

+484
-77
lines changed

.github/workflows/test.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373

7474
- name: Run integration tests
7575
run: |
76-
pip install -r test/requirements.txt
76+
pip install poetry
7777
task test-integration
7878
7979
- name: Send unit tests coverage to Codecov

Taskfile.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ tasks:
8484
test-integration:
8585
desc: Run integration tests only
8686
cmds:
87-
- pytest test
87+
- poetry install --no-root
88+
- poetry run pytest test
8889

8990
test-legacy:
9091
desc: Run tests for the `legacy` package

docs/CONTRIBUTING.md

+7-26
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ see following paragraph):
8585
```shell
8686
task test-integration
8787
```
88+
8889
### Running only some tests
8990

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

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

144143
```shell
145-
pip3 install --user hatch
144+
pip3 install --user poetry
146145
```
147146

148-
Then you can create a virtual environment to be used while working on Arduino
149-
CLI:
150-
151-
```shell
152-
hatch env arduino-cli
153-
```
147+
For more installation options read the [official documentation][poetry-docs].
154148

155-
At this point the virtual environment was created and you need to make it active
156-
every time you open a new terminal session with the following command:
157-
158-
```shell
159-
hatch shell arduino-cli
160-
```
161-
162-
From now on, every package installed by Python will be confined to the
163-
`arduino-cli` virtual environment, so you can proceed installing the
164-
dependencies required with:
165-
166-
```shell
167-
pip install -r test/requirements.txt
168-
```
169-
170-
If the last step was successful, you should be able to run the tests with:
149+
After Poetry has been installed you should be able to run the tests with:
171150

172151
```shell
173152
task test-integration
174153
```
175154

155+
This will automatically install the necessary dependencies, if not already installed, and run the integration tests automatically.
156+
176157
## Working on docs
177158

178159
Documentation is provided to final users in form of static HTML content generated

0 commit comments

Comments
 (0)