Skip to content

Commit

Permalink
Update collection build ignores (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
teddyphreak authored Nov 22, 2024
1 parent af75fec commit 973ec1f
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 22 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/pytest.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
name: pytest
name: test

on:
pull_request:
branches:
- master
schedule:
- cron: "0 5 * * 5"

jobs:
molecule:
Expand Down Expand Up @@ -36,7 +34,7 @@ jobs:
- name: Install role requirements
run: make requirements

- name: Run molecule tests.
- name: Run tests.
run: make test
env:
PY_COLORS: "1"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ tmp/
*.egg
build
htmlcov
*.tar.gz
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ COLLECTION_VERSION = $$(yq '.version' < galaxy.yml)
all: install version lint pytest verify

pytest: install
poetry run pytest tests
poetry run pytest tests/pytest
@echo

test: pytest verify
Expand Down
2 changes: 2 additions & 0 deletions galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ homepage: https://github.com/nephelaiio/ansible-collection-plugins
issues: https://github.com/nephelaiio/ansible-collection-plugins/issues
build_ignore:
- Makefile
- .venv
- tests
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ build-backend = "poetry.core.masonry.api"
venvPath = "."
venv = ".venv"
typeCheckingMode = "off"

[tool.pytest.ini_options]
pythonpath = ["plugins/filter", "plugins/test"]
8 changes: 0 additions & 8 deletions tests/test_filter.py → tests/pytest/test_filter.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
import os
import sys

import pytest

sys.path.append(os.path.join(os.path.dirname(sys.path[0]), "plugins", "filter"))

print(sys.path)

from custom_filter import ( # noqa: E402
alias_keys,
dict_to_list,
Expand Down
10 changes: 1 addition & 9 deletions tests/test_test.py → tests/pytest/test_test.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
import sys
import os
import pytest

sys.path.append(os.path.join(os.path.dirname(sys.path[0]), "plugins", "test"))

print(sys.path)

from custom_test import (test_network, test_property) # noqa: E402
from custom_test import test_network, test_property # noqa: E402


def test_test_network():
Expand Down

0 comments on commit 973ec1f

Please sign in to comment.