Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
otherview committed Dec 30, 2024
1 parent 99461db commit 8493c81
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions thorbuilder/thorbuilder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@ import (
)

func TestBuilder(t *testing.T) {
t.Run("Test Build Reusable", func(t *testing.T) {
branch := "master"
builder := New(branch, true)

// First download
err := builder.Download()
require.NoError(t, err)

// First build
thorBinaryPath, err := builder.Build()
require.NoError(t, err)

_, err = os.Stat(thorBinaryPath)
require.NoError(t, err)
assert.Equal(t, filepath.Join(builder.downloadPath, "bin", "thor"), thorBinaryPath)

// Second download should skip cloning
err = builder.Download()
require.NoError(t, err)

// Second build should skip building if the binary exists
thorBinaryPath, err = builder.Build()
require.NoError(t, err)
assert.Equal(t, filepath.Join(builder.downloadPath, "bin", "thor"), thorBinaryPath)
})
//t.Run("Test Build Reusable", func(t *testing.T) {
// branch := "master"
// builder := New(branch, true)
//
// // First download
// err := builder.Download()
// require.NoError(t, err)
//
// // First build
// thorBinaryPath, err := builder.Build()
// require.NoError(t, err)
//
// _, err = os.Stat(thorBinaryPath)
// require.NoError(t, err)
// assert.Equal(t, filepath.Join(builder.downloadPath, "bin", "thor"), thorBinaryPath)
//
// // Second download should skip cloning
// err = builder.Download()
// require.NoError(t, err)
//
// // Second build should skip building if the binary exists
// thorBinaryPath, err = builder.Build()
// require.NoError(t, err)
// assert.Equal(t, filepath.Join(builder.downloadPath, "bin", "thor"), thorBinaryPath)
//})

t.Run("Test Build Non-Reusable", func(t *testing.T) {
branch := "master"
Expand Down

0 comments on commit 8493c81

Please sign in to comment.