Skip to content

Commit

Permalink
Enable tests and remove debug prints
Browse files Browse the repository at this point in the history
  • Loading branch information
MDrakos committed Aug 22, 2024
1 parent afab365 commit cf76af6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 24 deletions.
5 changes: 0 additions & 5 deletions pkg/buildplan/raw/walk.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package raw

import (
"fmt"

"github.com/go-openapi/strfmt"

"github.com/ActiveState/cli/internal/errs"
Expand Down Expand Up @@ -151,17 +149,14 @@ func (b *Build) walkNodeViaRuntimeDeps(node interface{}, parent *Artifact, visit
return nil
}

fmt.Println("Processing node:", ar.NodeID)
// If we detect a cycle we should stop
if visited[ar.NodeID] {
fmt.Println("Cycle detected, stopping")
return nil
}
visited[ar.NodeID] = true

// Only state tool artifacts are considered to be a runtime dependency
if IsStateToolMimeType(ar.MimeType) {
fmt.Println("Found state tool artifact")
if err := walk(ar, parent); err != nil {
return errs.Wrap(err, "error walking over runtime dep %+v", node)
}
Expand Down
38 changes: 19 additions & 19 deletions pkg/buildplan/raw/walk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,25 +126,25 @@ func TestRawBuild_walkNodesViaRuntimeDeps(t *testing.T) {
wantCalls []walkCall
wantErr bool
}{
// {
// "Runtime deps",
// buildWithRuntimeDeps.Terminals[0].NodeIDs,
// buildWithRuntimeDeps,
// []walkCall{
// {"00000000-0000-0000-0000-000000000002", "Artifact", ""},
// {"00000000-0000-0000-0000-000000000007", "Artifact", "00000000-0000-0000-0000-000000000002"},
// },
// false,
// },
// {
// "Runtime deps via src step",
// buildWithRuntimeDepsViaSrc.Terminals[0].NodeIDs,
// buildWithRuntimeDepsViaSrc,
// []walkCall{
// {"00000000-0000-0000-0000-000000000007", "Artifact", "00000000-0000-0000-0000-000000000002"},
// },
// false,
// },
{
"Runtime deps",
buildWithRuntimeDeps.Terminals[0].NodeIDs,
buildWithRuntimeDeps,
[]walkCall{
{"00000000-0000-0000-0000-000000000002", "Artifact", ""},
{"00000000-0000-0000-0000-000000000007", "Artifact", "00000000-0000-0000-0000-000000000002"},
},
false,
},
{
"Runtime deps via src step",
buildWithRuntimeDepsViaSrc.Terminals[0].NodeIDs,
buildWithRuntimeDepsViaSrc,
[]walkCall{
{"00000000-0000-0000-0000-000000000007", "Artifact", "00000000-0000-0000-0000-000000000002"},
},
false,
},
{
"Runtime deps with cycle",
buildWithRuntimeDepsViaSrcCycle.Terminals[0].NodeIDs,
Expand Down

0 comments on commit cf76af6

Please sign in to comment.