Skip to content

Provide functionality to run the linter and tests for one service #688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ jobs:
poetry config virtualenvs.create false
make install-dev
- name: Lint
run: make lint
run: make lint-services
- name: Test
run: make test
run: make test-services
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,28 @@ install-dev:
# install core. This needs to be done last or it will get overriden by the dependency installation of the services
poetry install -C core --no-root; pip install -e core

test:
test-services:
# test core
cd core && poetry install --with dev && pytest
# test services
@for f in $(shell ls ${SERVICES_DIR}); do set -e; cd ${SERVICES_DIR}/$${f}; poetry install --with dev;sh -c 'pytest || ([ $$? = 5 ] && exit 0 || exit $$?)'; cd ../..; done

lint:
lint-services:
# lint core
cd core && poetry install --no-root --only dev &&flake8 .
# lint examples. Use configuration from core
flake8 --toml-config core/pyproject.toml --black-config core/pyproject.toml examples;
# lint services
@for f in $(shell ls ${SERVICES_DIR}); do set -e; cd ${SERVICES_DIR}/$${f};poetry install --no-root --only dev; flake8 .; cd ../..; done

test:
echo "Testing service ${service}"
cd ${SERVICES_DIR}/${service}; poetry install --with dev;sh -c 'pytest || ([ $$? = 5 ] && exit 0 || exit $$?)'; cd ../..;

lint:
echo "Linting service ${service}"
cd ${SERVICES_DIR}/${service};poetry install --no-root --only dev; flake8 .; cd ../..;

update-dependencies:
# lock core
cd core && poetry lock
Expand Down
Loading