Skip to content

Commit

Permalink
Basic sync test support
Browse files Browse the repository at this point in the history
  • Loading branch information
erikzaadi committed Aug 29, 2024
1 parent 7f1a07d commit d94f0ed
Show file tree
Hide file tree
Showing 5 changed files with 243 additions and 104 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ jobs:
- name: Test
working-directory: ${{ matrix.folder != '.' && format('integrations/{0}', matrix.folder) || '.' }}
env:
PYTEST_ADDOPTS: --junitxml=junit/test-results-${{ matrix.folder != '.' && format('integrations/{0}', matrix.folder) || '.' }}.xml
PYTEST_ADDOPTS: --junitxml=junit/test-results-${{ matrix.folder != '.' && format('integrations/{0}', matrix.folder) || 'ocean/core' }}.xml
run: |
make test
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: ${{ always() }}
with:
report_paths: '**/junit/test-results-**/*.xml'
include_passed: true
require_tests: true
20 changes: 17 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ define deactivate_virtualenv
fi
endef

.SILENT: install install/all test/all lint build run new test clean bump/integrations bump/single-integration
.SILENT: install install/all test/all lint build run new test test/watch clean bump/integrations bump/single-integration


# Install dependencies
Expand All @@ -56,7 +56,15 @@ install:

test/all: test
$(ACTIVATE) && \
pytest --import-mode=importlib -n auto ./port_ocean/tests ./integrations/*/tests
for dir in $(wildcard $(CURDIR)/integrations/*); do \
count=$$(find $$dir -type f -name '*.py' -not -path "*/venv/*" | wc -l); \
if [ $$count -ne 0 ]; then \
echo "Testing $$dir"; \
cd $$dir; \
$(MAKE) test || exit_code=$$?; \
cd ../..; \
fi; \
done;

install/all: install
exit_code=0; \
Expand Down Expand Up @@ -89,7 +97,13 @@ new:
$(ACTIVATE) && poetry run ocean new ./integrations --public

test:
$(ACTIVATE) && pytest -vv -n auto --ignore-glob=./integrations/* ./port_ocean/tests
$(ACTIVATE) && pytest

test/watch:
$(ACTIVATE) && \
pytest \
--color=yes \
-f

clean:
@find . -name '.venv' -type d -exec rm -rf {} \;
Expand Down
Loading

0 comments on commit d94f0ed

Please sign in to comment.