Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@ We try to follow the coding guidelines from the Go community.
- Code should be commented
- Code should pass all tests: `make test`

#### Skipping Network-Dependent Tests

Some tests require network access to connect to Flow mainnet/testnet nodes. To skip these tests (e.g., in sandboxed build environments like Nix), set the `SKIP_NETWORK_TESTS` environment variable:

```
SKIP_NETWORK_TESTS=1 make test
```

## Releasing

Releasing is automated by Github actions. Release action is triggered by creating a release on Github and publishing it.
Expand Down
21 changes: 21 additions & 0 deletions internal/test/test_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,9 @@ Seed: 1521
}

func TestForkMode_UsesMainnetAliases(t *testing.T) {
if os.Getenv("SKIP_NETWORK_TESTS") != "" {
t.Skip("skipping network-dependent test")
}
t.Parallel()

_, state, _ := util.TestMocks(t)
Expand Down Expand Up @@ -822,6 +825,9 @@ func TestForkMode_UsesMainnetAliases(t *testing.T) {
}

func TestForkMode_UsesTestnetAliasesExplicit(t *testing.T) {
if os.Getenv("SKIP_NETWORK_TESTS") != "" {
t.Skip("skipping network-dependent test")
}
t.Parallel()

_, state, _ := util.TestMocks(t)
Expand Down Expand Up @@ -902,6 +908,9 @@ func TestForkMode_AutodetectFailureRequiresExplicitNetwork(t *testing.T) {
}

func TestNetworkForkResolution_Success(t *testing.T) {
if os.Getenv("SKIP_NETWORK_TESTS") != "" {
t.Skip("skipping network-dependent test")
}
t.Parallel()

_, state, _ := util.TestMocks(t)
Expand Down Expand Up @@ -1011,6 +1020,9 @@ access(all) fun testSimple() {
}

func TestNetworkForkResolution_WithOwnHost(t *testing.T) {
if os.Getenv("SKIP_NETWORK_TESTS") != "" {
t.Skip("skipping network-dependent test")
}
t.Parallel()

_, state, _ := util.TestMocks(t)
Expand Down Expand Up @@ -1052,6 +1064,9 @@ access(all) fun testSimple() {
}

func TestContractAddressForkResolution_UsesMainnetForkFirst(t *testing.T) {
if os.Getenv("SKIP_NETWORK_TESTS") != "" {
t.Skip("skipping network-dependent test")
}
t.Parallel()

_, state, _ := util.TestMocks(t)
Expand Down Expand Up @@ -1116,6 +1131,9 @@ access(all) fun testUsesMainnetForkAddress() {
}

func TestContractAddressForkResolution_FallbackToMainnet(t *testing.T) {
if os.Getenv("SKIP_NETWORK_TESTS") != "" {
t.Skip("skipping network-dependent test")
}
t.Parallel()

_, state, _ := util.TestMocks(t)
Expand Down Expand Up @@ -1180,6 +1198,9 @@ access(all) fun testFallbackToMainnetAddress() {
}

func TestContractAddressForkResolution_PrioritizesForkOverParent(t *testing.T) {
if os.Getenv("SKIP_NETWORK_TESTS") != "" {
t.Skip("skipping network-dependent test")
}
t.Parallel()

_, state, _ := util.TestMocks(t)
Expand Down
Loading