Skip to content
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

Move unit tests and enable them for pull requests #291

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion did.spec
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ install -pm 644 did.1.gz %{buildroot}%{_mandir}/man1

%check
export LANG=en_US.utf-8
%{__python3} -m pytest -vv tests/test*.py -k 'not smoke'
%{__python3} -m pytest -vv tests/unit/test*.py -k 'not smoke'

%files
%{_mandir}/man1/*
Expand Down
2 changes: 1 addition & 1 deletion plans/smoke.fmf → plans/basic.fmf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
summary:
Basic smoke test
Check basic functionality
discover:
how: fmf
provision:
Expand Down
File renamed without changes.
11 changes: 11 additions & 0 deletions tests/unit/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
summary: Python unit tests
description:
Run all available python unit tests using pytest.
test: python3 -m pytest -vvv -ra --showlocals
duration: 15m
framework: shell
require:
- python3-pytest
environment:
LANG: en_US.UTF-8
tier: 0
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/test_cli.py → tests/unit/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Prepare path and config examples
PATH = os.path.dirname(os.path.realpath(__file__))
MINIMAL = did.base.Config.example()
EXAMPLE = "".join(open(PATH + "/../examples/config").readlines())
EXAMPLE = "".join(open(PATH + "/../../examples/config").readlines())

Check warning

Code scanning / CodeQL

File is not always closed Warning test

File is opened but is not closed.
# Substitute example git paths for real life directories
EXAMPLE = re.sub(r"\S+/git/[a-z]+", PATH, EXAMPLE)

Expand Down
File renamed without changes.
File renamed without changes.
Loading