Skip to content

Commit

Permalink
Update testing.rst [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljprice committed Jul 18, 2023
1 parent 69b3a71 commit 930c2d3
Showing 1 changed file with 59 additions and 51 deletions.
110 changes: 59 additions & 51 deletions docs/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,36 @@ On every pull request a sequence of continuous integration tests
are performed to check that code is safe to merge into master.
The scripts in the .github/workflows directory are as follows:

- build: checks that phantom, phantomsetup, phantomanalysis and phantommoddump compile with every possible SETUP= flag
- test: runs the test suite [see below]
- mpi: runs the test suite with MPI [see below]
- mcfost: compiles and links phantom+mcfost
- |build|_: checks that phantom, phantomsetup, phantomanalysis and phantommoddump compile with every possible SETUP= flag
- |test|_: runs the test suite [see below]
- |mpi|_: runs the test suite with MPI [see below]
- |mcfost|_: compiles and links phantom+mcfost

.. |build| image:: https://github.com/danieljprice/phantom/actions/workflows/build.yml/badge.svg
.. _build: https://github.com/danieljprice/phantom/actions/workflows/build.yml

.. |test| image:: https://github.com/danieljprice/phantom/actions/workflows/test.yml/badge.svg
.. _test: https://github.com/danieljprice/phantom/actions/workflows/test.yml

.. |mpi| image:: https://github.com/danieljprice/phantom/actions/workflows/mpi.yml/badge.svg
.. _mpi: https://github.com/danieljprice/phantom/actions/workflows/mpi.yml

.. |mcfost| image:: https://github.com/danieljprice/phantom/actions/workflows/mcfost.yml/badge.svg
.. _mcfost: https://github.com/danieljprice/phantom/actions/workflows/mcfost.yml

Running the test suite on your own machine
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can run the test suite using:

::
You can run the test suite using::

make test

This is just a shortcut for the following sequence of commands:

::
This is just a shortcut for the following sequence of commands::

make SETUP=test phantomtest
./bin/phantomtest

You can run the complete testsuite yourself using the testbot wrapper script:

::
You can run the complete testsuite yourself using the testbot wrapper script::

cd phantom/scripts
./testbot.sh
Expand All @@ -37,9 +43,7 @@ Running selected parts of the test suite
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can run just part of the test suite by giving an additional argument
as follows:

::
as follows::

make SETUP=test phantomtest && ./bin/phantomtest derivs

Expand Down Expand Up @@ -111,9 +115,7 @@ offline as follows::
If you want to check only those SETUPS that were failing in the actions,
edit the buildbot.sh script and override the allsetups= line, e.g::

```
allsetups='disc empty'
```
allsetups='disc star'

Common reasons for failure
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -128,45 +130,51 @@ How to reproduce the github build environment offline
======================================================
Just occasionally it is hard to reproduce a failure in the actions. It *is*
possible to recreate the github actions environment offline, using a Docker container.
I suggest to do this *only* as a last resort. The recommended steps are::
I suggest to do this *only* as a last resort. The recommended steps are as follows:

Running the actions locally
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. Install [Docker](https://docs.docker.com/desktop/install/mac-install/)
2. Install [act](https://github.com/nektos/act)
3. run the pull_request workflow::
```
act pull_request
```
1. Install `Docker <https://docs.docker.com/desktop/install/mac-install/>`_
2. Install `act <https://github.com/nektos/act>`_
3. run the pull_request workflow

::

act pull_request

Checking the phantom build that is failing manually
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you just want to check things manually but in the same environment
as used in the actions, try the following::

1. Install [Docker](https://docs.docker.com/desktop/install/mac-install/)
2. Install Docker command line tools::
```
brew install docker
```
3. Install the ubuntu-latest image in Docker, e.g. by typing in a terminal [around 6.5Gb download]::
```
docker pull nektos/act-environments-ubuntu:18.04
```
3. Run the image, and proceed to run phantom build checks manually::
```
git clone https://github.com/danieljprice/phantom
mkdir -p runs/mydisc
cd runs/mydisc
~/phantom/scripts/writemake.sh disc > Makefile
export DEBUG=yes
export PHANTOM_DIR=~/phantom
make
make setup
make analysis
make moddump
./phantomsetup disc
./phantomsetup disc
./phantomsetup disc
./phantom disc
```
2. Install Docker command line tools

::

brew install docker

3. Install the ubuntu-latest image in Docker, e.g. by typing in a terminal [around 6.5Gb download]

::

docker pull nektos/act-environments-ubuntu:18.04

4. Run the image, and proceed to run phantom build checks manually

::

git clone https://github.com/danieljprice/phantom
mkdir -p runs/mydisc
cd runs/mydisc
~/phantom/scripts/writemake.sh disc > Makefile
export DEBUG=yes
export PHANTOM_DIR=~/phantom
make
make setup
make analysis
make moddump
./phantomsetup disc
./phantomsetup disc
./phantomsetup disc
./phantom disc

0 comments on commit 930c2d3

Please sign in to comment.