Skip to content

Commit

Permalink
bug-1884212: re-root antenna tests
Browse files Browse the repository at this point in the history
This re-roots the antenna tests so tests are under tests/ and not
tests/unittest/. The latter implies a test categorization we're not
using and it's confusing.
  • Loading branch information
willkg committed May 25, 2024
1 parent 739b4cc commit d16b3f7
Show file tree
Hide file tree
Showing 22 changed files with 21 additions and 47 deletions.
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.
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.
24 changes: 0 additions & 24 deletions tests/unittest/README.rst

This file was deleted.

0 comments on commit d16b3f7

Please sign in to comment.