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

bug-1884212: re-root antenna tests #1021

Merged
merged 1 commit into from
May 25, 2024
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 docs/dev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ production, see documentation_.

<pytest output>

app@...$ pytest tests/unittest/test_crashstorage.py
app@...$ pytest tests/test_crashstorage.py

We're using pytest_ for a test harness and test discovery.

Expand Down Expand Up @@ -423,7 +423,7 @@ For example:

<pytest output>

app@...$ pytest tests/unittest/test_crashstorage.py
app@...$ pytest tests/test_crashstorage.py

We're using pytest_ for a test harness and test discovery.

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ docstring-quotes = "double"
[tool.pytest.ini_options]
addopts = "-rsxX --tb=native --showlocals -m 'not gcp'"
norecursedirs = [".git", "docs", "bin"]
testpaths = "tests/unittest/"
testpaths = "tests/"

markers = [
"aws: tests that require aws backends to be configured in the environment. this is the default.",
Expand Down
32 changes: 14 additions & 18 deletions tests/README.rst
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
============
Tests README
============
======
README
======

In this directory are all the tests for Antenna. Each subdirectory holds a
different test system. Consult the README in the subdirectory for details
on setting up and running those tests.
These test the Antenna code. We use the pytest test runner.

Contents of this directory::

Subdirectories
==============
data/ -- holds test data
conftest.py -- holds pytest fixtures
test_*.py -- a test file

**tests/data/**

Data to make it easier to test a local instance.
Run these tests from the repository root using::

**tests/unittest/**
make test

These are written in Python, use pytest as the test runner and are run
during normal development to unit test the code in Antenna.

Run these with::
To run a single test or group of tests or with different options, do::

$ make test
make testshell

Run with more options with::

$ make testshell
app@xxx:/app$ pytest
This gives you a bash shell in the docker container where you can more easily
do test runs and debugging.
2 changes: 1 addition & 1 deletion tests/unittest/conftest.py → tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@


# Add repository root so we can import antenna and testlib.
REPO_ROOT = Path(__file__).parent.parent.parent
REPO_ROOT = Path(__file__).parent.parent.resolve()
sys.path.insert(0, str(REPO_ROOT))

from antenna.app import get_app, setup_logging # noqa
Expand Down
File renamed without changes.
4 changes: 3 additions & 1 deletion tests/unittest/test_bin.py → tests/test_bin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

from click.testing import CliRunner

sys.path.insert(0, str(Path(__file__).resolve().parent.parent.parent / "bin"))
# Add bin/ directory so we can import scripts
REPO_ROOT = Path(__file__).parent.parent.resolve()
sys.path.insert(0, str(REPO_ROOT / "bin"))


class TestPubSubCli:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 0 additions & 24 deletions tests/unittest/README.rst

This file was deleted.