Migrate run state and reference contracts to native execution
This commit is contained in:
@@ -11,28 +11,20 @@ import (
|
||||
)
|
||||
|
||||
func TestRunCreatesReusableGroupAccessibleCacheState(t *testing.T) {
|
||||
previousUmask := syscall.Umask(0o007)
|
||||
previousUmask := syscall.Umask(0007)
|
||||
defer syscall.Umask(previousUmask)
|
||||
|
||||
roots := newStateTestRoots(t)
|
||||
harness := newStateTestHarness()
|
||||
result := runStateTest(t, roots, harness.options(), false, false, "auto")
|
||||
if result.code != 0 {
|
||||
t.Fatalf("initial run code=%d stderr=%q", result.code, result.stderr)
|
||||
fixture := newStateRunFixture(t)
|
||||
first := fixture.run(t, "--cache", "auto")
|
||||
if first.status != 0 {
|
||||
t.Fatalf("initial run=%#v", first)
|
||||
}
|
||||
assertGroupAccessibleCacheTree(t, roots.plans)
|
||||
assertGroupAccessibleCacheTree(t, roots.checkpoints)
|
||||
|
||||
extractCalls := harness.extractCalls
|
||||
result = runStateTest(t, roots, harness.options(), false, true, "auto")
|
||||
if result.code != 0 {
|
||||
t.Fatalf("resume run code=%d stderr=%q", result.code, result.stderr)
|
||||
}
|
||||
if harness.extractCalls != extractCalls {
|
||||
t.Fatalf("extract calls after reuse = %d, want %d", harness.extractCalls, extractCalls)
|
||||
assertGroupAccessibleCacheTree(t, fixture.cacheRoot)
|
||||
calls := len(fixture.client.requestsSnapshot())
|
||||
second := fixture.run(t, "--cache", "auto")
|
||||
if second.status != 0 || len(fixture.client.requestsSnapshot()) != calls {
|
||||
t.Fatalf("reuse=%#v calls=%d/%d", second, len(fixture.client.requestsSnapshot()), calls)
|
||||
}
|
||||
}
|
||||
|
||||
func assertGroupAccessibleCacheTree(t *testing.T, root string) {
|
||||
t.Helper()
|
||||
if err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
|
||||
|
||||
Reference in New Issue
Block a user