diff --git a/.forgejo/workflows/pr.yml b/.forgejo/workflows/pr.yml index 7d227bd..2f79e82 100644 --- a/.forgejo/workflows/pr.yml +++ b/.forgejo/workflows/pr.yml @@ -15,11 +15,11 @@ jobs: - name: run the fake API server id: test run: | - go test -c + touch delete_me_when_ready # keep server running in the background - ACTION_TESTING=1 ./ovh-dns-update.test & - # wait for the output to be written (OVH_ENDPOINT) - sleep 1 + ACTION_TESTING=1 go test . & + # wait for the OVH_ENDPOINT output to be written + inotifywait delete_me_when_ready - name: update the record uses: ./ with: diff --git a/main_test.go b/main_test.go index 204c028..ac2e4b3 100644 --- a/main_test.go +++ b/main_test.go @@ -89,6 +89,10 @@ func TestRun(t *testing.T) { })) t.Cleanup(s.Close) githubactions.SetOutput("OVH_ENDPOINT", "http://"+s.Listener.Addr().String()) + err = os.Remove("delete_me_when_ready") + if err != nil { + t.Fatal(err) + } select {} } }