Skip to content

Commit 4c33bf8

Browse files
committed
[skip changelog] Fix sketch tests on Windows
1 parent b9f4d31 commit 4c33bf8

File tree

2 files changed

+19
-27
lines changed

2 files changed

+19
-27
lines changed

Diff for: go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
113113
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
114114
github.com/imjasonmiller/godice v0.1.2 h1:T1/sW/HoDzFeuwzOOuQjmeMELz9CzZ53I2CnD+08zD4=
115115
github.com/imjasonmiller/godice v0.1.2/go.mod h1:8cTkdnVI+NglU2d6sv+ilYcNaJ5VSTBwvMbFULJd/QQ=
116+
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
116117
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
117118
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
118119
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
@@ -135,6 +136,7 @@ github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd h1:Coekwdh0v
135136
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
136137
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
137138
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
139+
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
138140
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
139141
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
140142
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=

Diff for: test/test_sketch.py

+17-27
Original file line numberDiff line numberDiff line change
@@ -12,54 +12,44 @@
1212
# otherwise use the software for commercial activities involving the Arduino
1313
# software without disclosing the source code of your own applications. To purchase
1414
# a commercial license, send an email to [email protected].
15-
import os
16-
import platform
1715
import zipfile
1816
from pathlib import Path
1917

20-
import pytest
2118

22-
from test.common import running_on_ci
23-
24-
25-
@pytest.mark.skipif(
26-
running_on_ci() and platform.system() == "Windows",
27-
reason="Test disabled on Github Actions Win VM until tmpdir inconsistent behavior bug is fixed",
28-
)
2919
def test_sketch_new(run_command, working_dir):
3020
# Create a test sketch in current directory
3121
current_path = working_dir
3222
sketch_name = "SketchNewIntegrationTest"
33-
current_sketch_path = os.path.join(current_path, sketch_name)
34-
result = run_command("sketch new {}".format(sketch_name))
23+
current_sketch_path = Path(current_path, sketch_name)
24+
result = run_command(f"sketch new {sketch_name}")
3525
assert result.ok
36-
assert "Sketch created in: {}".format(current_sketch_path) in result.stdout
37-
assert os.path.isfile(os.path.join(current_sketch_path, sketch_name + ".ino"))
26+
assert f"Sketch created in: {current_sketch_path}" in result.stdout
27+
assert Path(current_sketch_path, f"{sketch_name}.ino").is_file()
3828

3929
# Create a test sketch in current directory but using an absolute path
4030
sketch_name = "SketchNewIntegrationTestAbsolute"
41-
current_sketch_path = os.path.join(current_path, sketch_name)
42-
result = run_command("sketch new {}".format(current_sketch_path))
31+
current_sketch_path = Path(current_path, sketch_name)
32+
result = run_command(f'sketch new "{current_sketch_path}"')
4333
assert result.ok
44-
assert "Sketch created in: {}".format(current_sketch_path) in result.stdout
45-
assert os.path.isfile(os.path.join(current_sketch_path, sketch_name + ".ino"))
34+
assert f"Sketch created in: {current_sketch_path}" in result.stdout
35+
assert Path(current_sketch_path, f"{sketch_name}.ino").is_file()
4636

4737
# Create a test sketch in current directory subpath but using an absolute path
4838
sketch_name = "SketchNewIntegrationTestSubpath"
49-
sketch_subpath = os.path.join("subpath", sketch_name)
50-
current_sketch_path = os.path.join(current_path, sketch_subpath)
51-
result = run_command("sketch new {}".format(sketch_subpath))
39+
sketch_subpath = Path("subpath", sketch_name)
40+
current_sketch_path = Path(current_path, sketch_subpath)
41+
result = run_command(f"sketch new {sketch_subpath}")
5242
assert result.ok
53-
assert "Sketch created in: {}".format(current_sketch_path) in result.stdout
54-
assert os.path.isfile(os.path.join(current_sketch_path, sketch_name + ".ino"))
43+
assert f"Sketch created in: {current_sketch_path}" in result.stdout
44+
assert Path(current_sketch_path, f"{sketch_name}.ino").is_file()
5545

5646
# Create a test sketch in current directory using .ino extension
5747
sketch_name = "SketchNewIntegrationTestDotIno"
58-
current_sketch_path = os.path.join(current_path, sketch_name)
59-
result = run_command("sketch new {}".format(sketch_name + ".ino"))
48+
current_sketch_path = Path(current_path, sketch_name)
49+
result = run_command(f"sketch new {sketch_name}.ino")
6050
assert result.ok
61-
assert "Sketch created in: {}".format(current_sketch_path) in result.stdout
62-
assert os.path.isfile(os.path.join(current_sketch_path, sketch_name + ".ino"))
51+
assert f"Sketch created in: {current_sketch_path}" in result.stdout
52+
assert Path(current_sketch_path, f"{sketch_name}.ino").is_file()
6353

6454

6555
def verify_zip_contains_sketch_excluding_build_dir(files):

0 commit comments

Comments
 (0)