Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine DECHAUME committed May 4, 2020
2 parents 03ccbc7 + d84dc1d commit 9076fce
Show file tree
Hide file tree
Showing 39 changed files with 384 additions and 212 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.ci
.eggs
*.egg-info
.tox
16 changes: 15 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,21 @@ All notable changes to this project will be documented here.
The format is based on `Keep a Changelog <https://keepachangelog.com/en/1.0.0/>`_,
and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0.html>`_.

0.3.0 - Unreleased
0.4.0 - 2020-05-03
------------------

Removed
~~~~~~~
- equal_nan option is too specific and can easily be added with a custom fixture.

0.3.1 - 2020-03-30
------------------

Added
~~~~~
- Report generation can handle a sphinx _static directory.

0.3.0 - 2020-03-19
------------------

Added
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include versioneer.py
include src/pytest_executable/*.yaml
52 changes: 48 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,49 @@
Pytest-executable
=================
# Pytest-executable

A pytest plugin for testing executables.
For more informations, please read the [documentation](https://pytest-executable.readthedocs.io/en/latest).
`pytest-executable` is a [pytest](https://docs.pytest.org/en/latest/) plugin
for checking and validating executables. This project is still young, but
already used in a professional environment.

## Documentation

The project documentation is available
[online](https://pytest-executable.readthedocs.io/en/latest) (or in the
[`doc`](doc) directory of the repository if you are fluent in
reStructuredText).

## Installation and Usage

A `pytest-executable` package will soon be available in the Conda-Forge and
PyPi repositories (just a matter of free time). In the meantime, you can get
`pytest-executable` by cloning the project repository on Github:

```bash
git clone https://github.com/CS-SI/pytest-executable.git
```

The components required for `pytest-executable` and how to install them are
described in the
[documentation](https://pytest-executable.readthedocs.io/en/latest/installation.html).

## Contributing

A contributing guide will be soon available (once again, just a matter of free
time).

Please fill an issue on the
[Github issue tracker](https://github.com/CS-SI/pytest-executable/issues) for
any bug report, feature request or question.

## Authors

* **[Antoine Dechaume](https://github.com/AntoineD)** - *Project creator and maintainer*

## Copyright and License

Copyright 2020, [CS GROUP](http://www.csgroup.eu)

`pytest-executable` is a free and open source software, distributed under the
Apache License 2.0. See the [`LICENSE.txt`](LICENSE.txt) file for more
information, or the
[quick summary](https://tldrlegal.com/license/apache-license-2.0-(apache-2.0)) of
this license on [tl;drLegal](https://tldrlegal.com/) website.
15 changes: 8 additions & 7 deletions doc/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,20 @@ Plugin options

.. option:: --default-settings PATH

use the yaml file at PATH for the global default test settings instead of
use PATH as the yaml file with the global default test settings instead of
the built-in ones

.. option:: --equal-nan

consider nan values as equal when doing comparison with the references for
the built-in regression testing

.. option:: --report-generator PATH
use the script at PATH to generate a test report

use PATH as the script to generate the test report

See the :file:`report-conf` directory for an example of such a script.

.. note::

The report generator script may require to install additionnal
dependencies, such as sphinx, which are not required by the plugin.


.. _filter:

Expand Down
1 change: 1 addition & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
'sphinx.ext.napoleon',
'sphinx.ext.autodoc',
'sphinx_autodoc_typehints',
'sphinxcontrib.spelling',
]

# Add any paths that contain templates here, relative to this directory.
Expand Down
8 changes: 0 additions & 8 deletions doc/fixtures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,3 @@ variable that holds a `Path`_ object.

You may use this fixture with the :py:data:`output_path` fixture to get the
path to the file that shall be compared to a reference file.


Equal Nan fixture
-----------------

This fixture provides the boolean :py:data:`equal_nan`, its value is set from
the |pytest| command line option :option:`--equal-nan`. See the option
documentation for more informations.
3 changes: 2 additions & 1 deletion requirements-doc.txt → doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
sphinx>=2
sphinx-autodoc-typehints
sphinx_rtd_theme
versioneer
sphinxcontrib.spelling
2 changes: 1 addition & 1 deletion doc/test-case.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ settings for running the case and finally perform the checks and
post-porcesses. If |yaml| is empty, then the default settings are used, which
is equivalent to using a |yaml| with the following contents:

.. literalinclude:: ../pytest_executable/test_case.yaml
.. literalinclude:: ../src/pytest_executable/test_case.yaml

This file is in yaml format, a widely used human friendly file format that
allows to define nested sections, lists of items, key-value pairs and more. To
Expand Down
2 changes: 1 addition & 1 deletion doc/test_case_yaml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ Builtin test module

This is the python module executed when the testing tool finds a :file:`test_case.yaml`, this module can be used as an example for writing new test modules.

.. literalinclude:: ../pytest_executable/test_case_yaml.py
.. literalinclude:: ../src/pytest_executable/test_case_yaml.py
6 changes: 3 additions & 3 deletions doc/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ For instance, if the test inputs tree contains::
├── dir-1
│ ├── case.input
│ └── test_case.yaml
└── dir-1
└── dir-2
├── case.input
└── test_case.yaml

Expand All @@ -52,15 +52,15 @@ Then the output tree is::
tests-output
├── dir-1
│ ├── case.input -> path/to/tests/inputs/dir-1/case.input
│ ├── case.ouput
│ ├── case.output
│ ├── executable.stderr
│ ├── executable.stdout
│ ├── run_executable.sh
│ ├── run_executable.stderr
│ └── run_executable.stdout
├── dir-2
├── case.input -> path/to/tests/inputs/dir-2/case.input
├── case.ouput
├── case.output
├── executable.stderr
├── executable.stdout
├── run_executable.sh
Expand Down
4 changes: 3 additions & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
[pytest]
addopts = --ignore tests/data
testpaths = tests
addopts =
--ignore tests/data
filterwarnings =
ignore::pytest.PytestExperimentalApiWarning
82 changes: 42 additions & 40 deletions report-conf/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@
# import sys
# sys.path.insert(0, os.path.abspath('.'))
def setup(app):
app.add_css_file("html_width.css")
app.add_css_file("html_width.css")


# -- Project information -----------------------------------------------------

project = 'Validation Case'
copyright = ''
author = ''
project = "Validation Case"
copyright = ""
author = ""

# The short X.Y version
version = ''
version = ""
# The full version, including alpha/beta/rc tags
release = 'V1.0'
release = "V1.0"


# -- General configuration ---------------------------------------------------
Expand All @@ -40,25 +41,25 @@ def setup(app):
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.mathjax',
"sphinx.ext.autodoc",
"sphinx.ext.mathjax",
]
mathjax_path = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS_CHTML-full"

#extensions = ['sphinxcontrib.katex']
# extensions = ['sphinxcontrib.katex']


# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -82,21 +83,23 @@ def setup(app):
# a list of builtin themes.
#

html_theme = 'sphinx_rtd_theme'
html_theme_path = ["_themes", ]
html_theme = "sphinx_rtd_theme"
html_theme_path = [
"_themes",
]
html_theme_options = {
'canonical_url': '',
'analytics_id': 'UA-XXXXXXX-1', # Provided by Google in your dashboard
'display_version': True,
'prev_next_buttons_location': 'bottom',
'style_external_links': False,
'style_nav_header_background': 'white',
"canonical_url": "",
"analytics_id": "UA-XXXXXXX-1", # Provided by Google in your dashboard
"display_version": True,
"prev_next_buttons_location": "bottom",
"style_external_links": False,
"style_nav_header_background": "white",
# Toc options
'collapse_navigation': True,
'sticky_navigation': True,
'navigation_depth': 4,
'includehidden': True,
'titles_only': False
"collapse_navigation": True,
"sticky_navigation": True,
"navigation_depth": 4,
"includehidden": True,
"titles_only": False,
}

# Theme options are theme-specific and customize the look and feel of a theme
Expand All @@ -106,7 +109,7 @@ def setup(app):
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
#html_static_path = ['_static']
html_static_path = ["_static"]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand All @@ -123,7 +126,7 @@ def setup(app):
# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'Validation Case'
htmlhelp_basename = "Validation Case"


# -- Options for LaTeX output ------------------------------------------------
Expand All @@ -132,15 +135,12 @@ def setup(app):
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -150,19 +150,15 @@ def setup(app):
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'Validation_case.tex', 'Validation case',
' ', 'manual'),
(master_doc, "Validation_case.tex", "Validation case", " ", "manual"),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'validation_case', 'Validation case',
[author], 1)
]
man_pages = [(master_doc, "validation_case", "Validation case", [author], 1)]


# -- Options for Texinfo output ----------------------------------------------
Expand All @@ -171,9 +167,15 @@ def setup(app):
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'Validation_case', 'Validation case',
author, 'Validation_case', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"Validation_case",
"Validation case",
author,
"Validation_case",
"One line description of project.",
"Miscellaneous",
),
]


Expand All @@ -192,7 +194,7 @@ def setup(app):
# epub_uid = ''

# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']
epub_exclude_files = ["search.html"]


# -- Extension configuration -------------------------------------------------
6 changes: 5 additions & 1 deletion report-conf/generate_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
with the command: conda install tabluate sphinx
"""

import shutil
import subprocess
import textwrap
from pathlib import Path
from typing import List, Tuple

import yaml

from tabulate import tabulate

# indentation used in the toc tree of the index template
Expand Down Expand Up @@ -130,6 +130,10 @@ def create_index_rst(output_root: Path) -> None:

# create the report index.rst
create_index_rst(output_root)
# copy the _static directory if it exists
static_path = DOC_GENERATOR_DIRPATH / "_static"
if static_path.exists():
shutil.copytree(static_path, output_root / "_static")

# command line to build the report
cmd = (
Expand Down

0 comments on commit 9076fce

Please sign in to comment.