You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The logic of some of the scripts under "./scripts/" has been moved to
the new Makefile. This improves the developer experience since this
Makefile provides all the commands a developer needs to write code in
this repo.
Apart from that, this commit also fixes the last lint issues, so now the
linter returns a 10/10 score.
@@ -29,44 +29,48 @@ poetry run python3 generic_k8s_webhook/main.py --config <GenericWebhookConfigFil
29
29
30
30
## Format code
31
31
32
-
The project uses [black](https://black.readthedocs.io/en/stable/) and [isort](https://pycqa.github.io/isor) to format the code. To do so automatically, you can run this script:
32
+
The project uses [black](https://black.readthedocs.io/en/stable/) and [isort](https://pycqa.github.io/isor) to format the code. To do so automatically, you can execute this make rule:
33
33
34
34
```bash
35
-
./scripts/format-code.sh
35
+
make format
36
36
```
37
37
38
38
## Test
39
39
40
-
You can run all the tests executed in the CI by calling:
40
+
You can run (sequentially) all the tests executed in the CI by calling:
41
41
42
42
```bash
43
-
./scripts/run-all-tests.sh
43
+
make all-tests-seq
44
44
```
45
45
46
46
These tests can be splitted in 3 categories.
47
47
48
48
### Linter
49
49
50
-
The linting phase checks that the code is well [formatted](#format-code). Apart from that, it also runs [pylint](https://www.pylint.org/). In order to pass the linting phase, `pylint` must not detect any error and must give an overall score of >9.5.
50
+
The linting phase checks that the code is well [formatted](#format-code). Apart from that, it also runs [pylint](https://www.pylint.org/). In order to pass the linting phase, `pylint` must not detect any error,
51
+
even if it's a minor one.
51
52
52
53
```bash
53
-
./scripts/format-code.sh --check
54
+
make lint
54
55
```
55
56
57
+
In some cases, it's acceptable to add `# pylint: disable=<rule>` to disable
58
+
a specific linting issue in a specific line, only if fixing this issue makes the code worse.
59
+
56
60
### Unittests and e2e tests
57
61
58
62
We use [pytest](https://docs.pytest.org/en/7.3.x/) to test the functionality of the app. These tests are defined under the [tests](../tests/) directory and they are a mix of both pure unittests and end-to-end tests.
59
63
60
64
```bash
61
-
poetry run pytest tests
65
+
make unittests
62
66
```
63
67
64
68
### Docker build
65
69
66
70
The last phase of our testing suite is building the docker container that has our app installed in it.
0 commit comments