todo/add testremote cleanupgit-annexhttp://git-annex.branchable.com/todo/add_testremote_cleanup/git-annexikiwiki2022-08-29T18:09:24Zcomment 1http://git-annex.branchable.com/todo/add_testremote_cleanup/comment_1_9dc28d46dfcd693def4cbb3837de55e0/joey2022-08-24T17:13:48Z2022-08-24T17:05:50Z
<p>Like the man page for this command says, it's best to make a new remote for
testing purposes, not use a production one.</p>
<p>I think that a simple improvement to it would be for it to generate the
same test keys every time. Then if it failed once or was interrupted or
the remote was buggy, once that got fixed the same command could be run
again, and would clean up the test keys that were earlier stored on the
remote.</p>
<p>It's generating random data and a key from that,
but a predictable random data would not impair the test really.
Although testExportTree currently starts with a test that might fail
if the key is already present in the remote.</p>
comment 2http://git-annex.branchable.com/todo/add_testremote_cleanup/comment_2_a87de50ab7c39d955d5c1f6a1c51f761/joey2022-08-24T17:17:59Z2022-08-24T17:15:06Z
<p>Problem with that idea: testremote makes variants of the remote with
shared encryption enabled. So the content being stored on the remote is not
only random, but is encrypted with a random key. It would have to
initialize the encrypted remote with a fixed encryption key. This would
need some significant changes to accomplish.</p>
testremote cleanuphttp://git-annex.branchable.com/todo/add_testremote_cleanup/comment_3_976fd7b1db867bf5fe785e0d32acddcb/Ilya_Shlyakhter2022-08-28T20:15:39Z2022-08-28T20:15:38Z
<blockquote><p>Like the man page for this command says, it's best to make a new remote for testing purposes, not use a production one.</p></blockquote>
<p>My fault for not re-reading the webpage.</p>
<p>There's some value, I think, in being able to test production remotes. There's always a chance that a test remote got configured differently than a production one, so there's more confidence from having tested the production remote.</p>
<p>If <a href="https://git-annex.branchable.com/todo/find__47__prefer_keys_by_file_extension_in_key/">find/prefer keys by file extension in key</a> could be implemented, one could delete keys matching <code>*.this-is-a-test-key</code>.</p>
comment 4http://git-annex.branchable.com/todo/add_testremote_cleanup/comment_4_ef144de6384eb89a2d4caa13e6895872/joey2022-08-29T16:46:05Z2022-08-29T16:44:20Z
<p>The keys used by testremote never reach the git-annex branch, so there is
not a way to list them.</p>
<p>What would work is to make testremote record the keys it stores to a log
file, and then it could clean up ones from previous runs.</p>
testremote cleanuphttp://git-annex.branchable.com/todo/add_testremote_cleanup/comment_5_0a3c3cc6c9b4efd7a6c4cf7333f2b120/Ilya_Shlyakhter2022-08-29T18:09:24Z2022-08-29T18:09:24Z
<blockquote><p>What would work is to make testremote record the keys it stores to a log file, and then it could clean up ones from previous runs.</p></blockquote>
<p>Yes -- I thought to suggest that but was thinking of a file the user has to deal with, which is clumsy. But I think you're suggesting a file somewhere under <code>.git/annex</code>, which would be a clean solution.</p>