Skip to content

Commit

Permalink
Merge 4947cea into c87fea1
Browse files Browse the repository at this point in the history
  • Loading branch information
smarr committed Aug 8, 2022
2 parents c87fea1 + 4947cea commit c4b2665
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,36 @@ jobs:
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
if: ${{ matrix.coverage && env.COVERALLS_REPO_TOKEN != '' }}

test-docker:
name: Test ReBench in Docker
runs-on: ubuntu-latest
container:
image: python:3

steps:
- name: Check for dockerenv file
run: (ls /.dockerenv && echo Found dockerenv) || (echo No dockerenv)

- name: Make Python to be Python3
run: ln -s /usr/bin/python3 /usr/bin/python && ln -s /usr/bin/pip3 /usr/bin/pip

- name: Install Time Command
run: |
apt-get update
apt-get install -y --no-install-recommends time
- name: Checkout ReBench
uses: actions/checkout@v2

- name: Install PyTest
run: pip install pytest

- name: Install ReBench dependencies
run: pip install .

- name: Run Test Run
run: (cd rebench && rebench ../rebench.conf e:TestRunner2)

- name: Run Unit Tests
run: python -m pytest
12 changes: 11 additions & 1 deletion rebench/denoise.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
except ValueError:
rebench_version = "unknown"

try:
FileNotFoundError
except NameError:
FileNotFoundError = IOError


class DenoiseResult(object):

Expand Down Expand Up @@ -48,6 +53,9 @@ def minimize_noise(show_warnings, ui, for_profiling):
except subprocess.CalledProcessError as e:
output = output_as_str(e.output)
got_json = False
except FileNotFoundError as e:
output = str(e)
got_json = False

msg = 'Minimizing noise with rebench-denoise failed\n'
msg += '{ind}possibly causing benchmark results to vary more.\n\n'
Expand Down Expand Up @@ -100,6 +108,8 @@ def minimize_noise(show_warnings, ui, for_profiling):
+ denoise_cmd + '\n'
elif 'command not found' in output:
msg += '{ind}Please make sure `rebench-denoise` is on the PATH\n'
elif "No such file or directory: 'sudo'" in output:
msg += '{ind}sudo is not available. Can\'t use rebench-denoise to manage the system.\n'
else:
msg += '{ind}Error: ' + escape_braces(output)

Expand All @@ -126,7 +136,7 @@ def restore_noise(denoise_result, show_warning, ui):
if not denoise_result.use_nice:
cmd += ['--without-nice']
subprocess.check_output(cmd + ['restore'], stderr=subprocess.STDOUT)
except subprocess.CalledProcessError:
except (subprocess.CalledProcessError, FileNotFoundError):
pass

if not denoise_result.succeeded and show_warning:
Expand Down
2 changes: 1 addition & 1 deletion rebench/tests/persistency.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ benchmark_suites:
TestSuite:
invocations: 10
min_iteration_time: 1
gauge_adapter: Time
gauge_adapter: TestExecutor
command: 1 FooBar %(benchmark)s 2 3 4
benchmarks:
- TestBench
Expand Down

0 comments on commit c4b2665

Please sign in to comment.