Skip to content

Commit 36d4b37

Browse files
authored
Merge pull request #37 from green-coding-berlin/35-add-energy-estimation
35 add energy estimation
2 parents f155a83 + 4c0be34 commit 36d4b37

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

.github/workflows/examples-application-testing-bare-metal.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ jobs:
3838
if: ${{ needs.check-commits.outputs.recent_examples_commit == 'true' || needs.check-commits.outputs.recent_gmt_commit == 'true' || github.event_name == 'workflow_dispatch'}}
3939
runs-on: self-hosted
4040
steps:
41+
- name: Initialize Energy Estimation
42+
uses: green-coding-berlin/eco-ci-energy-estimation@main
43+
with:
44+
task: start-measurement
45+
4146
- name: Checkout Examples Directory
4247
uses: actions/checkout@v3
4348
with:
@@ -50,6 +55,11 @@ jobs:
5055
submodules: 'true'
5156
path: green-metrics-tool
5257

58+
- name: Energy Estimation - Get Measurement
59+
uses: green-coding-berlin/eco-ci-energy-estimation@main
60+
with:
61+
task: get-measurement
62+
label: setup
5363

5464
- name: 'Setup, Run, and Teardown Tests'
5565
uses: green-coding-berlin/green-metrics-tool/.github/actions/gmt-pytest@dev
@@ -59,3 +69,15 @@ jobs:
5969
tests-directory: './examples-directory/test'
6070
tests-command: 'pytest smoke_test.py -k "test_all_directories"'
6171
github-token: ${{ secrets.GITHUB_TOKEN }}
72+
73+
- name: Energy Estimation - Get Measurement
74+
uses: green-coding-berlin/eco-ci-energy-estimation@main
75+
with:
76+
task: get-measurement
77+
label: tests
78+
79+
- name: Energy Estimation - End Measurement
80+
uses: green-coding-berlin/eco-ci-energy-estimation@main
81+
with:
82+
task: display-results
83+

.github/workflows/examples-application-testing-vm.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ jobs:
4040
runs-on: ubuntu-latest
4141

4242
steps:
43+
- name: Initialize Energy Estimation
44+
uses: green-coding-berlin/eco-ci-energy-estimation@main
45+
with:
46+
task: start-measurement
47+
4348
- name: Checkout Examples Directory
4449
uses: actions/checkout@v3
4550
with:
@@ -52,6 +57,11 @@ jobs:
5257
submodules: 'true'
5358
path: green-metrics-tool
5459

60+
- name: Energy Estimation - Get Measurement
61+
uses: green-coding-berlin/eco-ci-energy-estimation@main
62+
with:
63+
task: get-measurement
64+
label: setup
5565

5666
- name: 'Setup, Run, and Teardown Tests'
5767
uses: green-coding-berlin/green-metrics-tool/.github/actions/gmt-pytest@dev
@@ -61,3 +71,14 @@ jobs:
6171
tests-directory: './examples-directory/test'
6272
tests-command: 'pytest smoke_test.py -k "test_all_directories"'
6373
github-token: ${{ secrets.GITHUB_TOKEN }}
74+
75+
- name: Energy Estimation - Get Measurement
76+
uses: green-coding-berlin/eco-ci-energy-estimation@main
77+
with:
78+
task: get-measurement
79+
label: tests
80+
81+
- name: Energy Estimation - End Measurement
82+
uses: green-coding-berlin/eco-ci-energy-estimation@main
83+
with:
84+
task: display-results

test/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ In green-metris-tool tests subfolder, make sure you first run the `green-metrics
1818

1919
Then from the `example-applications/test` directory, just run `pytest`
2020

21+
To test a single directory, run something like this:
22+
23+
`pytest smoke_test.py::test_a_directory --name <name_of_directory_to_test>`
24+
2125
## Dotfiles
2226
The smoketests will iterate over all the directories and assumes that they are working applications with usage-scenario.yml and compose.yml files that are meant to used with the green metrics tool.
2327

0 commit comments

Comments
 (0)