Skip to content

Commit 2d85512

Browse files
author
Nathan Goldbaum
committed
Updating the test suite docs to no longer reference a gold standard.
--HG-- branch : week-of-code
1 parent 5b2d4c7 commit 2d85512

File tree

1 file changed

+94
-160
lines changed

1 file changed

+94
-160
lines changed

doc/manual/source/user_guide/EnzoTestSuite.rst

+94-160
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ What's in the test suite?
1515

1616
The suite is composed of a large number of individual test problems
1717
that are designed to span the range of physics and dimensionalities
18-
that are accessible using the Enzo test code, both separately and in
18+
that are accessible using the Enzo code, both separately and in
1919
various permutations. Tests can be selected based on a variety of
2020
criteria, including (but not limited to) the physics included, the
2121
estimated runtime of the test, and the dimensionality. The
@@ -29,12 +29,10 @@ we have them, analytical solutions are compared against the test
2929
results (e.g. shocktubes). Lastly, a summary of these test results
3030
are returned to the user for interpretation.
3131

32-
One can run individual tests or groups of tests using the various
33-
run time flags_. For convenience, three pre-created,
34-
overlapping sets of tests are provided. For each set of tests, the
35-
test suite can automatically pull the "gold standard" results from a
36-
remote server; or one can generate their own standard locally against
37-
which she can compare different builds of the code.
32+
One can run individual tests or groups of tests using the various run time
33+
flags_. For convenience, three pre-created, overlapping sets of tests are
34+
provided. For each set of tests, one must generate their own standard locally
35+
against which she can compare different builds of the code.
3836

3937
1. The "quick suite" (``--suite=quick``). This is composed of
4038
small calculations that test critical physics packages both
@@ -63,20 +61,14 @@ complete. The total run time is roughly 60 hours for the default lowest
6361
level of optimization.
6462

6563
.. _running:
66-
.. _`running the test suite against the gold standard`:
6764

68-
How to run the test suite against the gold standard
69-
---------------------------------------------------
65+
How to run the test suite
66+
-------------------------
7067

7168

72-
1. **Compile Enzo.** The gold standard calculations use the default
73-
compiler settings that can be restored with ``make default``.
74-
If you have already built enzo, you can skip this step and the test will
75-
use your existing enzo executable, however be forewarned. If you use
76-
significantly different compilation options (high-level optimization
77-
in particular) you may see somewhat different outputs from the tests
78-
that could result in failed tests. To compile enzo with the standard
79-
settings, complete these commands:
69+
1. **Compile Enzo.** If you have already built enzo, you can skip this step and
70+
the test will use your existing enzo executable. To compile enzo with the
71+
standard settings, complete these commands:
8072

8173
::
8274

@@ -89,42 +81,89 @@ Note that you need not copy the resulting enzo executable to your path,
8981
since the enzo.exe will be symbolically linked from the src/enzo directory
9082
into each test problem directory before tests are run.
9183

92-
2. **Get/update yt.** The enzo tests are generated and compared using the
93-
yt analysis suite. You must be using yt 2.5 or later in order for the
94-
test suite to work. If you do not yet have yt, visit
95-
http://yt-project.org/#getyt for installation instructions.
96-
If you already have yt and yt is in your path, make sure you're using
97-
the most up-to-date version by running the following command:
84+
2. **Get the correct yt version** The enzo tests are generated and compared
85+
using the yt analysis suite. You must be using yt 2.6.3 in order for the test
86+
suite to work. The test suite has not yet been updated to work with yt 3.0 and
87+
newer releases. If you do not yet have yt, visit http://yt-project.org/#getyt
88+
for installation instructions. If you already have yt and yt is in your path,
89+
make sure you're using yt 2.6.3 by running the following commands:
90+
91+
::
92+
93+
$ cd /path/to/yt_mercurial_repository
94+
$ hg update yt-2.x
95+
$ python setup.py develop
96+
97+
3. **Generate answers to test with.** Run the test suite with these flags within
98+
the ``run/`` subdirectory in the enzo source hierarchy:
99+
100+
::
101+
102+
$ cd <enzo_root>/run
103+
$ ./test_runner.py --suite=quick -o <output_dir> --answer-store
104+
--answer-name=<test_name> --local
105+
106+
Note that we're creating test answers in this example with the quick suite, but
107+
we could just as well create a reference from any number of test problems using
108+
other test problem flags_.
109+
110+
Here, we are storing the results from our tests locally in a file called
111+
<test_name> which will now reside inside of the ``<output_dir>``. If you want
112+
to, you can leave off ``--answer-name`` and get a sensible default.
113+
114+
.. _directory layout:
98115

99116
::
100117

101-
$ yt update
118+
$ ls <output_dir>
119+
fe7d4e298cb2 <test_name>
120+
121+
$ ls <output_dir>/<test_name>
122+
<test_name>.db
102123

103-
3. **Run the test suite.** The testing suite operates by running a
104-
series of enzo test files throughout the ``run`` subdirectory. You can
105-
initiate the quicksuite test simulations and their comparison against the
106-
current gold standard by running the following commands:
124+
When we inspect this directory, we now see that in addition to the subdirectory
125+
containing the simulation results, we also have a <test_name> subdirectory which
126+
contains python-readable shelve files, in this case a dbm file. These are the
127+
files which actually contain the reference standard. You may have a different
128+
set of files or extensions depending on which OS you are using, but don't worry
129+
Python can read this no problem. Congratulations, you just produced your own
130+
reference standard. Feel free to test against this reference standard or tar
131+
and gzip it up and send it to another machine for testing.
132+
133+
134+
4. **Run the test suite using your local answers.** The testing suite operates
135+
by running a series of enzo test files throughout the ``run`` subdirectory.
136+
Note that if you want to test a specific enzo changeset, you must update to it
137+
and recompile enzo. You can initiate the quicksuite test simulations and their
138+
comparison against your locally generated answers by running the following
139+
commands:
107140

108141
::
109142

110143
$ cd <enzo_root>/run
111-
$ ./test_runner.py -o <output_dir>
112-
113-
In this command, ``--output-dir=<output_dir>`` instructs the
114-
test runner to output its results to a user-specified directory
115-
(preferably outside of the enzo file hierarchy). Make sure this
116-
directory is created before you call test_runner.py, or it will
117-
fail. The default behavior is to use the quick suite, but you
118-
can specify any set of tests using the ``--suite`` or ``--name``
119-
flags_. Lastly, we compare against the current gold standard in
120-
the cloud: ``enzogold2.2``. For a full description of the many
121-
flags associated with test_runner.py, see the flags_ section.
122-
123-
4. **Review the results.** While the test_runner is executing, you should
124-
see the results coming up at the terminal in real time, but you can review
125-
these results in a file output at the end of the run. The test_runner
126-
creates a subdirectory in the output directory you provided it, as shown
127-
in the example below.
144+
$ ./test_runner.py --suite=quick -o <output_dir> --answer-name=<test_name>
145+
--local --clobber
146+
147+
In this command, ``--output-dir=<output_dir>`` instructs the test runner to
148+
output its results to a user-specified directory (preferably outside of the enzo
149+
file hierarchy). Make sure this directory is created before you call
150+
test_runner.py, or it will fail. The default behavior is to use the quick
151+
suite, but you can specify any set of tests using the ``--suite`` or ``--name``
152+
flags_. We are comparing the simulation results against a local (``--local``)
153+
reference standard which is named ``<test_name>`` also located in the
154+
``<output_dir>`` directory. Note, we included the ``--clobber`` flag to rerun
155+
any simulations that may have been present in the ``<output_dir>`` under the
156+
existing enzo version's files, since the default behavior is to not rerun
157+
simulations if their output files are already present. Because we didn't set
158+
the ``--answer-store`` flag, the default behavior is to compare against the
159+
``<test_name>``.
160+
161+
162+
5. **Review the results.** While the test_runner is executing, you should see
163+
the results coming up at the terminal in real time, but you can review these
164+
results in a file output at the end of the run. The test_runner creates a
165+
subdirectory in the output directory you provided it, as shown in the example
166+
below.
128167

129168
::
130169

@@ -148,20 +187,6 @@ simulation outputs, organized based on test type (e.g. ``Cooling``,
148187
``test_results.txt``, which contains a summary of the test runs and
149188
which ones failed and why.
150189

151-
By default, the testing suite does not expect bitwise agreement between
152-
the gold standard and your results, due to compiler, architecture and
153-
operating system differences between versions of enzo. There must be
154-
a significant difference between your result and the gold standard for
155-
you to fail any tests, thus you should be passing all of the tests.
156-
If you are not, then examine more closely what modifications you made
157-
to the enzo source which caused the test failure. If this is a fresh
158-
version of enzo that you grabbed and compiled, then you should write
159-
the [email protected] email list with details of your test run
160-
(computer os, architecture, version of enzo, version of yt, what test
161-
failed, what error message you received), so that we can address this
162-
issue.
163-
164-
165190
My tests are failing and I don't know why
166191
-----------------------------------------
167192

@@ -188,94 +213,13 @@ test_runner.py call to run the executable directly without MPI support.
188213
Currently, only a few tests use multiple cores, so this is not a
189214
problem in the quick or push suites.
190215

191-
If you see a lot of ``YTNoOldAnswer`` errors, it may mean that your
192-
simulation is running to a different output than the gold standard
193-
does, and the test suite is trying to compare your last output file
194-
against a non-existent file in the gold standard. Look carefully
195-
at the results of your simulation for this test problem using the
196-
provided python file to determine what is happening. Or it may
197-
simply mean that you specified the wrong gold standard.
198-
199-
.. _generating_standard:
200-
201-
How to generate your own reference standard
202-
-------------------------------------------
203-
204-
There may be some circumstances under which you do not wish to compare
205-
your test results against the gold standard, but against your own
206-
homegrown standard. Perhaps you've created a new test not yet in
207-
the gold standard, or you want to test one of your forks against another.
208-
Regardless of the reason, you want to generate your own reference
209-
standard for comparison. To do this, follow the instructions for
210-
`running the test suite against the gold standard`_, but replace step #3 with:
211-
212-
3. **Run the test suite.** Run the suite with these flags within
213-
the ``run/`` subdirectory in the enzo source hierarchy:
214-
215-
::
216-
217-
$ cd <enzo_root>/run
218-
$ ./test_runner.py --suite=quick -o <output_dir> --answer-store --answer-name=<test_name>
219-
--local
220-
221-
N.B. We're creating a reference set in this example with the quick
222-
suite, but we could just as well create a reference from any number
223-
of test problems using other test problem flags_.
224-
225-
Here, we are storing the results from our tests locally in a file
226-
called <test_name> which will now reside inside of the ``<output_dir>``.
227-
If you want to, you can leave off ``--answer-name`` and get a sensible
228-
default.
229-
230-
.. _directory layout:
231-
232-
::
233-
234-
$ ls <output_dir>
235-
fe7d4e298cb2 <test_name>
236-
237-
$ ls <output_dir>/<test_name>
238-
<test_name>.db
239-
240-
When we inspect this directory, we now see that in addition to the
241-
subdirectory containing the simulation results, we also have a
242-
<test_name> subdirectory which contains python-readable shelve files,
243-
in this case a dbm file. These are the files which actually contain
244-
the reference standard. You may have a different set of files
245-
or extensions depending on which OS you are using, but don't worry
246-
Python can read this no problem. Congratulations, you just
247-
produced your own reference standard. Feel free to test against
248-
this reference standard or tar and gzip it up and send it to another
249-
machine for testing.
250-
251-
How to run the test suite against a different reference standard
252-
----------------------------------------------------------------
253-
254-
First, you must place a copy of your reference standard's files in
255-
some directory outside the enzo source hierarchy (e.g. your
256-
``<output_dir>`` from previous tests), so that it looks something
257-
like this `directory layout`_. From here, you must follow the
258-
instructions for `running the test suite against the gold
259-
standard`_, but replace step #3 with:
260-
261-
3. **Run the test suite.** Run the suite with these flags inside
262-
the ``run/`` subdirectory in the enzo source hierarchy:
263-
264-
::
265-
266-
$ cd <enzo_root>/run
267-
$ ./test_runner.py --suite=quick -o <output_dir> --answer-name=<test_name>
268-
--local --clobber
269-
270-
Here, we're running the quick suite and outputting our results to
271-
``<output_dir>``. We are comparing the simulation results against a
272-
local (``--local``) reference standard which is named ``<test_name>``
273-
also located in the ``<output_dir>`` directory. Note, we included the
274-
``--clobber`` flag to rerun any simulations that may have been present
275-
in the ``<output_dir>`` under the existing enzo version's files, since
276-
the default behavior is to not rerun simulations if their output files
277-
are already present. Because we didn't set the ``--answer-store`` flag,
278-
the default behavior is to compare against the ``<test_name>``.
216+
If you see a lot of ``YTNoOldAnswer`` errors, it may mean that your simulation
217+
is running to a different output than what was reached for your locally
218+
generated answers does, and the test suite is trying to compare your last output
219+
file against a non-existent file in the answers. Look carefully at the
220+
results of your simulation for this test problem using the provided python file
221+
to determine what is happening. Or it may simply mean that you specified the
222+
wrong answer name.
279223

280224
.. _flags:
281225

@@ -599,9 +543,7 @@ What to do if you fix a bug in Enzo
599543

600544
It's inevitable that bugs will be found in Enzo, and that some of
601545
those bugs will affect the actual simulation results (and thus the
602-
test problems used in the problem suite). If you fix a bug that
603-
results in a change to some or all of the test problems, the gold
604-
standard solutions will need to be updated. Here is the procedure for
546+
test problems used in the problem suite). Here is the procedure for
605547
doing so:
606548

607549
1. Run the "push suite" of test problems (``--pushsuite=True``)
@@ -615,14 +557,6 @@ version is actually producing the correct results!
615557
[email protected] to explain your bug fix, and to show the
616558
results of the now-failing test problems.
617559

618-
4. Once the denizens of the mailing list concur that you have
619-
correctly solved the bug, create a new set of gold standard test
620-
problem datasets, following the instructions in the next section.
621-
622-
5. After these datasets are created, send the new gold standard
623-
datasets to Britton Smith ([email protected]), who will update
624-
the gold standards.
625-
626-
6. Push your Enzo changes to the repository.
560+
4. Create a pull request for your fix.
627561

628562
.. _http://yt-project.org/#getyt: http://yt-project.org/#getyt

0 commit comments

Comments
 (0)