<?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 🍃 - testing</title>
    <link>https://emresahin.net/tags/testing/</link>
    <description>Posts in the testing 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/testing/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>devlog 18</title>
      <published>2025-01-28T10:07:28+00:00</published>
      <updated>2025-01-28T10:07:28+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Tue, 28 Jan 2025 10:07:28 +0000</pubDate>
      <link>https://emresahin.net/devlog-18/</link>
      <guid isPermaLink="true">https://emresahin.net/devlog-18/</guid>
      <description>🐇 There is no xvc completions command anymore. Let’s remove the test. 🐢 Instead, we can make it test with environment variables for each of these shells. 🐇 It looks like the test fails with wait_status . cargo test -p xvc --test test_completions ... failures: ---- test_completions stdout ---- ......</description>
      <category>devlog</category>
      <category>xvc</category>
      <category>clap</category>
      <category>clap_complete</category>
      <category>testing</category>
      <category>trycmd</category>
      <category>wait_status</category>
      <category>error-handling</category>
      <category>rust</category>
      <content:encoded><![CDATA[<p>🐇 There is no <code>xvc completions</code> command anymore. Let’s remove the test.</p>
<p>🐢 Instead, we can make it test with environment variables for each of these
shells.</p>
<p>🐇 It looks like the test fails with <code>wait_status</code>.</p>
<pre><code class="language-sh">cargo test -p xvc --test test_completions
...
failures:

---- test_completions stdout ----
...
ExitStatus(unix_wait_status(512))

thread 'test_completions' panicked at lib/tests/common/mod.rs:46:5:
Command failed: Command { cmd: "/Users/iex/github.com/iesahin/xvc/target/debug/xvc", stdin: None, timeout: None }
...
</code></pre>
<p>🐢 The failure is in the line:</p>
<pre><code class="language-rust">    let mut cmd = Command::cargo_bin("xvc").unwrap();</code></pre>
<p>So it probably waits for user input to complete, but it doesn’t have any and
cannot complete it, so it returns an error.</p>
<p>🦊 Let’s comment the earlier test out and check if other tests work.</p>
<p>🐢 Yes, they fail the same. When there are no commands to run, xvc returns an
error. Maybe we can change this behavior or handle the error in the
<code>Command::cargo_bin</code> line above.</p>
<p>🐇 I checked the code and we don’t handle the “no arguments” case anywhere. It
looks like the behavior to return an error code is inherited from clap.</p>
<p>🐢 Updated the error handling code to report a more descriptive
message from the source.</p>
<pre><code class="language-sh">cargo test -p xvc --test test_completions
...
failures:

---- test_completions stdout ----
Output { status: ExitStatus(unix_wait_status(25856)), stdout: "", stderr: "\nthread 'main' panicked at /Users/iex/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap_builder-4.5.20/src/builder/debug_asserts.rs:341:13:\nCommand pipeline: command `export` alias `l` is duplicated\nstack backtrace:\n   0: rust_begin_unwind\n             at /rustc/b1a7dfb91106018f47ed9dc9b27aee1977682868/library/std/src/panicking.rs:692:5\n   1: core::panicking::panic_fmt\n             at /rustc/b1a7dfb91106018f47ed9dc9b27aee1977682868/library/core/src/panicking.rs:75:14\n   2: clap_builder::builder::debug_asserts::assert_app\n             at /Users/iex/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap_builder-4.5.20/src/builder/debug_asserts.rs:341:13\n   3: clap_builder::builder::command::Command::_build_self\n             at /Users/iex/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap_builder-4.5.20/src/builder/command.rs:4173:13\n   4: clap_builder::builder::command::Command::_build_recursive\n             at /Users/iex/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap_builder-4.5.20/src/builder/command.rs:4076:9\n   5: clap_builder::builder::command::Command::_build_recursive\n             at /Users/iex/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap_builder-4.5.20/src/builder/command.rs:4078:13\n   6: clap_builder::builder::command::Command::build\n             at /Users/iex/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap_builder-4.5.20/src/builder/command.rs:4071:9\n   7: clap_complete::env::CompleteEnv&lt;F&gt;::try_complete_\n             at /Users/iex/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap_complete-4.5.40/src/env/mod.rs:229:9\n   8: clap_complete::env::CompleteEnv&lt;F&gt;::try_complete\n             at /Users/iex/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/clap_complete-4.5.40/src/env/mod.rs:210:9\n   9: xvc::main\n             at ./src/main.rs:18:30\n  10: core::ops::function::FnOnce::call_once\n             at... [truncated]
ExitStatus(unix_wait_status(25856))

...

error: test failed, to rerun pass `-p xvc --test test_completions`
</code></pre>
<p>🐢 The real issue is when we assert the successful run, at this line:</p>
<pre><code class="language-rust">            assert!(output.status.success(), "Command failed: {:?}", prepared);</code></pre>
<p>🐇 If you look at the error message carefully, you’ll see that this is a
different error. We added an alias to <code>xvc pipeline export</code> with <code>l</code>, which is
a duplicate.</p>
<p>🐢 Oops, yeah.</p>
<pre><code class="language-sh">cargo test -p xvc --test test_completions
...
test test_completions ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.81s
</code></pre>
<p>🐇 There are some warnings in compilation. Let’s fix these.</p>
<pre><code>cargo build
   Compiling xvc-storage v0.6.14-alpha.8 (/Users/iex/github.com/iesahin/xvc/storage)
   Compiling xvc-file v0.6.14-alpha.8 (/Users/iex/github.com/iesahin/xvc/file)
   Compiling xvc-pipeline v0.6.14-alpha.8 (/Users/iex/github.com/iesahin/xvc/pipeline)
   Compiling xvc v0.6.14-alpha.8 (/Users/iex/github.com/iesahin/xvc/lib)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.28s
</code></pre>
<p>🐢 Finished the build without warnings. Now we can run the whole test suite again.</p>
<p>🐇 Tests are running fine. Updated some error messages and types, and doc tests
also pass. There is an issue with the Rsync storage ref.</p>
<p>🐢 It looks like we try to elide output with <code>[...]</code>, while the proper format is <code>[..]</code>.</p>
<p>🐇 Replaced them with <code>...</code> that will elide multiple lines.</p>
<p>🐢 Pushed changes to the server.</p>]]></content:encoded>
    </item>
    <item>
      <title>devlog 8</title>
      <published>2025-01-04T12:41:16+00:00</published>
      <updated>2025-01-04T12:41:16+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Sat, 04 Jan 2025 12:41:16 +0000</pubDate>
      <link>https://emresahin.net/devlog-8/</link>
      <guid isPermaLink="true">https://emresahin.net/devlog-8/</guid>
      <description>🐢 The only failure was the patch coverage in Xvc. Let’s see what needs to be done. 🐇 It looks, from the coverage page , that our additions to HStore don’t have any tests. Maybe we can add some unit tests to the new joins. 🐢 I don’t find unit tests particularly useful, but let’s use GitHub Copilot...</description>
      <category>devlog</category>
      <category>Software Development</category>
      <category>xvc</category>
      <category>rust</category>
      <category>coverage</category>
      <category>cargo-publish</category>
      <category>github-copilot</category>
      <category>claude</category>
      <category>dufs</category>
      <category>neovim</category>
      <category>testing</category>
      <content:encoded><![CDATA[<p>🐢 The only failure was the patch coverage in Xvc. Let’s see what needs to be done.</p>
<p>🐇 It looks, from the <a href="https://app.codecov.io/gh/iesahin/xvc/pull/263?src=pr&amp;el=tree&amp;utm_medium=referral&amp;utm_source=github&amp;utm_content=comment&amp;utm_campaign=pr+comments&amp;utm_term=Emre+Sahin">coverage page</a>, that our additions to HStore don’t have any tests. Maybe we can add some unit tests to the new joins.</p>
<p>🐢 I don’t find unit tests particularly useful, but let’s use GitHub Copilot to add some for us.</p>
<p>🐇 I added a unit test and a doc test for <code>full_join</code>. I think doc tests have more value; they provide documentation, and we can readily see how to use a function from its docs. It’s better to increase coverage with doc tests.</p>
<p>🐢 There are things I should keep in mind while writing doc tests. Imports must use the full path, not <code>crate</code>. Also, the tested struct doesn’t have implicit imports.</p>
<p>🐇 The ceremony for adding keys and values is a bit too much. It might be worthwhile to add an <code>insert</code> method for anything that implements <code>Into&lt;XvcEntity&gt;</code>.</p>
<p>🐢 That would certainly save time—no more typing <code>.into()</code> for each key! :)</p>
<p>🐇 Pushed to test again. Should we have some way to test coverage locally?</p>
<p>🐢 I don’t think we need to check coverage locally. It’s not worth our time right now.</p>
<p>🐇 Now, while waiting for the tests to complete, what else can we do?</p>
<pre><code class="language-bash">gh -R iesahin/xvc run list
completed failure v0.6.13 Rust-CI v0.6.13 pull_request 12543831360 3m54s 2024-12-30T08:15:06Z
...
</code></pre>
<p>🐢 That didn’t take too long. Let’s view the results:</p>
<pre><code class="language-bash">gh -R iesahin/xvc run view 12543831360
...
  X Run Current Dev Tests
...
To see what failed, try: 
View this run on GitHub: https://github.com/iesahin/xvc/actions/runs/12543831360
</code></pre>
<p>🐢 The current dev tests are failing for some reason. Let’s run them locally.</p>
<p>🐇 We’re missing <code>llvm-tools-preview</code> locally. How do I install this?</p>
<p>🐢 The command is <code>rustup component add llvm-tools-preview</code>:</p>
<pre><code class="language-text">info: component 'llvm-tools' for target 'aarch64-apple-darwin' is up to date
</code></pre>
<p>🐇 It’s already installed. We just need to set the environment variables.</p>
<p>🐢 Instead, we can just turn off dev tests for the time being. We don’t really need them; our local tests pass.</p>
<p>🐇 Yeah, okay. We don’t need to solve every single bit of these issues right now.</p>
<pre><code class="language-bash">gh -R iesahin/xvc run list
...
</code></pre>
<p>🐇 Okay, let’s take a look at the run again.</p>
<pre><code class="language-bash">gh -R iesahin/xvc run list
completed failure v0.6.13 Rust-CI v0.6.13 pull_request 12544020064 3m39s 2024-12-30T08:33:25Z

gh -R iesahin/xvc run view 12544020064
...
  X Test and Coverage
...

gh run view 12544020064 --log-failed
...
Test and Coverage (stable) Test and Coverage 2024-12-30T08:36:58.8911690Z Error: ProcessError { stdout: "", stderr: "  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n\r  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0\r  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0\ncurl: (7) Failed to connect to e1.xvc.dev port 80 after 160 ms: Couldn't connect to server\n" }
...
</code></pre>
<p>🐢 We need to start Nginx on the server. We forgot to do that yesterday.</p>
<p>🐇 Ah, right. After that <code>dufs</code> installation. Okay.</p>
<p>🐢 We also need to add a reverse proxy for <code>dufs</code> somehow, but that’s for later.</p>
<p>🐇 For this use case, I don’t think it’s necessary. We can just adjust the port to a non-standard one if we need 443 for something else. Let’s look at the tests again.</p>
<p>🐢 Let’s add another doc test, this time to <code>XvcStore</code>.</p>
<pre><code class="language-bash">cargo test -p xvc-ecs --doc
...
test result: ok. 8 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out; finished in 2.87s
</code></pre>
<p>🐇 Sent the files again. Waiting for the tests to finish.</p>
<p>🐢 Let’s check the keymaps file in the meantime.</p>
<p>🐇 I tried reading the documentation but didn’t see an error. Maybe we should just set it to non-lazy and disallow remaps.</p>
<p>🐢 We’ve already spent too much time on this.</p>
<p>🐇 Yes, let’s check the tests again.</p>
<pre><code class="language-bash">gh -R iesahin/xvc run list
completed success v0.6.13 Rust-CI v0.6.13 pull_request 12544291068 8m10s 2024-12-30T09:00:42Z
...
</code></pre>
<p>🐢 Oh, nice, the merge is ready.</p>
<p>🐇 Patch coverage is still behind the target, though.</p>
<p>🐢 Yeah, but let’s release this one and ensure the next one is better covered. Also, I’m not sure if the doc tests actually affected the coverage report.</p>
<p>🐇 If we look at the <a href="https://app.codecov.io/gh/iesahin/xvc/pull/263?src=pr&amp;el=tree&amp;utm_medium=referral&amp;utm_source=github&amp;utm_content=comment&amp;utm_campaign=pr+comments&amp;utm_term=Emre+Sahin">coverage page</a> again, we can see.</p>
<p>🐢 It seems codecov.io doesn’t consider coverage for doc tests. That’s a bit weird, but let’s not spend more time on it.</p>
<p>🐇 Sure, let’s merge.</p>
<p>🐢 I think we forgot to bump the versions in the <code>Cargo.toml</code> files. We’ll have to do that in <code>main</code>.</p>
<p>🐇 Oh, yeah. Let’s bump them and tag the release as well.</p>
<p>🐢 Now we can wait for all the files to be produced. What’s next?</p>
<p>🐇 We can release the Python version too. It shouldn’t need any changes.</p>
<p>🐢 Right. Maybe we can add a few tests there as well.</p>
<p>🐇 Let’s bump the version first and see.</p>
<p>🐢 I’ve bumped the versions in <code>Cargo.toml</code> and run <code>maturin develop</code>.</p>
<p>🐇 It seems ready now.</p>
<p>🐢 The main branch is failing, though. The “Publish crates” action is looking for <code>libsqlite3</code>. Let’s investigate.</p>
<pre><code class="language-bash">gh -R iesahin/xvc run list
completed failure Release v0.6.13 Publish Crates v0.6.13 push 12544753359 6m1s 2024-12-30T09:41:56Z
</code></pre>
<p>🐢 The issue is that the VM doesn’t have <code>libsqlite3-dev</code>. Let’s add it.</p>
<p>🐇 We need to restart the job manually. Let’s skip tagging this time.</p>
<p>🐢 Some of the packages were already published, and now they’re causing failures because crates.io says they already exist. Maybe we can check if a package is already published before trying.</p>
<p>🐇 Let’s see if we can make <code>cargo publish</code> more forgiving.</p>
<p>🐢 There doesn’t seem to be an easy option. Let’s search for “how to skip published packages in workspace to avoid errors with cargo publish.”</p>
<p>🐇 Claude is hallucinating again. Let’s try a manual approach: how to skip already published packages?</p>
<p>🐢 It might be easier to just add a check. How do we get that info?</p>
<p>🐇 Or we can just move on to the next package if one is already available.</p>
<p>🐢 Let’s push the missing packages manually this time.</p>
<p>🐢 We should have a key to open garden files quickly. What does <code>Fzf-Lua files</code> receive as arguments?</p>
<p>🐇 Let’s check the help page: <code>fzf-lua</code>.</p>
<p>🐢 Before that, maybe we can try to fix why selected lines are not searched in Visual-Line mode?</p>
<p>🐇 Yep, let’s fix our search first.</p>
<p>🐢 How do you set a key in visual line mode in Neovim Lua?</p>
<p>🐇 The abbreviation is <code>V</code>. Let’s try that.</p>
<p>🐢 Looks like we need to restart the session.</p>
<p>🐇 It’s still not working. Let’s check <code>:map</code>.</p>
<p>🐢 It seems it needs more care; I’ll check it later.</p>
<p>👨🏾‍🦲
🐢 Bence kendini biraz daha anlamlı bir işle uğraştırmalısın.
🐇 Ne gibi?
🐢 Belki biraz daha yayın yapmalısın, biraz daha işe başvurmalısın.
🐇 “Meli”, “malı” ile geçiyor ömrümüz.</p>
<p>⌚
🐢 It looks like we can move most of the daily template to links or commands. We can call it <code>ref/daily</code>. My idea is to fill the page intentionally, without templates.</p>
<p>🐇 It might be better to start with a blank page, yeah. The template makes me a bit nervous. There are too many things to fill in, and most of them aren’t things I like being pushed into doing.</p>
<p>🐢 Let’s start by moving the daily templates to <code>ref/daily</code>. No more daily template.</p>
<p>🐇 Now we can delete the rest of this page. We’ll use the daily links page and maybe have reminders at the end of these sessions.</p>
<p>👨🏽‍⚕️</p>]]></content:encoded>
    </item>
    <item>
      <title>devlog 6</title>
      <published>2024-07-12T08:53:14+00:00</published>
      <updated>2024-07-12T08:53:14+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Fri, 12 Jul 2024 08:53:14 +0000</pubDate>
      <link>https://emresahin.net/devlog-6/</link>
      <guid isPermaLink="true">https://emresahin.net/devlog-6/</guid>
      <description>I have a habit of testing against the CLI’s help string output. It allows me to keep the documentation up to date and makes me aware of any undocumented options. When new features are added, the help text changes and the test fails, which prompts me to add those options to the documentation. I tr...</description>
      <category>devlog</category>
      <category>Software Development</category>
      <category>xvc</category>
      <category>Python</category>
      <category>pytest</category>
      <category>clap</category>
      <category>CLI</category>
      <category>Testing</category>
      <content:encoded><![CDATA[<p>I have a habit of testing against the CLI’s help string output. It allows me to
keep the documentation up to date and makes me aware of any undocumented options.
When new features are added, the help text changes and the test fails, which
prompts me to add those options to the documentation.</p>
<p>I tried the same approach when testing Python bindings with Pytest:</p>
<pre><code class="language-python">def test_pipeline_step_dependency(empty_xvc_repo):
    dep_help = empty_xvc_repo.pipeline().step().dependency(help=True)
    expected = """
Usage: xvc pipeline step dependency [OPTIONS] --step-name &lt;STEP_NAME&gt;

Options:
  -s, --step-name &lt;STEP_NAME&gt;
          Name of the step to add the dependency to
"""
    assert dep_help == expected
</code></pre>
<p>This doesn’t work because the help text is generated by <a href="https://docs.rs/clap/latest/clap/">clap</a> and skips the usual
thread-based output handler. All command output and errors in Xvc are returned
as strings from the command, except for the help text that’s generated by <a href="https://docs.rs/clap/latest/clap/">clap</a>
automatically.</p>
<p>There are probably workarounds for this, but I won’t pursue them further as I don’t
test the actual functionality in the Python bindings anyway.</p>]]></content:encoded>
    </item>
    <item>
      <title>devlog 5</title>
      <published>2024-07-08T20:35:24+00:00</published>
      <updated>2024-07-08T20:35:24+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Mon, 08 Jul 2024 20:35:24 +0000</pubDate>
      <link>https://emresahin.net/devlog-5/</link>
      <guid isPermaLink="true">https://emresahin.net/devlog-5/</guid>
      <description>While writing Xvc tests for Python, I hit an error caused by the ECS single-load protection. The single-loader allows only one instance of Xvc to be run in a single process. This is no problem for the shell, but it looks like it won’t be possible to use multiple Xvc instances in a single Python p...</description>
      <category>devlog</category>
      <category>Xvc</category>
      <category>devlog</category>
      <category>multiprocessing</category>
      <category>Jupyter</category>
      <category>python</category>
      <category>ecs</category>
      <category>testing</category>
      <content:encoded><![CDATA[<p>While writing Xvc tests for Python, I hit an error caused by the ECS single-load protection.</p>
<p>The single-loader allows only one instance of Xvc to be run in a single process. This is no problem for the shell, but it looks like it won’t be possible to use multiple Xvc instances in a single Python process.</p>
<p>It’s possible to overcome this with an elaborate multiprocessing setup in the wrapper, but I won’t bother with it for now.</p>]]></content:encoded>
    </item>
    <item>
      <title>Xvc Devlog - 221108</title>
      <published>2022-11-09T10:42:00+00:00</published>
      <updated>2022-11-09T10:42:00+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Wed, 09 Nov 2022 10:42:00 +0000</pubDate>
      <link>https://emresahin.net/xvc-devlog---221108/</link>
      <guid isPermaLink="true">https://emresahin.net/xvc-devlog---221108/</guid>
      <description>🐇 I think we can begin by checking GitHub PRs . What do you have today? 🐢 The tests for yesterday’s Git integration PR failed. I’ll begin by checking the logs. 🐇 Maybe run the tests locally to see. They might fail on your machine as well. It might be a simple thing. 🐢 Probably, yes. I’ve started ...</description>
      <category>devlog</category>
      <category>Software Development</category>
      <category>xvc</category>
      <category>git</category>
      <category>testing</category>
      <category>trace</category>
      <category>rsync</category>
      <category>storage</category>
      <category>github actions</category>
      <category>automation</category>
      <content:encoded><![CDATA[<p>🐇 I think we can begin by checking <a href="https://github.com/pulls">GitHub PRs</a>. What do you have today?</p>
<p>🐢 The tests for yesterday’s <a href="https://github.com/iesahin/xvc/pull/105">Git integration PR</a> failed. I’ll begin by checking the logs.</p>
<p>🐇 Maybe run the tests locally to see. They might fail on your machine as well. It might be a simple thing.</p>
<p>🐢 Probably, yes. I’ve started the tests now. I shouldn’t forget to run them before testing the PR; it may save some time.</p>
<p>🐇 Ah, yeah, maybe. Yesterday you were already at the end of the workday, so it didn’t matter much. But you can shorten the testing time by reducing the number of files, etc. I think a separate benchmark suite might be good to have. Tests should be shorter; benchmarks should only run for tags.</p>
<p>🐢 Yup. I should shorten the tests. I should make them use a shorter list of files, maybe.</p>
<p>🐇 Local tests have passed. You’ll have to check the logs.</p>
<p>🐢 It seems <code>git diff --name-only --cached</code> returns files not yet added. That’s causing an error in new repositories with <code>stash</code>. Stashing shouldn’t run at all when there are no staged files.</p>
<p>🐇 Git behavior between the local version and the remote version seems different.</p>
<p>🐢 I think the trace should also show the Git version string.</p>
<p>🐇 You should also require a minimum Git version for the commands. You’re using some newer options, and not all users may have them.</p>
<p>🐢 Yep. Let’s see the version on the CI now.</p>
<hr>
<p>🐢 Ah, I see—the problem is not about versions. It’s that the CI doesn’t configure <code>git config --global user.email</code> and <code>user.name</code>. Commits don’t work without these.</p>
<p>🐇 You should remove the Git version report, then. It’s one more process call for no reason.</p>
<p>🐢 I think it should be in <code>trace!</code>; I can check the verbosity level and call it only if it’s trace.</p>
<hr>
<p>🐢 I completed the xvc-config docs as well. I think I can merge it before the tests finish, as it’s just a documentation update.</p>
<p>🐇 You seem to be rushing for the release.</p>
<p>🐢 Yeah, I want to really start testing this on the servers.</p>
<p>🐇 Then go ahead; let’s release a new version.</p>
<hr>
<p>🐇 It looks like you’re back for an evening session. I think it’s time to start using Xvc on your torrent server.</p>
<p>🐢 Ah, yeah. Let’s see how it goes.</p>
<p>🐇 Create a repository for torrents. Then you can add files to it with cache-type = symlink or cache-type = hardlink.</p>
<p>🐢 I think creating a local storage may also help. I can use it to store files to retrieve them later.</p>
<p>🐇 Umm. We don’t have a “garbage collection” facility yet, you know. There are no file deletions at the moment. It may be better to have a repository-to-repository transfer feature, using SSH.</p>
<p>🐢 Yeah, we don’t have SSH storage either. I think this highlights a lack of features.</p>
<p>🐇 It’s possible to mimic Rsync storage with <code>xvc storage new generic</code>, but it doesn’t feel quite the same.</p>
<p>🐢 Then I’m adding these three tickets.</p>
<p>🐇 I think for 0.3.4, the command we add might be <code>xvc file delete</code>. You can work on this and add <code>rsync</code> support as well.</p>
<p>🐢 There is a <a href="https://docs.rs/librsync/latest/librsync/">librsync</a> bindings library for Rust. But it looks like it doesn’t allow transferring file contents between hosts. There is also <a href="https://github.com/your-tools/rusync">rusync</a>, which is similar to rsync and implemented in Rust. There is also <a href="https://lib.rs/crates/fast_rsync">fast_rsync</a> in pure Rust. It uses MD4 to calculate deltas, though, I think.</p>
<p>🐇 None of these seem to have network capability, though.</p>
<p>🐢 I think it’s better just to use the process for now. We are trying to come up with the simplest solution <em>for now.</em> We are just trying to be more general.</p>
<p>🐇 Yes, I think we can just use the process for the time being.</p>
<p>🐢 Then let’s start by adding it.</p>
<p>🐇 We should also begin to create release notes. GitHub can generate them from PRs. <a href="https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#configuring-automatically-generated-release-notes">Automatically generated release notes</a></p>
<p>🐢 Created an issue for that. Now we’re starting <a href="https://github.com/iesahin/xvc/issues/111"><code>xvc storage new rsync</code> #111</a>.</p>
<p>🐇 Ok. Let’s do this.</p>]]></content:encoded>
    </item>
    <item>
      <title>Xvc Devlog 221031</title>
      <published>2022-11-05T09:18:00+00:00</published>
      <updated>2022-11-05T09:18:00+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Sat, 05 Nov 2022 09:18:00 +0000</pubDate>
      <link>https://emresahin.net/xvc-devlog-221031/</link>
      <guid isPermaLink="true">https://emresahin.net/xvc-devlog-221031/</guid>
      <description>🐇 It’s the last day of October. How are you doing, mister? 🐢 Yep. It was a nice October. I would like to finish by increasing the coverage. 🐇 How about setting up a runner on your machine to test them locally? 🐢 Not now. I should fix the tests as always. Later I can take a look at it. I don’t wan...</description>
      <category>xvc</category>
      <category>devlog</category>
      <category>ci/cd</category>
      <category>cross-compilation</category>
      <category>apple silicon</category>
      <category>testing</category>
      <category>xvc</category>
      <category>redirection</category>
      <category>shell</category>
      <content:encoded><![CDATA[<p>🐇 It’s the last day of October. How are you doing, mister?</p>
<p>🐢 Yep. It was a nice October. I would like to finish by increasing the coverage.</p>
<p>🐇 How about setting up a runner on your machine to test them locally?</p>
<p>🐢 Not now. I should fix the tests as always. Later I can take a look at it. I don’t want to distract myself with it.</p>
<p>🐇 You’ll need to create Apple Silicon binaries, though.</p>
<p>🐢 I think I can cross-compile for aarch.</p>
<p>🐇 You were doing this in the past, trying to build all binaries on a single Ubuntu VM. It didn’t work, as far as I remember.</p>
<p>🐢 I hadn’t even read <a href="https://rust-lang.github.io/rustup/cross-compilation.html">this section</a> then, and there is a <a href="https://github.com/cross-rs/cross">dedicated project</a> for it. The proper way is to use that. I’ll return to this after fixing the tests. I think we can release Xvc on all platforms supported by Rust.</p>
<p>🐇 Using <code>cross-rs</code> on GitHub Actions may be challenging. It seems <a href="https://stackoverflow.com/questions/66849112/how-do-i-cross-compile-a-rust-application-from-macos-x86-to-macos-silicon">Apple Silicon doesn’t need that much work</a> either. You can set up cross-compilation with <code>rustup</code> targets.</p>
<p>🐢 Yeah. It looks so. Let’s take a look at the <a href="https://emresahin.net/xvc-devlog-221030">previous devlog.</a></p>
<p>🐇 The page seems missing. Would you like to fix your site first?</p>
<p>🐢 Ah, yeah. I should, maybe. Now it’s time to fix those PRs. I’ll take care of the site later. I should change the theme anyway.</p>
<p>🐇 Ok. Let’s take a look at <a href="https://github.com/iesahin/xvc/pulls">outstanding PRs</a>.</p>
<p>🐢 I want to fix the failed tests locally first. Yesterday I wasn’t able to redirect the output. It looks like the correct way of doing it is <code>cargo test --all-features --no-fail-fast &gt; $TMPDIR/xvc-test.log 2&gt;&amp;1</code>. It’s required to put <code>2&gt;&amp;1</code> at the end, not between the redirection and output.</p>
<p>🐇 There is also the <code>&amp;&gt;</code> operator that you may want to use. <code>cargo test --all-features --no-fail-fast &amp;&gt; $TMPDIR/xvc-test.log</code> should be equivalent to this.</p>
<p>🐢 I’ll try it when the tests finish.</p>
<p>🐇 In the meantime, you can work to fix the documentation. In another repository, perhaps.</p>
<p>🐢 Good idea. Let me clone that.</p>
<p>🐇 Looks like the tests have finished and the only error is Minio. It couldn’t find the env variables you defined.</p>
<p>🐢 Restarted the shell and the tests. Returned to docs now.</p>
<hr>
<p>🐢 Added a few function docs. Storage tests seem to pass. Probably they will fail in GA because of <code>rsync</code> tests using <code>one.emresult.com</code> login in my name.</p>
<p>🐇 If that’s expected, you can push and begin to fix it.</p>
<p>🐢 Yeah, let’s push the tests.</p>
<hr>
<p>🐢 It looks like connecting to localhost also poses a challenge. Instead, I can create a user for <code>xvc</code> on the server and limit its usage.</p>
<p>🐇 Hmm. Good idea for now.</p>
<p>🐢 I created a new user <code>xvc-test@one.emresult.com</code> and its SSH keys. I’ll update the action to write the secret to the keyfile.</p>
<hr>
<p>🐇 Looks like you forgot to install <code>mc</code> for Minio connection.</p>
<p>🐢 Yeah, I must convert Minio tests to use <code>s3cmd</code>.</p>
<p>🐇 And your region in <code>s3</code> configuration seems to be wrong.</p>
<p>🐢 I’ll need to check this.</p>
<p>🐇 There is this line in the tests <code>let region = env::var("AWS_DEFAULT_REGION").unwrap_or("us-east-1".to_string());</code> that’s probably causing that error. You should define the region properly.</p>
<p>🐢 I set this to <code>eu-central-1</code> directly and will check the Minio error in the next session.</p>
<p>🐇 👏</p>
<hr>
<p>🐢 It’s working except for the rsync tests now.</p>
<p>🐇 I think you can just use localhost to run the tests. You may need to install openssh-server, but it should work with localhost without configuration.</p>
<p>🐢 There may be a step missing in the configuration. I’ll try to make it run.</p>
<hr>
<p>🐢 I’m trying to use <code>.ssh/config</code> in GA to allow connections to the server. It doesn’t work for some reason.</p>
<p>🐇 You may try to log in to the server outside of the tests and check if it’s running.</p>
<hr>
<p>🐢 Yesterday’s last attempt was successful, and now we have working remote storage tests.</p>
<p>🐇 👏👏👏🥳</p>
<p>🐢 I’m merging the PR.</p>]]></content:encoded>
    </item>
    <item>
      <title>TIL April 26</title>
      <published>2020-04-26T23:26:15+00:00</published>
      <updated>2020-04-26T23:26:15+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Sun, 26 Apr 2020 23:26:15 +0000</pubDate>
      <link>https://emresahin.net/til-april-26--6474/</link>
      <guid isPermaLink="true">https://emresahin.net/til-april-26--6474/</guid>
      <description>Hosting static websites on AWS takes only 5 minutes of configuration. For some of my books, I think I can use some ornamental public domain images . This guy talks about a third way to stop the pandemic: testing everyone. The one that is most proven and ready to scale is based on a technology cal...</description>
      <category>TIL</category>
      <category>AWS</category>
      <category>static-sites</category>
      <category>design</category>
      <category>public-domain</category>
      <category>COVID-19</category>
      <category>testing</category>
      <content:encoded><![CDATA[<ul>
<li>Hosting static websites on AWS takes only 5 minutes of configuration.</li>
<li>For some of my books, I think I can use some <a href="https://www.rawpixel.com/board/1221837/lanimal-dans-la-decoration-free-cc0-ornamental-designs?sort=curated&amp;mode=shop&amp;page=1">ornamental public domain images</a>.</li>
<li><a href="https://paulbuchheit.blogspot.com/2020/04/a-third-solution.html">This guy</a> talks about a third way to stop the pandemic: testing everyone.</li>
</ul>
<blockquote>
<p>The one that is most proven and ready to scale is based on a technology called LSPR. The team building it originally developed the device to monitor the status of the immune system, but it is easily adapted to detect the proteins on the surface of the virus instead of the proteins used for immune signaling. It’s able to detect even a very small number of viral particles, which is very important because we want to detect everyone who is contagious. Waiting for symptoms such as a fever or antibodies is too slow to stop the spread. What’s exciting is that they are creating a very sensitive test that can be mass produced at low cost (less than $1/test).</p>
</blockquote>]]></content:encoded>
    </item>
    <item>
      <title>The Sorry State of NDK Testing in Android</title>
      <published>2018-02-08T09:39:03+00:00</published>
      <updated>2018-02-08T09:39:03+00:00</updated>
      <author>Emre Şahin</author>
      <pubDate>Thu, 08 Feb 2018 09:39:03 +0000</pubDate>
      <link>https://emresahin.net/ndk-testing-android-14087-70802/</link>
      <guid isPermaLink="true">https://emresahin.net/ndk-testing-android-14087-70802/</guid>
      <description>I’m writing a C library for use in Android, iOS, and Python applications. Although the C library has its own unit tests, I wanted to write a few more to ensure that data transfer between the C and Android layers is correct. In Android, one needs to put unit test files in the app/src/test/*module-...</description>
      <category>Software</category>
      <category>Android</category>
      <category>Development</category>
      <category>ndk</category>
      <category>android</category>
      <category>testing</category>
      <category>c</category>
      <category>jni</category>
      <content:encoded><![CDATA[<p>I’m writing a C library for use in Android, iOS, and Python applications. Although
the C library has its own unit tests, I wanted to write a few more to ensure
that data transfer between the C and Android layers is correct.</p>
<p>In Android, one needs to put unit test files in the <code>app/src/test/*module-name*</code>
directory. I spent a few hours yesterday writing tests to check that the
conversion between <em>visenc</em> and <em>Unicode</em> is correct in Android. After those
hours, however, I learned that NDK support for tests is limited, and the error I
received means that <a href="https://stackoverflow.com/questions/34802667/unit-test-java-class-that-loads-native-library">I need to write instrumentation
tests</a>
instead, which use an emulator or a real device.</p>
<p>Instrumentation tests are <em>user tests</em> that check whether the user-facing
aspects of the app run correctly. Unit tests, instead, check whether data flow,
calculations, etc., are working as expected. The former is slow; it needs to be
run in an emulator and should mimic user behavior. Just checking
whether <em>e</em> converted correctly to ا should not require an emulator.</p>]]></content:encoded>
    </item>
  </channel>
</rss>
