Skip to content

Commit

Permalink
fix bugs of regression test (#5380)
Browse files Browse the repository at this point in the history
* fix the the issue that `IS_PR `environment takes no effect

* fix the branch checkout
  • Loading branch information
MeouSker77 authored Aug 16, 2022
1 parent 2b90dc1 commit 60c4bef
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/performance-regression-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ jobs:
runs-on: [Rohan, ubuntu-20.04-lts]
if: github.event.schedule || github.event.issue.pull_request && github.event.comment.body=='APRT'
steps:
- uses: actions/checkout@v3
- name: checkout (schedule)
if: github.event.schedule
uses: actions/checkout@v3

- name: checkout (pr comments)
if: github.event.issue.pull_request
uses: actions/checkout@v3
with:
ref: ${{ format('refs/pull/{0}/merge', github.event.issue.number) }}

- name: Set up Python
uses: actions/setup-python@v2
Expand All @@ -28,13 +36,9 @@ jobs:
pip install twine
pip install psycopg2-binary
- name: Check if it is triggered by PR comments
if: github.event.issue.pull_request
run: |
export IS_PR=1
- name: Run benchmark
run: |
python python/nano/benchmark/run.py resnet50
env:
ANALYTICS_ZOO_ROOT: ${{ github.workspace }}
IS_PR: ${{ github.event.issue.pull_request != null}}
2 changes: 1 addition & 1 deletion python/nano/benchmark/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def _extract_logs(output: str):
return logs

def _save_logs(self, logs: list):
is_pr = True if os.environ.get('IS_PR') is not None else False
is_pr = True if os.environ.get('IS_PR') == 'true' else False
timestamp = datetime.now()
conn = psycopg2.connect(
database=self._get_secret('DB_NAME'),
Expand Down

0 comments on commit 60c4bef

Please sign in to comment.