Skip to content

Commit 0f41d1e

Browse files
Migrated TestOutputFlagDefaultPath from test_compile_part_1.py to compile_part_1_test.go
1 parent 1b0148c commit 0f41d1e

File tree

2 files changed

+28
-24
lines changed

2 files changed

+28
-24
lines changed

internal/integrationtest/compile/compile_part_1_test.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,31 @@ func TestCompileWithSimpleSketch(t *testing.T) {
143143
require.NoFileExists(t, sketchBuildDir.Join(sketchName+".ino.with_bootloader.bin").String())
144144
require.NoFileExists(t, sketchBuildDir.Join(sketchName+".ino.with_bootloader.hex").String())
145145
}
146+
147+
func TestOutputFlagDefaultPath(t *testing.T) {
148+
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
149+
defer env.CleanUp()
150+
151+
// Init the environment explicitly
152+
_, _, err := cli.Run("core", "update-index")
153+
require.NoError(t, err)
154+
155+
// Install Arduino AVR Boards
156+
_, _, err = cli.Run("core", "install", "arduino:avr@1.8.3")
157+
require.NoError(t, err)
158+
159+
// Create a test sketch
160+
sketchPath := cli.SketchbookDir().Join("test_output_flag_default_path")
161+
fqbn := "arduino:avr:uno"
162+
_, _, err = cli.Run("sketch", "new", sketchPath.String())
163+
require.NoError(t, err)
164+
165+
// Test the --output-dir flag defaulting to current working dir
166+
workingDir, err := paths.Getwd()
167+
require.NoError(t, err)
168+
target := workingDir.Join("test")
169+
defer target.RemoveAll()
170+
_, _, err = cli.Run("compile", "-b", fqbn, sketchPath.String(), "--output-dir", "test")
171+
require.NoError(t, err)
172+
require.DirExists(t, target.String())
173+
}

test/test_compile_part_1.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,6 @@
2525
from .common import running_on_ci
2626

2727

28-
@pytest.mark.skipif(
29-
running_on_ci() and platform.system() == "Windows",
30-
reason="Test disabled on Github Actions Win VM until tmpdir inconsistent behavior bug is fixed",
31-
)
32-
def test_output_flag_default_path(run_command, data_dir, working_dir):
33-
# Init the environment explicitly
34-
run_command(["core", "update-index"])
35-
36-
# Install Arduino AVR Boards
37-
run_command(["core", "install", "arduino:avr@1.8.3"])
38-
39-
# Create a test sketch
40-
sketch_path = os.path.join(data_dir, "test_output_flag_default_path")
41-
fqbn = "arduino:avr:uno"
42-
result = run_command(["sketch", "new", sketch_path])
43-
assert result.ok
44-
45-
# Test the --output-dir flag defaulting to current working dir
46-
result = run_command(["compile", "-b", fqbn, sketch_path, "--output-dir", "test"])
47-
assert result.ok
48-
target = os.path.join(working_dir, "test")
49-
assert os.path.exists(target) and os.path.isdir(target)
50-
51-
5228
def test_compile_with_sketch_with_symlink_selfloop(run_command, data_dir):
5329
# Init the environment explicitly
5430
run_command(["core", "update-index"])

0 commit comments

Comments
 (0)