Skip to content

Commit 86ced30

Browse files
1 parent df45c94 commit 86ced30

15 files changed

Lines changed: 119 additions & 85 deletions

bazel.html

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -384,14 +384,9 @@ <h3 id="install-on-macos">Install on macOS</h3>
384384
<li>Download and install <code class="language-plaintext highlighter-rouge">gurobi13.0.1_macos2_universal.pkg</code>.</li>
385385
</ol>
386386

387-
<p>To confirm that your setup was successful, run the tests that require Gurobi:</p>
387+
<p>To confirm that your setup was successful, run a test that requires Gurobi:</p>
388388

389-
<p><code class="language-plaintext highlighter-rouge">bazel test --config gurobi --test_tag_filters=gurobi //...</code></p>
390-
391-
<p>The default value of <code class="language-plaintext highlighter-rouge">--test_tag_filters</code> in Drake’s <code class="language-plaintext highlighter-rouge">bazel.rc</code> excludes
392-
these tests. If you will be developing with Gurobi regularly, you may wish
393-
to specify a more convenient <code class="language-plaintext highlighter-rouge">--test_tag_filters</code> in a local <code class="language-plaintext highlighter-rouge">.bazelrc</code>.
394-
See <a href="https://docs.bazel.build/versions/main/user-manual.html#bazelrc">https://docs.bazel.build/versions/main/user-manual.html#bazelrc</a>.</p>
389+
<p><code class="language-plaintext highlighter-rouge">bazel test --@drake//tools/flags:with_gurobi=True //solver:gurobi_solver_test</code></p>
395390

396391
<h2 id="mosek">MOSEK</h2>
397392

@@ -400,14 +395,9 @@ <h2 id="mosek">MOSEK</h2>
400395

401396
<p><code class="language-plaintext highlighter-rouge">export MOSEKLM_LICENSE_FILE=/path/to/mosek.lic</code></p>
402397

403-
<p>To confirm that your setup was successful, run the tests that require MOSEK<a href="/tm.html"></a>:</p>
404-
405-
<p><code class="language-plaintext highlighter-rouge">bazel test --config mosek --test_tag_filters=mosek //...</code></p>
398+
<p>To confirm that your setup was successful, run a test that requires MOSEK<a href="/tm.html"></a>:</p>
406399

407-
<p>The default value of <code class="language-plaintext highlighter-rouge">--test_tag_filters</code> in Drake’s <code class="language-plaintext highlighter-rouge">bazel.rc</code> excludes
408-
these tests. If you will be developing with MOSEK<a href="/tm.html"></a> regularly, you may wish
409-
to specify a more convenient <code class="language-plaintext highlighter-rouge">--test_tag_filters</code> in a local <code class="language-plaintext highlighter-rouge">.bazelrc</code>.
410-
See <a href="https://docs.bazel.build/versions/main/user-manual.html#bazelrc">https://docs.bazel.build/versions/main/user-manual.html#bazelrc</a>.</p>
400+
<p><code class="language-plaintext highlighter-rouge">bazel test --@drake//tools/flags:with_mosek=True //solvers:mosek_solver_test</code></p>
411401

412402
<h2 id="snopt">SNOPT</h2>
413403

@@ -433,14 +423,9 @@ <h3 id="using-your-own-source-archive">Using your own source archive</h3>
433423

434424
<p>Test the build (for either mechanism)</p>
435425

436-
<p>To confirm that your setup was successful, run the tests that require SNOPT:</p>
437-
438-
<p><code class="language-plaintext highlighter-rouge">bazel test --config snopt --test_tag_filters=snopt //...</code></p>
426+
<p>To confirm that your setup was successful, run a test that requires SNOPT:</p>
439427

440-
<p>The default value of <code class="language-plaintext highlighter-rouge">--test_tag_filters</code> in Drake’s <code class="language-plaintext highlighter-rouge">bazel.rc</code> excludes
441-
these tests. If you will be developing with SNOPT regularly, you may wish
442-
to specify a more convenient <code class="language-plaintext highlighter-rouge">--test_tag_filters</code> in a local <code class="language-plaintext highlighter-rouge">.bazelrc</code>.
443-
See <a href="https://docs.bazel.build/versions/main/user-manual.html#bazelrc">https://docs.bazel.build/versions/main/user-manual.html#bazelrc</a>.</p>
428+
<p><code class="language-plaintext highlighter-rouge">bazel test --@drake//tools/flags:with_snopt=True //solvers:snopt_solver_test</code></p>
444429

445430
<p>SNOPT support has some known problems on certain programs (see drake issue
446431
<a href="https://github.com/RobotLocomotion/drake/issues/10422">#10422</a> for a summary).</p>
@@ -454,6 +439,7 @@ <h1 id="optional-tools">Optional Tools</h1>
454439

455440
<ul>
456441
<li>kcov – test coverage analysis</li>
442+
<li>docker – debug CI failures using a virtual machine</li>
457443
</ul>
458444

459445
<h2 id="kcov">kcov</h2>
@@ -496,7 +482,7 @@ <h2 id="kcov">kcov</h2>
496482

497483
<h3 id="drake-bazel-rules-and-kcov">Drake bazel rules and kcov</h3>
498484

499-
<p>Some Drake-specific bazel rules (e.g. <code class="language-plaintext highlighter-rouge">drake_cc_google_test</code>) use various
485+
<p>Some Drake-specific bazel rules (e.g. <code class="language-plaintext highlighter-rouge">drake_cc_googletest</code>) use various
500486
heuristics to skip certain tests in <code class="language-plaintext highlighter-rouge">kcov</code> builds. This may hinder developers
501487
trying to use <code class="language-plaintext highlighter-rouge">kcov</code> locally on specific tests. For example:</p>
502488

@@ -511,6 +497,36 @@ <h3 id="drake-bazel-rules-and-kcov">Drake bazel rules and kcov</h3>
511497
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>bazel test --config=kcov --test_tag_filters= //common:temp_directory_test
512498
</code></pre></div></div>
513499

500+
<h2 id="docker">docker</h2>
501+
502+
<p>Drake supports multiple Ubuntu versions. Developers who need to debug
503+
a CI failure on an Ubuntu version other than their desktop version can
504+
use Docker:</p>
505+
506+
<p>Install docker:</p>
507+
508+
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt install docker.io
509+
$ sudo usermod -aG docker $USER
510+
$ newgrp docker
511+
</code></pre></div></div>
512+
513+
<p>Boot a virtual machine, clone Drake, install prereqs, and develop as usual:</p>
514+
515+
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ docker run --rm -it ubuntu:26.04
516+
# apt update
517+
# apt install -y git sudo
518+
# echo "ubuntu ALL=(ALL) NOPASSWD:ALL" &gt;&gt; /etc/sudoers
519+
# su - ubuntu
520+
$ git clone --depth=1 https://github.com/RobotLocomotion/drake.git
521+
$ cd drake
522+
$ git fetch origin pull/NNNNN/head &amp;&amp; git checkout FETCH_HEAD
523+
$ setup/install_prereqs -y --developer
524+
$ bazel test //common:fmt_test
525+
</code></pre></div></div>
526+
527+
<p>When you exit the virtual machine it will be deleted, so be sure to
528+
capture what you need before exiting.</p>
529+
514530
</article>
515531
</div>
516532
</section>

0 commit comments

Comments
 (0)