Skip to content

Commit

Permalink
modified unit tests, readme
Browse files Browse the repository at this point in the history
  • Loading branch information
GhaziSyed committed Jun 28, 2024
1 parent ffe41a3 commit bd4b28a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ jobs:
- name: Run tests
run: |
pytest fmperf/tests/test_imports.py
pytest fmperf/tests/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Firstly, one can generate a set of requests assuming simple uniform distribution
```bash
docker run --env-file .env -it --rm -v $(pwd)/requests:/requests fmperf python -m fmperf.loadgen.generate-input
```
Alternatively, one can generate a set of requests using models that have been trained on requests sent to the internal production deployment of BAM:
Alternatively, one can generate a set of requests using models that have been trained on requests sent to a production deployment:
```bash
docker run --env-file .env -it --rm -v $(pwd)/requests:/requests fmperf python -m fmperf.loadgen.generate-input --from-model
```
Expand Down
32 changes: 32 additions & 0 deletions fmperf/tests/test_import.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import unittest
import logging


# Configure logging
logging.basicConfig(filename='test_logs.log', level=logging.DEBUG,
format='%(asctime)s %(levelname)s:%(message)s', filemode='w')
logging.debug('Logging configured successfully')

# Test class to check if the imports are working for the files in the examples folder
class TestImports(unittest.TestCase):
def setUp(self):
# Setup code goes here
logging.info("Running a test case.")

def tearDown(self):
# Teardown code can go here, if we needed to clean up after tests
pass

def test_fmperf_import(self):
"""Test if fmperf import works correctly."""
try:
import fmperf
self.assertIsNotNone(fmperf)
logging.info("test_fmperf_import passed.")
except Exception as e:
logging.error(f"test_fmperf_import failed: {e}")
raise

if __name__ == '__main__':
unittest.main()
logging.getLogger().handlers[0].flush()

0 comments on commit bd4b28a

Please sign in to comment.