Skip to content

Commit

Permalink
Merge branch 'develop' into u/raen/ztf/v4_02
Browse files Browse the repository at this point in the history
  • Loading branch information
troyraen authored Feb 2, 2024
2 parents 97b6870 + 742ad65 commit d25f77d
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 71 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/BrokerTest.yml
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
61 changes: 0 additions & 61 deletions .github/workflows/TestCloudFunction.yml

This file was deleted.

10 changes: 0 additions & 10 deletions broker/cloud_functions/classify_snn/tests/test_cloud_fnc.py

This file was deleted.

10 changes: 10 additions & 0 deletions broker/cloud_functions/tag/tests/test_cloud_fnc.py
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"""

0 comments on commit d25f77d

Please sign in to comment.