Skip to content

Commit

Permalink
Create benchmarking action. (#238)
Browse files Browse the repository at this point in the history
* Create benchmarking.yml

* Create initial .yml and use df_docs for testing

* Fix for the action to run on this branch push.

* Fix for pytest to recognize benchmark test.

* Update test requirements to also install pytest benchmarking.

* Benchmarking (python-side) (#240)

* Create benchmarking.py

I hope this one works... I'm not great with GitHub to say the least.

* Benchmarking complete.

* Final touches (still need to add dropshot, tho).

* Placed benchmarking in tests, and added a short Dropshot replay. Complete?

Co-authored-by: DivvyCr <[email protected]>

* Create benchmarking.yml

* Create initial .yml and use df_docs for testing

* Fix for the action to run on this branch push.

* Fix for pytest to recognize benchmark test.

* Update test requirements to also install pytest benchmarking.

* Rebase branch. Use proper benchmarking.

Co-authored-by: DivvyCr <[email protected]>
  • Loading branch information
DivvyCr and DivvyCr authored May 1, 2020
1 parent 0ad60bc commit 0d03653
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/benchmarking.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Benchmarking

on:
push:
branches: [ master, action-benchmark ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: '3.7'
architecture: 'x64'

- name: Install/Update pip and wheel.
run:
python -m pip install --upgrade pip &&
pip install wheel

- name: Set-up and install protobuf.
run: chmod 777 ./_travis/install-protoc.sh && ./_travis/install-protoc.sh 2.6.1

- name: Install dependencies.
run: pip install -r requirements.txt && pip install -r requirements-test.txt

- name: Initialise.
run: python init.py

- name: Prepare benchmark.
run: |
pip install -r requirements.txt && pip install -r requirements-test.txt
cd carball/tests/benchmarking
echo === BENCHMARK DIRECTORY ===
ls -lh
echo ===========================
- name: Run benchmark.
run: |
cd carball/tests/benchmarking
pytest benchmarking.py
# TO BE DONE.
# - name: Store benchmark result(s).
4 changes: 4 additions & 0 deletions carball/tests/docs/data_frame_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,9 @@ def create_df_docs():
df_docs.write("\n\t" + c[1])


def test_benchmark(benchmark):
benchmark(create_df_docs)


if __name__ == '__main__':
create_df_docs()
1 change: 1 addition & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
twine
pytest>=5.4.1
pytest-benchmark
requests
pytest-cov>=2.8.1
coverage
Expand Down

0 comments on commit 0d03653

Please sign in to comment.