<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>emre şahin's digital garden 🍃 - tdd</title>
    <link>https://emresahin.net/tags/tdd/</link>
    <description>Posts in the tdd tag</description>
    <language>en</language>
    <managingEditor>contact@emresahin.net (Emre Şahin)</managingEditor>
    <lastBuildDate>Tue, 15 Sep 2026 19:46:32 +0000</lastBuildDate>
    <atom:link href="https://emresahin.net/tags/tdd/rss.xml" rel="self" type="application/rss+xml"/>
    <item>
      <title>devlog 19</title>
      <published>2025-01-29T09:19:56+00:00</published>
      <updated>2025-01-29T09:19:56+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Wed, 29 Jan 2025 09:19:56 +0000</pubDate>
      <link>https://emresahin.net/devlog-19/</link>
      <guid isPermaLink="true">https://emresahin.net/devlog-19/</guid>
      <description>🐇 Let’s start by checking the GitHub Actions results. $ ghrl | first ╭──────────────┬─────────────────────────────────────────────────────────╮ │ conclusion │ failure │ │ displayTitle │ Add CLI completions │ │ headBranch │ clap-complete-16608 │ │ url │ https://github.com/iesahin/xvc/actions/runs/...</description>
      <category>devlog</category>
      <category>xvc</category>
      <category>github-actions</category>
      <category>testing</category>
      <category>tdd</category>
      <category>documentation</category>
      <category>ci-cd</category>
      <category>rust</category>
      <content:encoded><![CDATA[<p>🐇 Let’s start by checking the GitHub Actions results.</p>
<pre><code class="language-nu">$ ghrl | first
╭──────────────┬─────────────────────────────────────────────────────────╮
│ conclusion   │ failure                                                 │
│ displayTitle │ Add CLI completions                                     │
│ headBranch   │ clap-complete-16608                                     │
│ url          │ https://github.com/iesahin/xvc/actions/runs/13007688178 │
╰──────────────┴─────────────────────────────────────────────────────────╯
</code></pre>
<p>🐢 Although I turned off most of the <code>watch</code>es, logs are still so large that it’s not possible to view them from the interface. Downloaded the log archive.</p>
<p>🦊 We can have different GitHub Actions steps for each test. Claude can help write such a repeating set of steps.</p>
<p>🐇 We can at least separate <code>z_test_docs</code> to see if integration tests or that fails.</p>
<p>🐢 We’ll have to add caching for test artifacts to upload them for coverage. I’m not sure we really need to add that complexity to the process just to avoid downloading the logs.</p>
<p>🐇 We can actually move all to Xvc. We need a GitHub Action to run an Xvc pipeline.</p>
<p>🐢 Eventually yes, we should move our testing to Xvc itself. Now, the logs show that there are differences in <code>z_test_docs</code> actually.</p>
<p>🐇 When I run the command below, it passes. We may have a different config in GitHub Actions.</p>
<pre><code class="language-nu">$ XVC_TRYCMD_TESTS=storage,file,pipeline,core,start TRYCMD=overwrite rws cargo test --features test-ci -p xvc --test z_test_docs
test z_doc_tests ... ok
...
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 15.34s
</code></pre>
<p>🐢 We don’t have an <code>XVC_TRYCMD_TESTS=storage,file,pipeline,core,start</code> definition in GitHub Actions; let’s add it, bump the version, and try again.</p>
<pre><code class="language-nu">$ cargo set-version "0.6.14-alpha.10"
   Upgrading xvc from 0.6.14-alpha.9 to 0.6.14-alpha.10
...
</code></pre>
<p>🦊 We could also update <code>run-tests.zsh</code> to get a quick response.</p>
<p>🐢 Yep, let’s do that as well.</p>
<p>🐇 Dev tests pass, but there are differences in the documents still. For some reason, the local <code>run-tests.zsh</code> doesn’t update <code>xvc/book/src/ref/xvc-storage.md</code>. It only has the help text as a reference, but it’s not updated with the aliases, and it breaks the CI. This is weird but a small issue. Fixed it manually.</p>
<pre><code class="language-nu">$ ghrl | first 2
╭───┬────────────┬───────────────────┬────────────────────┬────────────────────╮
│ # │ conclusion │   displayTitle    │     headBranch     │        url         │
├───┼────────────┼───────────────────┼────────────────────┼────────────────────┤
│ 0 │            │ Add CLI           │ clap-complete-1660 │ https://github.com │
│   │            │ completions       │ 8                  │ /iesahin/xvc/actio │
│   │            │                   │                    │ ns/runs/1302770108 │
│   │            │                   │                    │ 2                  │
│ 1 │ success    │ Add CLI           │ clap-complete-1660 │ https://github.com │
│   │            │ completions       │ 8                  │ /iesahin/xvc/actio │
│   │            │                   │                    │ ns/runs/1302755462 │
│   │            │                   │                    │ 2                  │
╰───┴────────────┴───────────────────┴────────────────────┴────────────────────╯
</code></pre>
<p>🐢 The earlier one has passed. It looks like we’re ready to merge. Let’s update the <code>CHANGELOG.md</code> for release.</p>
<p>🐇 Setting the release version:</p>
<pre><code class="language-nu">cargo set-version "0.6.14"
   Upgrading xvc from 0.6.14-alpha.10 to 0.6.14
...
</code></pre>
<p>🐢 Let’s check the CI</p>
<pre><code class="language-nu">$ ghrl | first 2

╭───┬────────────┬───────────────────┬────────────────────┬────────────────────╮
│ # │ conclusion │   displayTitle    │     headBranch     │        url         │
├───┼────────────┼───────────────────┼────────────────────┼────────────────────┤
│ 0 │ success    │ Add CLI           │ clap-complete-1660 │ https://github.com │
│   │            │ completions       │ 8                  │ /iesahin/xvc/actio │
│   │            │                   │                    │ ns/runs/1302770108 │
│   │            │                   │                    │ 2                  │
│ 1 │ success    │ Add CLI           │ clap-complete-1660 │ https://github.com │
│   │            │ completions       │ 8                  │ /iesahin/xvc/actio │
│   │            │                   │                    │ ns/runs/1302755462 │
│   │            │                   │                    │ 2                  │
╰───┴────────────┴───────────────────┴────────────────────┴────────────────────╯
</code></pre>
<p>🐇 And merge:</p>
<pre><code class="language-nu">$ ghpM --body $"(open CHANGELOG.md | lines | skip 2 | take 7)" --subject "Add completions" --squash
</code></pre>
<p>🐢 Tagged main and pushed. Packages should be built in a few minutes.</p>]]></content:encoded>
    </item>
    <item>
      <title>Unit tests vs Integration Tests in Rust</title>
      <published>2022-06-11T05:55:58+00:00</published>
      <updated>2022-06-11T05:55:58+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Sat, 11 Jun 2022 05:55:58 +0000</pubDate>
      <link>https://emresahin.net/Unit-tests-vs-Integration-Tests-in-Rust/</link>
      <guid isPermaLink="true">https://emresahin.net/Unit-tests-vs-Integration-Tests-in-Rust/</guid>
      <description>One thing I’ve noticed since I started working with Rust is that Test-Driven Development (TDD) has become much more feasible. As a developer who is “absentminded by default,” I highly value tests. However, if the feedback cycle is slow, it becomes prohibitively expensive to test everything. This ...</description>
      <category>Rust</category>
      <category>Testing</category>
      <category>development</category>
      <category>unit tests</category>
      <category>integration tests</category>
      <category>Rust</category>
      <category>CI/CD</category>
      <category>TDD</category>
      <category>best practices</category>
      <content:encoded><![CDATA[<p>One thing I’ve noticed since I started working with Rust is that <em>Test-Driven Development</em> (TDD) has become much more feasible. As a developer who is “absentminded by default,” I highly value tests. However, if the feedback cycle is slow, it becomes prohibitively expensive to test everything. This is likely why unit tests are often favored over integration tests: they are more precise, faster to execute, and make rapid round-trip testing more achievable.</p>
<p>Another point is that Rust, being a statically typed language, requires far fewer unit tests than dynamic languages. Traditionally, unit tests are used to validate “input consumption” (ensuring input is processed correctly) and “well-formed output” (verifying that the output meets requirements under specific conditions). In Rust, many of these input-output concerns are resolved at compile time through the use of expressive types like structs and enums.</p>
<p>For these reasons, I find myself more inclined toward integration tests that reflect real-world requirements, rather than focusing solely on unit tests in artificial settings.</p>]]></content:encoded>
    </item>
  </channel>
</rss>
