Skip to content

Commit

Permalink
Deploy website
Browse files Browse the repository at this point in the history
Deploy website version based on c6aa90b
  • Loading branch information
Docusaurus bot committed Jan 18, 2024
1 parent 3e28b51 commit f3a70ca
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
22 changes: 11 additions & 11 deletions docs/airspec.html
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,6 @@ <h2><a class="anchor" aria-hidden="true" id="running-tests-in-sbt"></a><a href="
</code></pre>
<p>Test names will be checked as case-insensitive partial match, so you only need to specify substrings of test names like <code>A</code>, <code>A/1</code>, 'a/2', etc. to simplify the pattern matching.</p>
<p><img src="https://wvlet.org/airframe/img/airspec/airspec.png" alt="image"></p>
<h3><a class="anchor" aria-hidden="true" id="configure-log-levels"></a><a href="#configure-log-levels" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Configure Log Levels</h3>
<p>AirSpec natively supports <a href="https://wvlet.org/airframe/docs/airframe-log.html">airframe-log</a> for logging. To temporally change the log level, use <code>-l (log level)</code> option:</p>
<pre><code class="hljs css language-scala">&gt; testOnly -- -l debug
</code></pre>
<p>This will set the log level to debug for all test classes.</p>
<p>To change the log level only for a specific package or a class, use <code>-L(package or class)=(log level)</code> option:</p>
<pre><code class="hljs css language-scala">&gt; testOnly -- -<span class="hljs-type">Lorg</span>.mydomain.myapp:debug
</code></pre>
<p>You can use multiple <code>-L</code> options to set different log levels for multiple packages.</p>
<h3><a class="anchor" aria-hidden="true" id="disable-parallel-test-execution"></a><a href="#disable-parallel-test-execution" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Disable Parallel Test Execution</h3>
<p>sbt 1.x or higher runs tests in parallel. This is fast, but it messes up console log messages.
If you prefer sequential test execution, set <code>parallelExecution in Test</code> to false:</p>
Expand Down Expand Up @@ -272,7 +263,16 @@ <h2><a class="anchor" aria-hidden="true" id="logging-your-tests"></a><a href="#l
}
</code></pre>
<p>Similarly, if you include <code>wvlet.log.LogSupport</code> to your application classes, you can add log messages to these classes.</p>
<h3><a class="anchor" aria-hidden="true" id="changing-log-levels"></a><a href="#changing-log-levels" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Changing Log Levels</h3>
<h3><a class="anchor" aria-hidden="true" id="configure-log-levels"></a><a href="#configure-log-levels" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Configure Log Levels</h3>
<p>AirSpec natively supports <a href="https://wvlet.org/airframe/docs/airframe-log.html">airframe-log</a> for logging. To temporally change the log level, use <code>-l (log level)</code> option:</p>
<pre><code class="hljs css language-scala">&gt; testOnly -- -l debug
</code></pre>
<p>This will set the log level to debug for all test classes.</p>
<p>To change the log level only for a specific package or a class, use <code>-L(package or class)=(log level)</code> option:</p>
<pre><code class="hljs css language-scala">&gt; testOnly -- -<span class="hljs-type">Lorg</span>.mydomain.myapp:debug
</code></pre>
<p>You can use multiple <code>-L</code> options to set different log levels for multiple packages.</p>
<h3><a class="anchor" aria-hidden="true" id="configure-log-levels-in-log-testproperties"></a><a href="#configure-log-levels-in-log-testproperties" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Configure Log Levels in log-test.properties</h3>
<p>To change the log level for your packages and classes, add <em>log-test.properties</em> file to your test resource folder <code>src/test/resources</code>. For multi-module projects, put this file under <code>(project folder)/src/test/resources</code> folder.</p>
<p>This is an example of changing log levels of your packages and classes:</p>
<p><strong>src/test/resources/log-test.properties</strong></p>
Expand Down Expand Up @@ -551,7 +551,7 @@ <h3><a class="anchor" aria-hidden="true" id="airspec-writing-tests-as-plain-func
<p>And also, if we define tests by using functions, it becomes possible to <strong>pass test dependencies through function arguments</strong>. Using local variables in a test class has been the best practice of setting up testing environments (e.g., database, servers, etc.), but it is not always ideal as we need to properly initialize and clean-up these variables for each test method by using setUp/tearDown (or before/after) methods. If we can simply pass these service instances to function arguments using <a href="https://wvlet.org/airframe/docs/airframe.html">Airframe DI</a>, which has a strong support of life-cycle management, we no longer need to write such setUp/tearDown steps for configuring testing environments. Once we define a production-quality service with proper lifecycle management hooks (using Airframe design and onStart/onShutdown hooks), we should be able to reuse these lifecycle management code even in test cases.</p>
<p>AirSpec was born with these ideas in mind by leveraging Airframe modules like Airframe Surface and DI. After implementing basic features of AirSpec, we've successfully <strong>migrated all of the test cases in 20+ Airframe modules into AirSpec</strong>, which were originally written in ScalaTest. Rewriting test cases was almost straightforward as AirSpec has handy <code>shouldBe</code> syntax and property testing support with ScalaCheck.</p>
<p>In the following sections, we will see how to write tests in a Scala-friendly style with AirSpec.</p>
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="/airframe/docs/airframe-rx"><span class="arrow-prev"></span><span class="function-name-prevnext">airframe-rx: ReactiveX interface</span></a><a class="docs-next button" href="/airframe/docs/airframe-codec"><span>airframe-codec: Schema-On-Read Object Serializer</span><span class="arrow-next"></span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#features">Features</a></li><li><a href="#quick-start">Quick Start</a></li><li><a href="#writing-unit-tests">Writing Unit Tests</a></li><li><a href="#assertions-in-airspec">Assertions in AirSpec</a><ul class="toc-headings"><li><a href="#examples">Examples</a></li></ul></li><li><a href="#running-tests-in-sbt">Running Tests in sbt</a><ul class="toc-headings"><li><a href="#configure-log-levels">Configure Log Levels</a></li><li><a href="#disable-parallel-test-execution">Disable Parallel Test Execution</a></li></ul></li><li><a href="#running-tests-with-scala-cli">Running Tests with scala-cli</a></li><li><a href="#logging-your-tests">Logging Your Tests</a><ul class="toc-headings"><li><a href="#changing-log-levels">Changing Log Levels</a></li></ul></li><li><a href="#detecting-runtime-environment">Detecting Runtime Environment</a></li><li><a href="#async-testing">Async Testing</a></li><li><a href="#flaky-tests">Flaky Tests</a></li><li><a href="#dependency-injection-with-airframe-di">Dependency Injection with Airframe DI</a><ul class="toc-headings"><li><a href="#global-and-local-sessions">Global and Local Sessions</a></li><li><a href="#session-lifecycle">Session LifeCycle</a></li></ul></li><li><a href="#di-example">DI Example</a><ul class="toc-headings"><li><a href="#overriding-design-at-test-methods">Overriding Design At Test Methods</a></li><li><a href="#faqs">FAQs</a></li><li><a href="#pro-tips">Pro Tips</a></li></ul></li><li><a href="#property-based-testing-with-scalacheck">Property Based Testing with ScalaCheck</a></li><li><a href="#background--motivation">Background &amp; Motivation</a><ul class="toc-headings"><li><a href="#airspec-writing-tests-as-plain-functions-in-scala">AirSpec: Writing Tests As Plain Functions In Scala</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/airframe/" class="nav-home"><img src="/airframe/img/favicon.ico" alt="Airframe" width="66" height="66"/></a><div><h5>Docs</h5><a href="/airframe/docs/en/index.html">Documentation</a></div><div><h5>Community</h5><a href="https://gitter.im/wvlet/airframe">Gitter Chat</a></div><div><h5>More</h5><a href="https://github.com/wvlet/airframe/">GitHub</a><a class="github-button" href="https://github.com/wvlet/airframe" data-icon="octicon-star" data-count-href="/wvlet/airframe/stargazers" data-show-count="true" data-count-aria-label="# stargazers on GitHub" aria-label="Star this project on GitHub">Star</a></div></section><a href="https://wvlet.org/airframe/" target="_blank" rel="noreferrer noopener" class="fbOpenSource"><img src="/airframe/img/logos/airframe-badge-dark.png" alt="airframe logo"/></a><section class="copyright">Copyright © 2024 wvlet.org</section></footer></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script><script>window.fbAsyncInit = function() {FB.init({appId:'3112325918843547',xfbml:true,version:'v2.7'});};(function(d, s, id){var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) {return;}js = d.createElement(s); js.id = id;js.src = '//connect.facebook.net/en_US/sdk.js';fjs.parentNode.insertBefore(js, fjs);}(document, 'script','facebook-jssdk'));
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="/airframe/docs/airframe-rx"><span class="arrow-prev"></span><span class="function-name-prevnext">airframe-rx: ReactiveX interface</span></a><a class="docs-next button" href="/airframe/docs/airframe-codec"><span>airframe-codec: Schema-On-Read Object Serializer</span><span class="arrow-next"></span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#features">Features</a></li><li><a href="#quick-start">Quick Start</a></li><li><a href="#writing-unit-tests">Writing Unit Tests</a></li><li><a href="#assertions-in-airspec">Assertions in AirSpec</a><ul class="toc-headings"><li><a href="#examples">Examples</a></li></ul></li><li><a href="#running-tests-in-sbt">Running Tests in sbt</a><ul class="toc-headings"><li><a href="#disable-parallel-test-execution">Disable Parallel Test Execution</a></li></ul></li><li><a href="#running-tests-with-scala-cli">Running Tests with scala-cli</a></li><li><a href="#logging-your-tests">Logging Your Tests</a><ul class="toc-headings"><li><a href="#configure-log-levels">Configure Log Levels</a></li><li><a href="#configure-log-levels-in-log-testproperties">Configure Log Levels in log-test.properties</a></li></ul></li><li><a href="#detecting-runtime-environment">Detecting Runtime Environment</a></li><li><a href="#async-testing">Async Testing</a></li><li><a href="#flaky-tests">Flaky Tests</a></li><li><a href="#dependency-injection-with-airframe-di">Dependency Injection with Airframe DI</a><ul class="toc-headings"><li><a href="#global-and-local-sessions">Global and Local Sessions</a></li><li><a href="#session-lifecycle">Session LifeCycle</a></li></ul></li><li><a href="#di-example">DI Example</a><ul class="toc-headings"><li><a href="#overriding-design-at-test-methods">Overriding Design At Test Methods</a></li><li><a href="#faqs">FAQs</a></li><li><a href="#pro-tips">Pro Tips</a></li></ul></li><li><a href="#property-based-testing-with-scalacheck">Property Based Testing with ScalaCheck</a></li><li><a href="#background--motivation">Background &amp; Motivation</a><ul class="toc-headings"><li><a href="#airspec-writing-tests-as-plain-functions-in-scala">AirSpec: Writing Tests As Plain Functions In Scala</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/airframe/" class="nav-home"><img src="/airframe/img/favicon.ico" alt="Airframe" width="66" height="66"/></a><div><h5>Docs</h5><a href="/airframe/docs/en/index.html">Documentation</a></div><div><h5>Community</h5><a href="https://gitter.im/wvlet/airframe">Gitter Chat</a></div><div><h5>More</h5><a href="https://github.com/wvlet/airframe/">GitHub</a><a class="github-button" href="https://github.com/wvlet/airframe" data-icon="octicon-star" data-count-href="/wvlet/airframe/stargazers" data-show-count="true" data-count-aria-label="# stargazers on GitHub" aria-label="Star this project on GitHub">Star</a></div></section><a href="https://wvlet.org/airframe/" target="_blank" rel="noreferrer noopener" class="fbOpenSource"><img src="/airframe/img/logos/airframe-badge-dark.png" alt="airframe logo"/></a><section class="copyright">Copyright © 2024 wvlet.org</section></footer></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script><script>window.fbAsyncInit = function() {FB.init({appId:'3112325918843547',xfbml:true,version:'v2.7'});};(function(d, s, id){var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) {return;}js = d.createElement(s); js.id = id;js.src = '//connect.facebook.net/en_US/sdk.js';fjs.parentNode.insertBefore(js, fjs);}(document, 'script','facebook-jssdk'));
</script><script>window.twttr=(function(d,s, id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src='https://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js, fjs);t._e = [];t.ready = function(f) {t._e.push(f);};return t;}(document, 'script', 'twitter-wjs'));</script><script>
document.addEventListener('keyup', function(e) {
if (e.target !== document.body) {
Expand Down
Loading

0 comments on commit f3a70ca

Please sign in to comment.