docum updates

This commit is contained in:
2021-10-31 22:48:05 +02:00
parent a73c666415
commit a757b7d205
3 changed files with 61 additions and 52 deletions

View File

@@ -17,21 +17,24 @@ The python stand-alone script <var>databaseRest.py</var> imports data from files
Usage is 'python databaseReset.py &lt;command&gt; [runlabel]'
where command is:
reset - normal usage: clear database and reread everything from files - time-consuming
caves - read in the caves
logbooks - read in the logbooks
people - read in the people from folk.csv
QMs - read in the QM csv files (older caves only)
reinit - clear database (delete everything) and make empty tables. Import nothing.
scans - the survey scans in all the wallets
survex - read in the survex files - all the survex blocks but not the x/y/z positions
survexpos - just the x/y/z Pos out of the survex files
tunnel - read in the Tunnel files - which scans the survey scans too
test - testing... imports people and prints profile. Deletes nothing.
profile - print the profile from previous runs. Import nothing.
- del - deletes last entry
- delfirst - deletes first entry
reset - normal usage: clear database and reread everything from files - time-consuming
init - clear database (delete everything) and make empty tables. Import nothing.
caves - read in the caves
people - read in the people from folk.csv
logbooks - read in the logbooks
QMs - read in the QM csv files (older caves only)
scans - the survey scans in all the wallets
drawings - read in the Tunnel & Therion files - which scans the survey scans too
survex - read in the survex files - all the survex blocks and entrances x/y/z
test - testing...
dumplogbooks - Not used. write out autologbooks (not working?)
and [runlabel] is an optional string identifying this run of the script
in the stored profiling data 'import-profile.json'

View File

@@ -309,42 +309,48 @@ explains what this does and gives extra command line options.
<p>Now run the test suite:
<pre><code>python manage.py test -v 3 --traceback</code></pre>
<p>This will run the entire troggle test suite of over 70 tests (it takes only a few seconds).</code></pre>
<p>This will run the entire troggle test suite of over 70 tests (it takes only a few seconds).
<pre>
If you get an error, and you probably will, have a look in the test file, e.g. for this error:
FAIL: test_page_folk (troggle.core.TESTS.tests.PageTests)
look in the file troggle/code/TESTS/tests.py in the class PageTests.
<p>
If you get an error, and you probably will, have a look in the source code of the test, e.g. for this error:
<pre><code>FAIL: test_page_folk (troggle.core.TESTS.tests.PageTests) </code></pre>
look in the file
<var>troggle/code/TESTS/tests.py</var> in the class <var>PageTests</var>.
It will also say:
File "/mnt/c/EXPO/troggle/core/TESTS/tests.py", line 266, in test_page_folk
which means that the asssert failure in on line 266 of troggle/code/TESTS/tests.py
and that the failure function is test_page_folk()
<pre><code> File "/mnt/c/EXPO/troggle/core/TESTS/tests.py", line 266, in test_page_folk</code></pre>
which means that the asssert failure in on line 266 of <var>troggle/code/TESTS/tests.py</var>
and that the failure function is test_page_folk() .
If you look at this you will see that line 264 is:
response = self.client.get('/folk/index.htm')
<pre><code> response = self.client.get('/folk/index.htm')</code></pre>
so this file is missing. Duh. Of course it is. We downloaded troggle from git but we didn't run
the standalone script to generate the folk list. It is top of the list in
http://expo.survex.com/handbook/troggle/scriptscurrent.html#folk
the standalone script to generate the folk list.
The quickest thing to do when installing troggle is to simply download a copy from the server:
<pre><code> wget -O ../expoweb/folk/index.htm expo.survex.com/folk/index.htm</code></pre>
and run the tests again:
<pre><code>python manage.py test -v 2</code></pre>
<details><summary>Click on the triangle to see how to run the <var>folk</var> script.</summary>
<font color="blue">
The <var>folk</var> generation script is top of the list in
<var>
http://expo.survex.com/handbook/troggle/scriptscurrent.html#folk</var>
<p>
So do this:
<pre>
cd ../expoweb/folk
python ../scripts/make-folklist.py <folk.csv >index.htm
cd ../../troggle
Or just sFTP a copy from expo.survex.com
and run the tests again:
python manage.py test -v 2
Yeah if you were paying attention, you will see that this has done a git commit for a test file
in the drawings repo locally.
Sorry about that. the test harness does not yet undo that. So you will need ot manually reverse that commit: go into your favourite git tool. In VS code the command is Commit: Undo last commit
If you have run the test suite several times you will need to undo several commits (and delete the files producd by the test suite).
</pre>
<p>The test suite has over 70 tests but does not cover all of what troggle does and does not use any real data. You need to manually test these too, after you have done a full data import:
</font>
</details>
<p>The test suite now tidies up after itself, so there should not be any temporary files left behind or local git commits that you will need to clean up.
<p>The test suite has over 70 tests but does not cover all of what troggle does and does not use any real data. You need to manually test these too, <em>after</em> you have done a full <a href="trogimport.html">data import</a>:
<br>- <var><a href="http://localhost:8000/pathsreport">http://localhost:8000/pathsreport</a></var>
<br>- <var><a href="http://localhost:8000/stats">http://localhost:8000/stats</a></var>
<br>- <var><a href="http://localhost:8000/people">http://localhost:8000/people</a></var> (takes a minute or so)