-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTest-Setup.html
98 lines (95 loc) · 6.05 KB
/
Test-Setup.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!DOCTYPE html>
<html>
<head>
<title>eprinttools - Test-Setup.html</title>
<link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="/css/site.css">
</head>
<body>
<header>
<a href="http://library.caltech.edu" title="link to Caltech Library Homepage"><img src="/assets/liblogo.gif" alt="Caltech Library logo"></a>
</header>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="README.html">README</a></li>
<li><a href="LICENSE">LICENSE</a></li>
<li><a href="install.html">INSTALL</a></li>
<li><a href="user-manual.html">User Manual</a></li>
<li><a href="search.html">Search Docs</a></li>
<li><a href="about.html">About</a></li>
<li><a href="https://github.com/caltechlibrary/eprinttools">GitHub</a></li>
</ul>
</nav>
<section>
<h1 id="test-setup">Test Setup</h1>
<p>It is important to be able to test the code that makes up
eprinttools. EPrints is complex and nuanced and testing helps insure
that our code is addressing that. For running the test suite you need to
have MySQL setup with a test database and one or more EPrints repository
available and setup for REST access. The REST client testing is read
only and can be skipped if you’re not using it. You need at least one
MySQL database setup using the same structure that is present in our
EPrints 3.3.16 repositories. You also need a “test-settings.json” file
for the configured test.</p>
<p>The test database used to test both SQL level interaction (which
includes writes and deletes) should be named “lemurprints”. It should
now have records in it when you start. The Scheme for that database is
found in the directory
<code>srctest/lemurprints-setup-schema.sql</code>. Assuming your MySQL
client is configured for loading databased you can run</p>
<div class="sourceCode" id="cb1"><pre
class="sourceCode bash"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a> <span class="ex">mysql</span> <span class="at">--execute</span> <span class="st">'CREATE DATABASE IF NOT EXIST lemurprints'</span></span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a> <span class="ex">mysql</span> lemurprints <span class="op"><</span> srctest/lemurprints-setup-schema.sql</span></code></pre></div>
<p>You’re <code>test-settings.json</code> file should look something
like this (replace the text in capital letters appropriately).</p>
<div class="sourceCode" id="cb2"><pre
class="sourceCode json"><code class="sourceCode json"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="fu">{</span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a> <span class="dt">"logfile"</span><span class="fu">:</span> <span class="st">"eprinttools-test.log"</span><span class="fu">,</span></span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a> <span class="dt">"repositories"</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a> <span class="dt">"lemurprints"</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a> <span class="dt">"dsn"</span><span class="fu">:</span> <span class="st">"USERNAME:PASSWORD@/lemurprints"</span><span class="fu">,</span></span>
<span id="cb2-6"><a href="#cb2-6" aria-hidden="true" tabindex="-1"></a> <span class="dt">"base_url"</span><span class="fu">:</span> <span class="st">"http://lemurprints.example.edu"</span><span class="fu">,</span></span>
<span id="cb2-7"><a href="#cb2-7" aria-hidden="true" tabindex="-1"></a> <span class="dt">"rest"</span><span class="fu">:</span> <span class="st">"https://USERNAME:PASSWORD@TEST_HOSTNAME_FOR_REST_CLIENT"</span><span class="fu">,</span></span>
<span id="cb2-8"><a href="#cb2-8" aria-hidden="true" tabindex="-1"></a> <span class="dt">"write"</span><span class="fu">:</span> <span class="kw">true</span></span>
<span id="cb2-9"><a href="#cb2-9" aria-hidden="true" tabindex="-1"></a> <span class="fu">}</span></span>
<span id="cb2-10"><a href="#cb2-10" aria-hidden="true" tabindex="-1"></a> <span class="fu">}</span></span>
<span id="cb2-11"><a href="#cb2-11" aria-hidden="true" tabindex="-1"></a><span class="fu">}</span></span></code></pre></div>
<p>You can omit the “rest” key/value if you’re not going to test the
REST client.</p>
<p>When running tests any log output will be sent to the “logfile”
value. If that is not set then you’ll have at least one test failure
(the one testing if log is being sent to a file).</p>
<p>The test database “lemurprints” need to be “write” enabled. If you
add additional repository databases DO NOT enable “write” as the test
sequence will attempt to clear the database before each test run.</p>
</section>
<footer>
<span>© 2021 <a href="https://www.library.caltech.edu/copyright">Caltech Library</a></span>
<address>1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200</address>
<span><a href="mailto:[email protected]">Email Us</a></span>
<span>Phone: <a href="tel:+1-626-395-3405">(626)395-3405</a></span>
</footer>
<!-- START: PrettyFi from https://github.com/google/code-prettify -->
<script>
/* We want to add the class "prettyprint" to all the pre elements */
var pre_list = document.querySelectorAll("pre");
pre_list.forEach(function(elem) {
elem.classList.add("prettyprint");
elem.classList.add("linenums");/**/
elem.classList.add("json"); /**/
});
</script>
<style>
li.L0, li.L1, li.L2, li.L3, li.L4, li.L5, li.L6, li.L7, li.L8, li.L9
{
color: #555;
list-style-type: decimal;
}
</style>
<link rel="stylesheet" type="text/css" href="/css/prettify.css">
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_
prettify.js"></script>
<!-- END: PrettyFi from https://github.com/google/code-prettify -->
</body>
</html>