Skip tests that require external services(Tor, I2P) when running in CI

This commit is contained in:
eyedeekay 2024-08-05 20:33:06 -04:00
parent 5098937e96
commit 11b284a639
No known key found for this signature in database
GPG key ID: D75C03B39B5E14E1
2 changed files with 70 additions and 62 deletions

View file

@ -13,7 +13,10 @@ import (
// Run the monolith: ./monolith.debug -test.coverprofile=/somewhere/to/dump/integrationcover.out DEVEL --config dendrite.yaml
// Generate HTML with coverage: go tool cover -html=/somewhere/where/there/is/integrationcover.out -o cover.html
// Source: https://dzone.com/articles/measuring-integration-test-coverage-rate-in-pouchc
func TestMain(_ *testing.T) {
func TestMain(t *testing.T) {
if os.Getenv("CI") != "" {
t.Skip("skipping test, as no TOR/I2P client is available")
} else {
var (
args []string
)
@ -47,4 +50,5 @@ func TestMain(_ *testing.T) {
case <-waitCh:
return
}
}
}

View file

@ -13,7 +13,10 @@ import (
// Run the monolith: ./monolith.debug -test.coverprofile=/somewhere/to/dump/integrationcover.out DEVEL --config dendrite.yaml
// Generate HTML with coverage: go tool cover -html=/somewhere/where/there/is/integrationcover.out -o cover.html
// Source: https://dzone.com/articles/measuring-integration-test-coverage-rate-in-pouchc
func TestMain(_ *testing.T) {
func TestMain(t *testing.T) {
if os.Getenv("CI") != "" {
t.Skip("skipping test, as no TOR/I2P client is available")
} else {
var (
args []string
)
@ -47,4 +50,5 @@ func TestMain(_ *testing.T) {
case <-waitCh:
return
}
}
}