Skip to content

Commit

Permalink
Merge pull request #3540 from ActiveState/DX-3103
Browse files Browse the repository at this point in the history
Fix export buildplan
  • Loading branch information
MDrakos authored Oct 15, 2024
2 parents 4436e4d + 5522e48 commit eabb513
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions internal/runners/export/buildplan.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ func (b *BuildPlan) Run(params *BuildPlanParams) (rerr error) {
return errs.Wrap(err, "Could not get commit")
}

bytes, err := commit.BuildScript().MarshalBuildExpression()
bytes, err := commit.BuildPlan().Marshal()
if err != nil {
return errs.Wrap(err, "Could not marshal build expression")
return errs.Wrap(err, "Could not marshal build plan")
}
expr := make(map[string]interface{})
err = json.Unmarshal(bytes, &expr)
if err != nil {
return errs.Wrap(err, "Could not unmarshal build expression")
return errs.Wrap(err, "Could not unmarshal build plan")
}

out.Print(output.Prepare(string(bytes), expr))
Expand Down
8 changes: 3 additions & 5 deletions test/integration/export_int_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,8 @@ func (suite *ExportIntegrationTestSuite) TestExport_BuildPlan() {
cp := ts.Spawn("export", "buildplan")
cp.Expect("Resolving Dependencies")
cp.Expect(`{`)
cp.Expect(`"let":`)
cp.Expect(`"in":`)
cp.Expect(`"runtime":`)
cp.Expect(`"sources":`)
cp.Expect(`"buildPlanID":`)
cp.Expect(`"terminals":`)
cp.Expect(`}`)
cp.ExpectExitCode(0)
}
Expand Down Expand Up @@ -198,7 +196,7 @@ func (suite *ExportIntegrationTestSuite) TestJSON() {
cp.Expect(`{"`)
cp.Expect(`}`)
cp.ExpectExitCode(0)
AssertValidJSON(suite.T(), cp)
// The buildplan is too large for the snapshot to contain valid JSON.
}

func TestExportIntegrationTestSuite(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.46.0-RC2
0.46.0-RC2

0 comments on commit eabb513

Please sign in to comment.