Skip to content

Commit

Permalink
change report generator to be aware of GH and passtrough vars to tox (#…
Browse files Browse the repository at this point in the history
…29121)

* change report generator to be aware of GH and passtrough vars to tox

* Update .test-infra/jenkins/metrics_report/report_generator.py

Rework the logic of github detection

* remove github run id env from tox config as its not used
  • Loading branch information
volatilemolotov authored Oct 24, 2023
1 parent 9b2ca42 commit be2cd9d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/beam_Metrics_Report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,12 @@ jobs:
github.event.comment.body == 'Run Metrics Report'
steps:
- uses: actions/checkout@v3
- name: Generate a token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app_id: ${{ secrets.GH_APP_ID }}
private_key: ${{ secrets.GH_APP_PRIVATE_KEY }}
- name: Setup repository
uses: ./.github/actions/setup-action
with:
comment_phrase: ${{ matrix.job_phrase }}
github_token: ${{ steps.generate_token.outputs.token }}
github_token: ${{ secrets.GITHUB_TOKEN }}
github_job: ${{ matrix.job_name }} (${{ matrix.job_phrase }})
steps_context: ${{ toJson(steps) }}
- name: Setup environment
uses: ./.github/actions/setup-environment-action
with:
Expand Down
9 changes: 6 additions & 3 deletions .test-infra/jenkins/metrics_report/report_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,14 @@

INFLUXDB_USER = os.getenv("INFLUXDB_USER")
INFLUXDB_USER_PASSWORD = os.getenv("INFLUXDB_USER_PASSWORD")
WORKING_SPACE = os.getenv("WORKSPACE", "")
WORKING_SPACE = os.getenv("GITHUB_WORKSPACE", os.getenv("WORKSPACE", ""))
if "GITHUB_WORKSPACE" in os.environ:
path_prefix = ""
else:
path_prefix= "src/"
PERF_DASHBOARDS = os.path.join(
WORKING_SPACE,
"src/.test-infra/metrics/grafana/dashboards/perftests_metrics/")

path_prefix+".test-infra/metrics/grafana/dashboards/perftests_metrics/")
TABLE_FIELD_NAMES = [
"Measurement",
"Metric",
Expand Down
2 changes: 1 addition & 1 deletion .test-infra/jenkins/metrics_report/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ commands = python -m unittest dashboards_parser.py

[testenv:py38-generate-report]
deps = -r requirements.txt
passenv = WORKSPACE,INFLUXDB_USER,INFLUXDB_USER_PASSWORD
passenv = WORKSPACE,INFLUXDB_USER,INFLUXDB_USER_PASSWORD,GITHUB_WORKSPACE
commands = python report_generator.py {posargs}

0 comments on commit be2cd9d

Please sign in to comment.