mirror of
https://github.com/logos-storage/logos-storage-go-bindings.git
synced 2026-01-02 13:33:10 +00:00
makes sure we are having Nat set to None for the tests
This commit is contained in:
parent
f69939fdae
commit
7e3b855103
10
Makefile
10
Makefile
@ -21,7 +21,7 @@ update: | submodules
|
|||||||
|
|
||||||
libcodex:
|
libcodex:
|
||||||
@echo "Building libcodex..."
|
@echo "Building libcodex..."
|
||||||
@$(MAKE) -C $(NIM_CODEX_DIR) libcodex
|
@$(MAKE) -C $(NIM_CODEX_DIR) libcodex CODEX_LIB_PARAMS="-d:codex_enable_api_debug_peers"
|
||||||
|
|
||||||
build:
|
build:
|
||||||
@echo "Building Codex Go Bindings..."
|
@echo "Building Codex Go Bindings..."
|
||||||
@ -31,6 +31,14 @@ test:
|
|||||||
@echo "Running tests..."
|
@echo "Running tests..."
|
||||||
CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" GOTESTFLAGS="-timeout=2m" go test ./...
|
CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" GOTESTFLAGS="-timeout=2m" go test ./...
|
||||||
|
|
||||||
|
test2:
|
||||||
|
@echo "Running tests..."
|
||||||
|
CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" GOTESTFLAGS="-timeout=2m" gotestsum --packages="./..." -f testname -- -count 1 -run TestConnectWithAddress
|
||||||
|
|
||||||
|
test3:
|
||||||
|
@echo "Running tests..."
|
||||||
|
CGO_ENABLED=1 CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" GOTESTFLAGS="-timeout=2m" gotestsum --packages="./..." -f testname -- -count 1
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@echo "Cleaning up..."
|
@echo "Cleaning up..."
|
||||||
@git submodule deinit -f $(NIM_CODEX_DIR)
|
@git submodule deinit -f $(NIM_CODEX_DIR)
|
||||||
|
|||||||
@ -36,6 +36,7 @@ func TestConnectWithAddress(t *testing.T) {
|
|||||||
LogFormat: LogFormatNoColors,
|
LogFormat: LogFormatNoColors,
|
||||||
MetricsEnabled: false,
|
MetricsEnabled: false,
|
||||||
DiscoveryPort: 8090,
|
DiscoveryPort: 8090,
|
||||||
|
Nat: "none",
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Failed to create codex1: %v", err)
|
t.Fatalf("Failed to create codex1: %v", err)
|
||||||
@ -50,6 +51,7 @@ func TestConnectWithAddress(t *testing.T) {
|
|||||||
LogFormat: LogFormatNoColors,
|
LogFormat: LogFormatNoColors,
|
||||||
MetricsEnabled: false,
|
MetricsEnabled: false,
|
||||||
DiscoveryPort: 8091,
|
DiscoveryPort: 8091,
|
||||||
|
Nat: "none",
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Failed to create codex2: %v", err)
|
t.Fatalf("Failed to create codex2: %v", err)
|
||||||
|
|||||||
@ -15,6 +15,7 @@ func defaultConfigHelper(t *testing.T) Config {
|
|||||||
MetricsEnabled: false,
|
MetricsEnabled: false,
|
||||||
BlockRetries: 3000,
|
BlockRetries: 3000,
|
||||||
LogLevel: "ERROR",
|
LogLevel: "ERROR",
|
||||||
|
Nat: "none",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,6 +44,11 @@ func newCodexNode(t *testing.T, opts ...Config) *CodexNode {
|
|||||||
if c.DiscoveryPort != 0 {
|
if c.DiscoveryPort != 0 {
|
||||||
config.DiscoveryPort = c.DiscoveryPort
|
config.DiscoveryPort = c.DiscoveryPort
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// in case someone wants to change the config.Nat default value
|
||||||
|
if c.Nat != "" {
|
||||||
|
config.Nat = c.Nat
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
node, err := New(config)
|
node, err := New(config)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user