Skip to content

[skip-changelog] Remove python testsuite and the related workflow #2011

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 3 commits into from
Dec 16, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
11 changes: 0 additions & 11 deletions .github/tools/get_integration_tests.py

This file was deleted.

124 changes: 0 additions & 124 deletions .github/workflows/test-go-integration-task.yml

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Arduino CLI is an all-in-one solution that provides Boards/Library Managers, ske
and many other tools needed to use any Arduino compatible board and platform from command line or machine interfaces.

[![Test Go status](https://github.com/arduino/arduino-cli/actions/workflows/test-go-task.yml/badge.svg)](https://github.com/arduino/arduino-cli/actions/workflows/test-go-task.yml)
[![Test Integration status](https://github.com/arduino/arduino-cli/actions/workflows/test-go-integration-task.yml/badge.svg)](https://github.com/arduino/arduino-cli/actions/workflows/test-go-integration-task.yml)
[![Publish Nightly Build status](https://github.com/arduino/arduino-cli/actions/workflows/publish-go-nightly-task.yml/badge.svg)](https://github.com/arduino/arduino-cli/actions/workflows/publish-go-nightly-task.yml)
[![Deploy Website status](https://github.com/arduino/arduino-cli/actions/workflows/deploy-cobra-mkdocs-versioned-poetry.yml/badge.svg)](https://github.com/arduino/arduino-cli/actions/workflows/deploy-cobra-mkdocs-versioned-poetry.yml)
[![Codecov](https://codecov.io/gh/arduino/arduino-cli/branch/main/graph/badge.svg)](https://codecov.io/gh/arduino/arduino-cli)
Expand Down
11 changes: 1 addition & 10 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,6 @@ tasks:
{{default .DEFAULT_INTEGRATIONTEST_GO_PACKAGES .GO_PACKAGES}} \
{{.TEST_LDFLAGS}}

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/test-go-integration-task/Taskfile.yml
go:test-integration:
desc: Run integration tests
deps:
- task: go:build
- task: poetry:install-deps
cmds:
- poetry run pytest test

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
go:vet:
desc: Check for errors in Go code
Expand Down Expand Up @@ -269,7 +260,7 @@ tasks:
desc: Run the full testsuite, `legacy` will be skipped
cmds:
- task: go:test
- task: go:test-integration
- task: go:integration-test

test-legacy:
desc: Run tests for the `legacy` package
Expand Down
36 changes: 8 additions & 28 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ To build the Arduino CLI from sources you need the following tools to be availab
If you want to run integration tests you will also need:

- A serial port with an Arduino board attached
- A working [Python][3] environment, version 3.8 or later

If you're working on the gRPC interface you will also have to:

Expand Down Expand Up @@ -115,7 +114,7 @@ task go:test
To run integration tests (these will take some time and require special setup, see following paragraph):

```shell
task go:test-integration
task go:integration-test
```

#### Running only some tests
Expand Down Expand Up @@ -163,48 +162,29 @@ the above requirements.

##### Software requirements for running integration tests:

A working Python environment. Chances are that you already have Python installed in your system, if this is not the case
you can [download][3] the official distribution or use the package manager provided by 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, 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 poetry
```

For more installation options read the [official documentation][poetry-docs].
A working Go environment. Chances are that you already have Go installed in your system, if this is not the case you can
[download][1] the official distribution or use the package manager provided by your Operating System.

#### Running tests

After the software requirements have been installed you should be able to run the tests with:

```shell
task go:test-integration
task go:integration-test
```

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

To run specific modules you must run `pytest` from the virtual environment created by Poetry.
To run specific packages you must run `go test`.

```shell
poetry run pytest test/test_lib.py
go test -v github.com/arduino/arduino-cli/internal/integrationtest/lib
```

To run very specific test functions:

```shell
poetry run pytest test/test_lib.py::test_list
```

You can avoid writing the `poetry run` prefix each time by creating a new shell inside the virtual environment:

```shell
poetry shell
pytest test_lib.py
pytest test_lib.py::test_list
go test -v github.com/arduino/arduino-cli/internal/integrationtest/lib -run TestLibUpgradeCommand
```

#### Linting and formatting
Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions internal/integrationtest/testdata/test_index.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"help": {
"online": "https://github.com/Arduino/arduino-cli"
},
"url": "https://raw.githubusercontent.com/arduino/arduino-cli/master/test/testdata/core.zip",
"url": "https://raw.githubusercontent.com/arduino/arduino-cli/master/internal/integrationtest/testdata/core.zip",
"checksum": "SHA-256:6a338cf4d6d501176a2d352c87a8d72ac7488b8c5b82cdf2a4e2cef630391092",
"name": "test_core",
"version": "1.0.0",
Expand All @@ -31,7 +31,7 @@
"help": {
"online": "https://github.com/Arduino/arduino-cli"
},
"url": "https://raw.githubusercontent.com/arduino/arduino-cli/master/test/testdata/core.zip",
"url": "https://raw.githubusercontent.com/arduino/arduino-cli/master/internal/integrationtest/testdata/core.zip",
"checksum": "SHA-256:6a338cf4d6d501176a2d352c87a8d72ac7488b8c5b82cdf2a4e2cef630391092",
"name": "test_core",
"version": "2.0.0",
Expand Down Expand Up @@ -65,7 +65,7 @@
"help": {
"online": "https://github.com/Arduino/arduino-cli"
},
"url": "https://raw.githubusercontent.com/arduino/arduino-cli/master/test/testdata/evil.zip",
"url": "https://raw.githubusercontent.com/arduino/arduino-cli/master/internal/integrationtest/testdata/evil.zip",
"checksum": "SHA-256:9b85dfe23f13318efc0e541327f584a0f3674a773d46a7eb8b25f0f408d07f96",
"name": "zipslip",
"version": "1.0.0",
Expand Down Expand Up @@ -96,7 +96,7 @@
"help": {
"online": "https://github.com/Arduino/arduino-cli"
},
"url": "https://raw.githubusercontent.com/arduino/arduino-cli/master/test/testdata/core.zip",
"url": "https://raw.githubusercontent.com/arduino/arduino-cli/master/internal/integrationtest/testdata/core.zip",
"checksum": "SHA-256:1a338cf4d6d501176a2d352c87a8d72ac7488b8c5b82cdf2a4e2cef630391092",
"name": "zipslip",
"version": "1.0.0",
Expand Down Expand Up @@ -189,7 +189,7 @@
"help": {
"online": "https://github.com/Arduino/arduino-cli"
},
"url": "https://raw.githubusercontent.com/arduino/arduino-cli/master/test/testdata/core.zip",
"url": "https://raw.githubusercontent.com/arduino/arduino-cli/master/internal/integrationtest/testdata/core.zip",
"checksum": "SHA-256:6a338cf4d6d501176a2d352c87a8d72ac7488b8c5b82cdf2a4e2cef630391092",
"name": "Platform",
"version": "1.2.3",
Expand Down
6 changes: 0 additions & 6 deletions test/README.md

This file was deleted.

14 changes: 0 additions & 14 deletions test/__init__.py

This file was deleted.

37 changes: 0 additions & 37 deletions test/common.py

This file was deleted.

Loading