From 9f4dbabf20d1d098b58b5af426af835b08613a32 Mon Sep 17 00:00:00 2001 From: Eric Gallimore <egallimore@whoi.edu> Date: Fri, 12 Jan 2024 13:32:31 -0500 Subject: [PATCH 1/9] Attempt to get unit test output --- .gitlab-ci.yml | 3 +++ tests/test_codecs.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 18789e1..18ba834 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -38,6 +38,9 @@ test: - pip install -r requirements.txt - pip install . - python3 tests/test_codecs.py + artifacts: + reports: + junit: 'results.xml' auto-docs: image: ltcodecs-docs:latest diff --git a/tests/test_codecs.py b/tests/test_codecs.py index 5df51de..2dcbee9 100755 --- a/tests/test_codecs.py +++ b/tests/test_codecs.py @@ -424,4 +424,4 @@ class TestCodecs: if __name__ == "__main__": - sys.exit(pytest.main(['--capture=no', __file__])) + sys.exit(pytest.main(['--capture=no', '--junitxml=results.xml', __file__])) -- GitLab From 92637e3e80c110edc627028f1f7e6216b2f92f2c Mon Sep 17 00:00:00 2001 From: Eric Gallimore <egallimore@whoi.edu> Date: Fri, 12 Jan 2024 13:37:03 -0500 Subject: [PATCH 2/9] Some tweaks to doc generation. --- .gitlab-ci.yml | 2 -- docs/auto-docs.Dockerfile | 5 +---- docs/conf.py | 4 ++-- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 18ba834..3d9e091 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -48,7 +48,6 @@ auto-docs: script: - pip install -r requirements.txt - pip install . - - pip install python-docs-theme - cd docs - make latexpdf - mv _build/latex/ltcodecs.pdf .. @@ -62,7 +61,6 @@ pages: script: - pip install -r requirements.txt - pip install . - - pip install python-docs-theme - cd docs - sphinx-build -b html . ../public artifacts: diff --git a/docs/auto-docs.Dockerfile b/docs/auto-docs.Dockerfile index 4e908ad..65faa37 100644 --- a/docs/auto-docs.Dockerfile +++ b/docs/auto-docs.Dockerfile @@ -24,7 +24,4 @@ RUN apt-get install --no-install-recommends -y \ && apt-get autoremove \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* -RUN pip install -U sphinx -RUN pip install -U pytest -RUN pip install -U sphinxawesome-theme -RUN pip install -U python-docs-theme \ No newline at end of file +RUN pip install -U sphinx sphinx-book-theme myst_parser pytest \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 64c2a84..b03fd58 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -21,7 +21,7 @@ release = "2.0.1" # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration # Napoleon allows using numpy- or Google-style docstrings -extensions = ["sphinx.ext.autodoc", "sphinx.ext.napoleon"] +extensions = ["myst_parser", "sphinx.ext.autodoc", "sphinx.ext.napoleon"] exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] @@ -35,7 +35,7 @@ latex_elements = { # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output -html_theme = "python_docs_theme" +html_theme = "sphinx_book_theme" add_function_parentheses = True add_module_names = True -- GitLab From c2068fa033753666c260e17d259bbf3fdb14d2dc Mon Sep 17 00:00:00 2001 From: Eric Gallimore <egallimore@whoi.edu> Date: Fri, 12 Jan 2024 13:42:33 -0500 Subject: [PATCH 3/9] Attempt at coverage --- .gitlab-ci.yml | 3 +++ tests/test_codecs.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3d9e091..1064245 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -41,6 +41,9 @@ test: artifacts: reports: junit: 'results.xml' + coverage_report: + coverage_format: cobertura + path: coverage.xml auto-docs: image: ltcodecs-docs:latest diff --git a/tests/test_codecs.py b/tests/test_codecs.py index 2dcbee9..5d38c21 100755 --- a/tests/test_codecs.py +++ b/tests/test_codecs.py @@ -424,4 +424,5 @@ class TestCodecs: if __name__ == "__main__": - sys.exit(pytest.main(['--capture=no', '--junitxml=results.xml', __file__])) + ltcodecs_path = os.path.dirname(__file__) + "/../src/ltcodecs" + sys.exit(pytest.main(['--capture=no', '--junitxml=results.xml', '--cov='+ltcodecs_path, '--cov-report=xml', __file__])) -- GitLab From 0a1ab07a6f1a6cbe35aed9869f8a6b8da7b889d1 Mon Sep 17 00:00:00 2001 From: Eric Gallimore <egallimore@whoi.edu> Date: Fri, 12 Jan 2024 13:43:45 -0500 Subject: [PATCH 4/9] Fix missing pytest-cov requirement. --- tests/tests.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tests.Dockerfile b/tests/tests.Dockerfile index 3f617c5..e04f2f5 100644 --- a/tests/tests.Dockerfile +++ b/tests/tests.Dockerfile @@ -3,4 +3,4 @@ FROM ros:noetic-ros-core # install ros package RUN apt-get update && apt-get upgrade -y RUN apt install python3-pip -y -RUN pip install pytest \ No newline at end of file +RUN pip -U install pytest pytest-cov \ No newline at end of file -- GitLab From be99184cd5279b88a560b3d2ac301d2723733902 Mon Sep 17 00:00:00 2001 From: Eric Gallimore <egallimore@whoi.edu> Date: Fri, 12 Jan 2024 13:45:20 -0500 Subject: [PATCH 5/9] Fix pip command. --- tests/tests.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tests.Dockerfile b/tests/tests.Dockerfile index e04f2f5..a9a7403 100644 --- a/tests/tests.Dockerfile +++ b/tests/tests.Dockerfile @@ -3,4 +3,4 @@ FROM ros:noetic-ros-core # install ros package RUN apt-get update && apt-get upgrade -y RUN apt install python3-pip -y -RUN pip -U install pytest pytest-cov \ No newline at end of file +RUN pip install -U pytest pytest-cov \ No newline at end of file -- GitLab From afab0e509affffd68dca311e31858bf08abb07e9 Mon Sep 17 00:00:00 2001 From: Eric Gallimore <egallimore@whoi.edu> Date: Fri, 12 Jan 2024 13:53:02 -0500 Subject: [PATCH 6/9] Add coverage report to terminal output. --- tests/test_codecs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_codecs.py b/tests/test_codecs.py index 5d38c21..f1837f5 100755 --- a/tests/test_codecs.py +++ b/tests/test_codecs.py @@ -425,4 +425,4 @@ class TestCodecs: if __name__ == "__main__": ltcodecs_path = os.path.dirname(__file__) + "/../src/ltcodecs" - sys.exit(pytest.main(['--capture=no', '--junitxml=results.xml', '--cov='+ltcodecs_path, '--cov-report=xml', __file__])) + sys.exit(pytest.main(['--capture=no', '--junitxml=results.xml', '--cov='+ltcodecs_path, '--cov-report=xml', '--cov-report=term', __file__])) -- GitLab From bbdf796381f4654fe624f01b9d4fd9407e35bcc5 Mon Sep 17 00:00:00 2001 From: Eric Gallimore <egallimore@whoi.edu> Date: Fri, 12 Jan 2024 13:57:48 -0500 Subject: [PATCH 7/9] Add coverage parsing. --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1064245..ab521e5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -44,6 +44,7 @@ test: coverage_report: coverage_format: cobertura path: coverage.xml + coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+)%/' auto-docs: image: ltcodecs-docs:latest -- GitLab From 7932f9f4ee4f3fca782fa225b7820973cfac32ab Mon Sep 17 00:00:00 2001 From: Eric Gallimore <egallimore@whoi.edu> Date: Fri, 12 Jan 2024 14:00:45 -0500 Subject: [PATCH 8/9] Fix coverage path. --- tests/test_codecs.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/test_codecs.py b/tests/test_codecs.py index f1837f5..49414fa 100755 --- a/tests/test_codecs.py +++ b/tests/test_codecs.py @@ -424,5 +424,4 @@ class TestCodecs: if __name__ == "__main__": - ltcodecs_path = os.path.dirname(__file__) + "/../src/ltcodecs" - sys.exit(pytest.main(['--capture=no', '--junitxml=results.xml', '--cov='+ltcodecs_path, '--cov-report=xml', '--cov-report=term', __file__])) + sys.exit(pytest.main(['--capture=no', '--junitxml=results.xml', '--cov=ltcodecs', '--cov-report=xml', '--cov-report=term', __file__])) -- GitLab From cb7abe5e5fd6984e8b9953479101b1c3379d50fd Mon Sep 17 00:00:00 2001 From: Eric Gallimore <egallimore@whoi.edu> Date: Fri, 12 Jan 2024 14:06:36 -0500 Subject: [PATCH 9/9] Add badges to README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 6fc704a..b8ab8b8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # LT Codecs + [](https://git.whoi.edu/acomms/ltcodec/-/commits/master) + [](https://git.whoi.edu/acomms/ltcodec/-/commits/master) + [](https://git.whoi.edu/acomms/ltcodec/-/releases) + Flexible, lightweight codec system for transferring messages over acoustic and other low-throughput links. See the documentation for more information: https://acomms.pages.whoi.edu/ltcodec/ -- GitLab