-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'issues/208' of https://github.com/mwvgroup/Pitt-Google-…
…Broker into issues/208
- Loading branch information
Showing
8 changed files
with
1,414 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Test Broker | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
push: | ||
|
||
env: | ||
PYTHON_VERSION: 3.11 | ||
|
||
jobs: | ||
discover: | ||
name: Discover Microservices | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
matrix: ${{ steps.find_tests.outputs.matrix }} | ||
|
||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v4 | ||
|
||
- name: Find testable apps | ||
id: find_tests | ||
run: | | ||
# Find application directories containing a 'tests' subdirectory nd format the result as JSON | ||
test_dirs=$(find broker/cloud_functions -type d -name "tests" -exec dirname {} \; | jq -R . | jq -s . | tr -d '\n') | ||
echo "found $test_dirs" | ||
echo "matrix={\"app_dir\":$test_dirs}" >> $GITHUB_OUTPUT | ||
test: | ||
name: Test Microservices | ||
runs-on: ubuntu-latest | ||
needs: [ discover ] | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: ${{ fromJSON(needs.discover.outputs.matrix) }} | ||
|
||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install coverage | ||
pip install -r ${{ matrix.app_dir }}/requirements.txt | ||
- name: Test ${{ matrix.app_dir }} app | ||
run: coverage run -m unittest discover ${{ matrix.app_dir }} | ||
|
||
report-status: | ||
name: Report Test Status | ||
if: always() | ||
needs: [ test ] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check build status | ||
if: ${{ contains(needs.*.result, 'failure') }} | ||
run: exit 1 |
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
broker/cloud_functions/classify_snn/tests/test_cloud_fnc.py
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
"""This test module is an example placeholder put in place while deveoping the CI toolchain.""" | ||
|
||
from unittest import TestCase | ||
|
||
|
||
class Placeholder(TestCase): | ||
"""A set of placeholder tests""" | ||
|
||
def test_pass(self) -> None: | ||
"""This test will always pass""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.