Skip to content

Commit

Permalink
deploy: 878047d
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyangyu committed Oct 24, 2023
1 parent 6f9494e commit 68fc419
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 108 deletions.
6 changes: 3 additions & 3 deletions get-started/write-and-run-unit-tests.html
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,14 @@ <h3 id="running-all-tests"><a class="header" href="#running-all-tests">Running a
<h3 id="running-a-single-test"><a class="header" href="#running-a-single-test">Running a single test</a></h3>
<p>To run a single test, you can manually repeat what <code>make ut</code> does and narrow the scope in one test or one package:</p>
<pre><code class="language-sh">make failpoint-enable
cd domain
cd pkg/domain
go test -v -run TestSchemaValidator # or with any other test flags
cd ..
cd ../..
make failpoint-disable
</code></pre>
<p>or if it is an older test not using testify</p>
<pre><code class="language-sh">make failpoint-enable
(cd planner/core ; go test -v -run &quot;^TestT$&quot; -check.f TestBinaryOpFunction )
(cd pkg/planner/core ; go test -v -run &quot;^TestT$&quot; -check.f TestBinaryOpFunction )
make failpoint-disable
</code></pre>
<p>If one want to compile the test into a debug binary for running in a debugger, one can also use <code>go test -gcflags=&quot;all=-N -l&quot; -o ./t</code>, which removes any optimisations and outputs a <code>t</code> binary file ready to be used, like <code>dlv exec ./t</code> or combine it with the above to only debug a single test <code>dlv exec ./t -- -test.run &quot;^TestT$&quot; -check.f TestBinaryOpFunction</code>.</p>
Expand Down
Loading

0 comments on commit 68fc419

Please sign in to comment.