Skip to content

Commit

Permalink
added github action for unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shashank-boyapally committed Jan 18, 2024
1 parent cc5bf2e commit 0bfdf8e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,23 @@ jobs:
test:
runs-on: ubuntu-latest

env:
ES_SERVER: ${{ secrets.ES_SERVER }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.11

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt # Replace with your requirements file if applicable
pip install -r fmatch/requirements.txt
- name: Run pytest
run: |
python -m pytest pytest fmatch/tests --cov --random-order
python -m pytest fmatch/tests --cov --random-order
3 changes: 0 additions & 3 deletions fmatch/matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,17 +261,14 @@ def parse_burner_cpu_results(self, data: dict):
"""
res = []
stamps = data['aggregations']['time']['buckets']
print("stamp",stamps)
cpu = data['aggregations']['uuid']['buckets']
print("cpu",cpu)
for stamp in stamps:
dat = {}
dat['uuid'] = stamp['key']
dat['timestamp'] = stamp['time']['value_as_string']
acpu = next(item for item in cpu if item["key"] == stamp['key'])
dat['cpu_avg'] = acpu['cpu']['value']
res.append(dat)
print("result",res)
return res

def convert_to_df(self, data, columns=None):
Expand Down
2 changes: 1 addition & 1 deletion fmatch/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ mccabe==0.7.0
mdurl==0.1.2
more-itertools==10.2.0
nh3==0.2.15
numpy==1.26.3
numpy==1.24.0
packaging==23.2
pandas==2.1.4
pip-name==1.0.2
Expand Down
1 change: 1 addition & 0 deletions fmatch/tests/test_matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""
#pylint: disable = redefined-outer-name
#pylint: disable = missing-function-docstring
#pylint: disable = import-error
import os

from elasticsearch.exceptions import NotFoundError
Expand Down

0 comments on commit 0bfdf8e

Please sign in to comment.