Skip to content

Commit 7b48be6

Browse files
committed
Setup CI for adapter with service dependencies
Signed-off-by: Tim Paine <[email protected]>
1 parent 2acdade commit 7b48be6

File tree

3 files changed

+72
-2
lines changed

3 files changed

+72
-2
lines changed

.github/workflows/build.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,3 +515,73 @@ jobs:
515515
# run: make test
516516

517517
##########################################################################################################################
518+
519+
###########################
520+
#~~~~~~~~~~~~~~~~~~~~~~~~~#
521+
#~~~~~~|#############|~~~~#
522+
#~~~~~~|#|~~~~~~~/##/~~~~~#
523+
#~~~~~~|#|~~~~~/##/~~~~~~~#
524+
#~~~~~~~~~~~~/##/~~~~~~~~~#
525+
#~~~~~~~~~~/##/~~~~~~~~~~~#
526+
#~~~~~~~~/##/~~~~~~~~~~~~~#
527+
#~~~~~~/##/~~~~~~~~~~~~~~~#
528+
#~~~~~~~~~~~~~~~~~~~~~~~~~#
529+
# Test Service Adapters #
530+
#~~~~~~~~~~~~~~~~~~~~~~~~~#
531+
test_adapters:
532+
needs:
533+
- initialize
534+
- build
535+
536+
strategy:
537+
matrix:
538+
os:
539+
- ubuntu-20.04
540+
python-version:
541+
- 3.9
542+
adapter:
543+
- kafka
544+
545+
runs-on: ${{ matrix.os }}
546+
547+
steps:
548+
- name: Checkout
549+
uses: actions/checkout@v4
550+
with:
551+
submodules: recursive
552+
553+
- name: Set up Python ${{ matrix.python-version }}
554+
uses: ./.github/actions/setup-python
555+
with:
556+
version: '${{ matrix.python-version }}'
557+
558+
- name: Install python dependencies
559+
run: make requirements
560+
561+
- name: Install test dependencies
562+
shell: bash
563+
run: sudo apt-get install graphviz
564+
565+
# Download artifact
566+
- name: Download wheel
567+
uses: actions/download-artifact@v4
568+
with:
569+
name: csp-dist-${{ runner.os }}-${{ matrix.python-version }}
570+
571+
- name: Install wheel
572+
run: python -m pip install -U *manylinux2014*.whl --target .
573+
574+
- name: Spin up adapter service
575+
run: make dockerup ADAPTER=${{ matrix.adapter }}
576+
577+
# Run tests
578+
- name: Setup test flagsl
579+
shell: bash
580+
run: echo "CSP_TEST_$( echo ${{ matrix.adapter }} | awk '{print toupper($0)}' )=1" >> $GITHUB_ENV
581+
582+
- name: Python Test Steps
583+
run: make test TEST_ARGS="-k ${{ matrix.adapter }}"
584+
585+
- name: Spin down adapter service
586+
run: make dockerdown ADAPTER=${{ matrix.adapter }}
587+
if: ${{ always() }}

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ tests: test
7777

7878
.PHONY: dockerup dockerps dockerdown initpodmanmac
7979
ADAPTER := kafka
80-
DOCKER := podman
80+
DOCKER := docker
8181

8282
initpodmanmac:
8383
podman machine stop

csp/tests/adapters/test_status.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class SubData(csp.Struct):
1414
a: bool
1515

1616

17-
class TestStatus:
17+
class TestStatusKafka:
1818
@pytest.mark.skipif(not os.environ.get("CSP_TEST_KAFKA"), reason="Skipping kafka adapter tests")
1919
def test_basic(self, kafkaadapter):
2020
topic = f"csp.unittest.{os.getpid()}"

0 commit comments

Comments
 (0)