mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-09-19 17:50:12 +00:00
test(agentcompat): use native contract paths
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package contract
|
package contract
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@@ -82,11 +83,15 @@ func TestContract_ResourceBudgetRejectsInvalidInput(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestContract_CLIValues(t *testing.T) {
|
func TestContract_CLIValues(t *testing.T) {
|
||||||
paths, err := NewPaths("/src/nezha", "/src/agent", "/tmp/results")
|
root := t.TempDir()
|
||||||
|
nezhaSource := filepath.Join(root, "nezha-source")
|
||||||
|
agentSource := filepath.Join(root, "agent-source")
|
||||||
|
resultsDir := filepath.Join(root, "results")
|
||||||
|
paths, err := NewPaths(nezhaSource, agentSource, resultsDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("construct paths: %v", err)
|
t.Fatalf("construct paths: %v", err)
|
||||||
}
|
}
|
||||||
if paths.NezhaSource().String() != "/src/nezha" || paths.AgentSource().String() != "/src/agent" || paths.ResultsDir().String() != "/tmp/results" {
|
if paths.NezhaSource().String() != nezhaSource || paths.AgentSource().String() != agentSource || paths.ResultsDir().String() != resultsDir {
|
||||||
t.Fatalf("unexpected paths: %#v", paths)
|
t.Fatalf("unexpected paths: %#v", paths)
|
||||||
}
|
}
|
||||||
scenario, err := NewScenario("metadata")
|
scenario, err := NewScenario("metadata")
|
||||||
|
|||||||
Reference in New Issue
Block a user