Skip to content

Commit 1125e53

Browse files
committed
Remove TestWipeoutBuildPathIfBuildOptionsChangedBuildOptionsMatch test
Build options json is not the optimal way to discover if something has changed in the build. Commit 19751fe#diff-f796a16acff0c78b88ffe6618745edc6R67 enforces the check and also wipes if the core has changed "in place". Wiping more often gives better confidence that the actual compliation results reflect the backing storage situation.
1 parent 4591ba3 commit 1125e53

File tree

1 file changed

+4
-34
lines changed

1 file changed

+4
-34
lines changed

src/arduino.cc/builder/test/wipeout_build_path_if_build_options_changed_test.go

+4-34
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@
3030
package test
3131

3232
import (
33+
"os"
34+
"path/filepath"
35+
"testing"
36+
3337
"arduino.cc/builder"
3438
"arduino.cc/builder/gohasissues"
3539
"arduino.cc/builder/types"
3640
"arduino.cc/builder/utils"
3741
"github.com/stretchr/testify/require"
38-
"os"
39-
"path/filepath"
40-
"testing"
4142
)
4243

4344
func TestWipeoutBuildPathIfBuildOptionsChanged(t *testing.T) {
@@ -100,34 +101,3 @@ func TestWipeoutBuildPathIfBuildOptionsChangedNoPreviousBuildOptions(t *testing.
100101
_, err = os.Stat(filepath.Join(buildPath, "should_not_be_deleted.txt"))
101102
NoError(t, err)
102103
}
103-
104-
func TestWipeoutBuildPathIfBuildOptionsChangedBuildOptionsMatch(t *testing.T) {
105-
ctx := &types.Context{}
106-
107-
buildPath := SetupBuildPath(t, ctx)
108-
defer os.RemoveAll(buildPath)
109-
110-
ctx.BuildOptionsJsonPrevious = "{ \"old\":\"old\" }"
111-
ctx.BuildOptionsJson = "{ \"old\":\"old\" }"
112-
113-
utils.TouchFile(filepath.Join(buildPath, "should_not_be_deleted.txt"))
114-
115-
commands := []types.Command{
116-
&builder.WipeoutBuildPathIfBuildOptionsChanged{},
117-
}
118-
119-
for _, command := range commands {
120-
err := command.Run(ctx)
121-
NoError(t, err)
122-
}
123-
124-
_, err := os.Stat(buildPath)
125-
NoError(t, err)
126-
127-
files, err := gohasissues.ReadDir(buildPath)
128-
NoError(t, err)
129-
require.Equal(t, 1, len(files))
130-
131-
_, err = os.Stat(filepath.Join(buildPath, "should_not_be_deleted.txt"))
132-
NoError(t, err)
133-
}

0 commit comments

Comments
 (0)