This is an example repository for writing tests, for the Sciware Testing session. It demonstrates how to setup a repository to use GitHub actions to automatically run tests on the code.
- python3 with pip3 (with optional virtualenv or conda)
git clone https://github.com/flatironinstitute/sciware-testing-python.git
cd sciware-testing-python
pip3 install -e .
This will work with a virtualenv, conda, or on a personal machine.
With a system python, you may need pip3 install --user -e .
.
This will also install dependencies (like pytest
) specified in requirements.txt
.
The -e
indicates that we want to continue developing (editing) the installed package.
pytest
If you fork this project you should do the following things to make sure that your fork is correctly linked to your GitHub account:
- If you haven't linked your GitHub account to
codecov
, do so now. - Change the badge URL at the top of
README.md
to point to your GitHub workflow build. To do this, replaceflatironinstitute
with your GitHub handle in the URLs of the badge. - Change the badge URL at the top of
README.md
to point to yourcodecov
report. Go tocodecov
, navigate to thesciware-testing-python
project, then go to Settings > Badge. - Change your
codecov
token in your GitHub actions file (in.github/workflows
). To get your token go tocodecov
, navigate to thesciware-testing-python
project, then go to Settings > General >Repository Upload Token
. Copy this token and use it to set theCODECOV_TOKEN
variable in.github/workflows
.
README.md
- File generating this pagesetup.py
- File describing the metadata for the package and rules to build/install/test itrequirements.txt
- File listing the packages required to run the code. It is included by setup.pyLICENSE
- File containing the text of the license the code is released under. Having a license file allows other people to use the codesciware_testing_python/
- Directory for all the codesciware_testing_python/__init.py__
- File that python imports to define thesciware_testing_python
packagesciware_testing_python/exercise.py
- File with all of the code to fill insciware_testing_python/examples.py
- Example working solutionstests/
- Directory for the code which tests the code insciware_testing_python
tests/test_exercise.py
- File to fill in with some teststests/test_examples.py
- File containing some tests.gitignore
- File which tells github what files to not track (optional).github/workflows/
- Directory containing the configuration file for GitHub actions.github/workflows/test.yml
- File detailing the system configurations to use for the tests.