Skip to content

Commit 415458c

Browse files
committed
ci: Add env and pip debug information
When debugging different behaviour between the GitHub workflow run and a local run it is very useful to know exactly which dependency versions are installed. To do this we also add the `nox` session as a matrix dimention for the `nox` job, so it is easier to print the generated `nox` venv for the different sessions. This has the nice effect that nox max and min tests will run in parallel. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 3043462 commit 415458c

File tree

8 files changed

+201
-21
lines changed
  • .github/workflows
  • cookiecutter/{{cookiecutter.github_repo_name}}/.github/workflows
  • tests_golden/integration/test_cookiecutter_generation
    • actor/frequenz-actor-test/.github/workflows
    • api/frequenz-api-test/.github/workflows
    • app/frequenz-app-test/.github/workflows
    • lib/frequenz-test-python/.github/workflows
    • model/frequenz-model-test/.github/workflows

8 files changed

+201
-21
lines changed

.github/workflows/ci.yaml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,17 @@ jobs:
3232
- ubuntu-20.04
3333
python:
3434
- "3.11"
35+
nox-session:
36+
# To speed things up a bit we use the special ci_checks_max session
37+
# that uses the same venv to run multiple linting sessions
38+
- "ci_checks_max"
39+
- "pytest_min"
3540
runs-on: ${{ matrix.os }}
3641

3742
steps:
43+
- name: Print environment (debug)
44+
run: env
45+
3846
- name: Fetch sources
3947
uses: actions/checkout@v3
4048
with:
@@ -50,11 +58,25 @@ jobs:
5058
run: |
5159
python -m pip install --upgrade pip
5260
python -m pip install -e .[dev-noxfile]
61+
pip freeze
62+
63+
- name: Create nox venv
64+
env:
65+
NOX_SESSION: ${{ matrix.nox-session }}
66+
run: nox --install-only -e "$NOX_SESSION"
67+
68+
- name: Print pip freeze for nox venv (debug)
69+
env:
70+
NOX_SESSION: ${{ matrix.nox-session }}
71+
run: |
72+
. ".nox/$NOX_SESSION/bin/activate"
73+
pip freeze
74+
deactivate
5375
5476
- name: Run nox
55-
# To speed things up a bit we use the special ci_checks_max session
56-
# that uses the same venv to run multiple linting sessions
57-
run: nox -e ci_checks_max pytest_min
77+
env:
78+
NOX_SESSION: ${{ matrix.nox-session }}
79+
run: nox -R -e "$NOX_SESSION"
5880
timeout-minutes: 60
5981

6082
build:
@@ -76,6 +98,7 @@ jobs:
7698
run: |
7799
python -m pip install -U pip
78100
python -m pip install -U build
101+
pip freeze
79102
80103
- name: Build the source and binary distribution
81104
run: python -m build
@@ -110,6 +133,7 @@ jobs:
110133
run: |
111134
python -m pip install -U pip
112135
python -m pip install .[dev-mkdocs]
136+
pip freeze
113137
114138
- name: Generate the documentation
115139
env:
@@ -192,6 +216,7 @@ jobs:
192216
run: |
193217
python -m pip install -U pip
194218
python -m pip install .[dev-mkdocs]
219+
pip freeze
195220
196221
- name: Fetch the gh-pages branch
197222
if: steps.mike-metadata.outputs.version

RELEASE_NOTES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,13 @@
1818

1919
### Cookiecutter template
2020

21+
2122
- Now dependabot updates will be done weekly and grouped by *required* and *optional* for minor and patch updates (major updates are still done individually for each dependency).
2223

24+
- ci: Add debug information when installing pip packages.
25+
26+
The output of `pip freeze` is printed to be able to more easily debug different behaviours between GitHub workflow runs and local runs.
27+
2328
## Bug Fixes
2429

2530
<!-- Here goes notable bug fixes that are worth a special mention or explanation -->

cookiecutter/{{cookiecutter.github_repo_name}}/.github/workflows/ci.yaml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,17 @@ jobs:
5757
- ubuntu-20.04
5858
python:
5959
- "3.11"
60+
nox-session:
61+
# To speed things up a bit we use the special ci_checks_max session
62+
# that uses the same venv to run multiple linting sessions
63+
- "ci_checks_max"
64+
- "pytest_min"
6065
runs-on: {{'${{ matrix.os }}'}}
6166

6267
steps:
68+
- name: Print environment (debug)
69+
run: env
70+
6371
- name: Fetch sources
6472
uses: actions/checkout@v3
6573
with:
@@ -75,11 +83,25 @@ jobs:
7583
run: |
7684
python -m pip install --upgrade pip
7785
python -m pip install -e .[dev-noxfile]
86+
pip freeze
87+
88+
- name: Create nox venv
89+
env:
90+
NOX_SESSION: {{'${{ matrix.nox-session }}'}}
91+
run: nox --install-only -e "$NOX_SESSION"
92+
93+
- name: Print pip freeze for nox venv (debug)
94+
env:
95+
NOX_SESSION: {{'${{ matrix.nox-session }}'}}
96+
run: |
97+
. ".nox/$NOX_SESSION/bin/activate"
98+
pip freeze
99+
deactivate
78100
79101
- name: Run nox
80-
# To speed things up a bit we use the special ci_checks_max session
81-
# that uses the same venv to run multiple linting sessions
82-
run: nox -e ci_checks_max pytest_min
102+
env:
103+
NOX_SESSION: {{'${{ matrix.nox-session }}'}}
104+
run: nox -R -e "$NOX_SESSION"
83105
timeout-minutes: 10
84106

85107
build:
@@ -101,6 +123,7 @@ jobs:
101123
run: |
102124
python -m pip install -U pip
103125
python -m pip install -U build
126+
pip freeze
104127
105128
- name: Build the source and binary distribution
106129
run: python -m build
@@ -135,6 +158,7 @@ jobs:
135158
run: |
136159
python -m pip install -U pip
137160
python -m pip install .[dev-mkdocs]
161+
pip freeze
138162
139163
- name: Generate the documentation
140164
env:
@@ -217,6 +241,7 @@ jobs:
217241
run: |
218242
python -m pip install -U pip
219243
python -m pip install .[dev-mkdocs]
244+
pip freeze
220245
221246
- name: Fetch the gh-pages branch
222247
if: steps.mike-metadata.outputs.version

tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/.github/workflows/ci.yaml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,17 @@ jobs:
3232
- ubuntu-20.04
3333
python:
3434
- "3.11"
35+
nox-session:
36+
# To speed things up a bit we use the special ci_checks_max session
37+
# that uses the same venv to run multiple linting sessions
38+
- "ci_checks_max"
39+
- "pytest_min"
3540
runs-on: ${{ matrix.os }}
3641

3742
steps:
43+
- name: Print environment (debug)
44+
run: env
45+
3846
- name: Fetch sources
3947
uses: actions/checkout@v3
4048
with:
@@ -50,11 +58,25 @@ jobs:
5058
run: |
5159
python -m pip install --upgrade pip
5260
python -m pip install -e .[dev-noxfile]
61+
pip freeze
62+
63+
- name: Create nox venv
64+
env:
65+
NOX_SESSION: ${{ matrix.nox-session }}
66+
run: nox --install-only -e "$NOX_SESSION"
67+
68+
- name: Print pip freeze for nox venv (debug)
69+
env:
70+
NOX_SESSION: ${{ matrix.nox-session }}
71+
run: |
72+
. ".nox/$NOX_SESSION/bin/activate"
73+
pip freeze
74+
deactivate
5375
5476
- name: Run nox
55-
# To speed things up a bit we use the special ci_checks_max session
56-
# that uses the same venv to run multiple linting sessions
57-
run: nox -e ci_checks_max pytest_min
77+
env:
78+
NOX_SESSION: ${{ matrix.nox-session }}
79+
run: nox -R -e "$NOX_SESSION"
5880
timeout-minutes: 10
5981

6082
build:
@@ -76,6 +98,7 @@ jobs:
7698
run: |
7799
python -m pip install -U pip
78100
python -m pip install -U build
101+
pip freeze
79102
80103
- name: Build the source and binary distribution
81104
run: python -m build
@@ -110,6 +133,7 @@ jobs:
110133
run: |
111134
python -m pip install -U pip
112135
python -m pip install .[dev-mkdocs]
136+
pip freeze
113137
114138
- name: Generate the documentation
115139
env:
@@ -192,6 +216,7 @@ jobs:
192216
run: |
193217
python -m pip install -U pip
194218
python -m pip install .[dev-mkdocs]
219+
pip freeze
195220
196221
- name: Fetch the gh-pages branch
197222
if: steps.mike-metadata.outputs.version

tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/.github/workflows/ci.yaml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,17 @@ jobs:
5555
- ubuntu-20.04
5656
python:
5757
- "3.11"
58+
nox-session:
59+
# To speed things up a bit we use the special ci_checks_max session
60+
# that uses the same venv to run multiple linting sessions
61+
- "ci_checks_max"
62+
- "pytest_min"
5863
runs-on: ${{ matrix.os }}
5964

6065
steps:
66+
- name: Print environment (debug)
67+
run: env
68+
6169
- name: Fetch sources
6270
uses: actions/checkout@v3
6371
with:
@@ -73,11 +81,25 @@ jobs:
7381
run: |
7482
python -m pip install --upgrade pip
7583
python -m pip install -e .[dev-noxfile]
84+
pip freeze
85+
86+
- name: Create nox venv
87+
env:
88+
NOX_SESSION: ${{ matrix.nox-session }}
89+
run: nox --install-only -e "$NOX_SESSION"
90+
91+
- name: Print pip freeze for nox venv (debug)
92+
env:
93+
NOX_SESSION: ${{ matrix.nox-session }}
94+
run: |
95+
. ".nox/$NOX_SESSION/bin/activate"
96+
pip freeze
97+
deactivate
7698
7799
- name: Run nox
78-
# To speed things up a bit we use the special ci_checks_max session
79-
# that uses the same venv to run multiple linting sessions
80-
run: nox -e ci_checks_max pytest_min
100+
env:
101+
NOX_SESSION: ${{ matrix.nox-session }}
102+
run: nox -R -e "$NOX_SESSION"
81103
timeout-minutes: 10
82104

83105
build:
@@ -99,6 +121,7 @@ jobs:
99121
run: |
100122
python -m pip install -U pip
101123
python -m pip install -U build
124+
pip freeze
102125
103126
- name: Build the source and binary distribution
104127
run: python -m build
@@ -133,6 +156,7 @@ jobs:
133156
run: |
134157
python -m pip install -U pip
135158
python -m pip install .[dev-mkdocs]
159+
pip freeze
136160
137161
- name: Generate the documentation
138162
env:
@@ -215,6 +239,7 @@ jobs:
215239
run: |
216240
python -m pip install -U pip
217241
python -m pip install .[dev-mkdocs]
242+
pip freeze
218243
219244
- name: Fetch the gh-pages branch
220245
if: steps.mike-metadata.outputs.version

tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/.github/workflows/ci.yaml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,17 @@ jobs:
3232
- ubuntu-20.04
3333
python:
3434
- "3.11"
35+
nox-session:
36+
# To speed things up a bit we use the special ci_checks_max session
37+
# that uses the same venv to run multiple linting sessions
38+
- "ci_checks_max"
39+
- "pytest_min"
3540
runs-on: ${{ matrix.os }}
3641

3742
steps:
43+
- name: Print environment (debug)
44+
run: env
45+
3846
- name: Fetch sources
3947
uses: actions/checkout@v3
4048
with:
@@ -50,11 +58,25 @@ jobs:
5058
run: |
5159
python -m pip install --upgrade pip
5260
python -m pip install -e .[dev-noxfile]
61+
pip freeze
62+
63+
- name: Create nox venv
64+
env:
65+
NOX_SESSION: ${{ matrix.nox-session }}
66+
run: nox --install-only -e "$NOX_SESSION"
67+
68+
- name: Print pip freeze for nox venv (debug)
69+
env:
70+
NOX_SESSION: ${{ matrix.nox-session }}
71+
run: |
72+
. ".nox/$NOX_SESSION/bin/activate"
73+
pip freeze
74+
deactivate
5375
5476
- name: Run nox
55-
# To speed things up a bit we use the special ci_checks_max session
56-
# that uses the same venv to run multiple linting sessions
57-
run: nox -e ci_checks_max pytest_min
77+
env:
78+
NOX_SESSION: ${{ matrix.nox-session }}
79+
run: nox -R -e "$NOX_SESSION"
5880
timeout-minutes: 10
5981

6082
build:
@@ -76,6 +98,7 @@ jobs:
7698
run: |
7799
python -m pip install -U pip
78100
python -m pip install -U build
101+
pip freeze
79102
80103
- name: Build the source and binary distribution
81104
run: python -m build
@@ -110,6 +133,7 @@ jobs:
110133
run: |
111134
python -m pip install -U pip
112135
python -m pip install .[dev-mkdocs]
136+
pip freeze
113137
114138
- name: Generate the documentation
115139
env:
@@ -192,6 +216,7 @@ jobs:
192216
run: |
193217
python -m pip install -U pip
194218
python -m pip install .[dev-mkdocs]
219+
pip freeze
195220
196221
- name: Fetch the gh-pages branch
197222
if: steps.mike-metadata.outputs.version

0 commit comments

Comments
 (0)