test: unit tests clean up themselves #810
Merged
decentral1se
merged 1 commits from 2026-04-01 08:55:07 +00:00
fix/792 into main
Labels
Clear labels
bug
build
ci/cd
critical fix
design
documentation
duplicate
easy-first-issue
enhancement
help wanted
i10n
i18n
installer
invalid
question
release
release-candidate
security
tech-debt
test
wontfix
Something is not working
go build related issues
Building things with CI/CD
https://docs.coopcloud.tech/federation/resolutions/passed/010/
UI/UX
Documenting all the things
This issue or pull request already exists
Something for new people to get stuck into. We hope it's easy!
New feature
Need some help
Everything to do with localisation
Everything to do with internationalisation
Everything to do with the install script.
Something is wrong
More information is needed
Release management
Related to the new release candidate
Security related
Unit/integration testing
This won't be fixed
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Assignees
3wordchant
aadil (Aadil Ayub)
abra-bot (Abra Bot)
ammaratef45
amras (Sarma)
Apfelwurm
BornDeleuze
Brooke
carla
cas (Cassowary)
coopcloud
cyrnel
decentral1se (d1)
dede
devydave
fauno (fauno)
iexos
jade (Jade Ambrose)
jjsfunhouse
jmakdah2 (Jackie Makdah)
joe-irving (Joe Irving)
kawaiipunk (KawaiiPunk)
knoflook
kolaente
lambdabundesverband
linnealovespie (April)
moosemower
moritz
notplants
oxaliq (sorrel)
p4u1
pharaohgraphy (Andrew 🐦🔥❤️🔥✴️)
renovate-bot (Comrade Renovate Bot)
ripclap
simon
sixsmith (Sixsmith)
stevensting
trav (Trav Fryer)
val (val (he/him))
yksflip
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: toolshed/abra#810
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
See #792.
$ABRA_DIRinstead of symlink'd$ABRA_DIR)@@ -14,2 +15,2 @@testPkg.MkServerAppRecipe()defer testPkg.RmServerAppRecipe()integration.TestRecipeSetup()defer t.Cleanup(func() {Is the defer still needed?
Oh true, apparently not: https://pkg.go.dev/testing#B.Cleanup
I will check this when I look at it next 🤓 Thanks!
@@ -0,0 +11,4 @@func TestRecipeTeardown() {abraDir := os.ExpandEnv("$ABRA_DIR")if abraDir == fmt.Sprintf("%s/.abra", os.Getenv("HOME")) {Why not put this in the setup function? Or maybe put it in both places, just to make sure
I call
TestRecipeTeardownas the first lineTestRecipeSetup, so it already is called twice? Happy to do whatever is clearer. I always end up getting confused by fancy test suite setup/teardowns and would welcome any tips!Ah ok, I overlooked that. It's fine with me then
wip: test: unit tests clean up themselvesto WIP: test: unit tests clean up themselvesebf0989ac2to20814651892081465189to20cf3d75a720cf3d75a7to612a38df5a612a38df5atoa2708b3ab767f1a34e6dto369325e324369325e324toed1d961d07ed1d961d07to8ea78ee9fc8ea78ee9fctob252743042b252743042tof34d9a1e35f34d9a1e35to66a6aecc5f66a6aecc5ftob519b1984beeb29bb0bfto04d5bd113f04d5bd113fto04895fe7ae04895fe7aetod88b478503Wow, this has been an utterly frustrating experience discovering that we now have a race issue in our unit tests because Go parallelizes tests in a single module. This was causing different tests to try and destroy the only
$ABRA_DIRavailable while other tests were accessing it. I've made the tests not run in parallel which slows them down but Makes Shit Work Again ™️. I'll open an issue to track getting this back to high speed.