Skip to content

Commit 7fc8f7c

Browse files
authored
[skip changelog] Libraries install dir path is now canonical (#1293)
* [skip changelog] Update go-paths-helper dependency * [skip changelog] Lib install dir path is now canonical This stems mainly from the fact the CI uses 8.3 naming convention for paths on Windows, that causes several issues when trying to verify that certain paths are printed in the output of certain commands. Making sure that canonical paths are set as installation directory for all libraries makes it easier to test. For more info on 8.3 paths see: https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#short-vs-long-names * [skip changelog] Fix esp8266 test * [skip changelog] Changed test paths to canonical
1 parent 382ebf1 commit 7fc8f7c

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

Diff for: arduino/libraries/loader.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func makeNewLibrary(libraryDir *paths.Path, location LibraryLocation) (*Library,
6767

6868
library := &Library{}
6969
library.Location = location
70-
library.InstallDir = libraryDir
70+
library.InstallDir = libraryDir.Canonical()
7171
if libraryDir.Join("src").Exist() {
7272
library.Layout = RecursiveLayout
7373
library.SourceDir = libraryDir.Join("src")
@@ -127,7 +127,7 @@ func makeNewLibrary(libraryDir *paths.Path, location LibraryLocation) (*Library,
127127

128128
func makeLegacyLibrary(path *paths.Path, location LibraryLocation) (*Library, error) {
129129
library := &Library{
130-
InstallDir: path,
130+
InstallDir: path.Canonical(),
131131
Location: location,
132132
SourceDir: path,
133133
Layout: FlatLayout,

Diff for: go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.14
44

55
require (
66
github.com/arduino/board-discovery v0.0.0-20180823133458-1ba29327fb0c
7-
github.com/arduino/go-paths-helper v1.4.0
7+
github.com/arduino/go-paths-helper v1.5.0
88
github.com/arduino/go-properties-orderedmap v1.3.0
99
github.com/arduino/go-timeutils v0.0.0-20171220113728-d1dd9e313b1b
1010
github.com/arduino/go-win32-utils v0.0.0-20180330194947-ed041402e83b

Diff for: go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ github.com/arduino/go-paths-helper v1.0.1/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3
1616
github.com/arduino/go-paths-helper v1.2.0/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck=
1717
github.com/arduino/go-paths-helper v1.4.0 h1:ilnseAdxmN1bFnLxxXHRtcdmt9jBf3O4jtYfWfqule4=
1818
github.com/arduino/go-paths-helper v1.4.0/go.mod h1:V82BWgAAp4IbmlybxQdk9Bpkz8M4Qyx+RAFKaG9NuvU=
19+
github.com/arduino/go-paths-helper v1.5.0 h1:RVo189hD+GhUS1rQ3gixwK1nSbvVR8MGIGa7Gxv2bdM=
20+
github.com/arduino/go-paths-helper v1.5.0/go.mod h1:V82BWgAAp4IbmlybxQdk9Bpkz8M4Qyx+RAFKaG9NuvU=
1921
github.com/arduino/go-properties-orderedmap v1.3.0 h1:4No/vQopB36e7WUIk6H6TxiSEJPiMrVOCZylYmua39o=
2022
github.com/arduino/go-properties-orderedmap v1.3.0/go.mod h1:DKjD2VXY/NZmlingh4lSFMEYCVubfeArCsGPGDwb2yk=
2123
github.com/arduino/go-timeutils v0.0.0-20171220113728-d1dd9e313b1b h1:9hDi4F2st6dbLC3y4i02zFT5quS4X6iioWifGlVwfy4=

Diff for: test/conftest.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ def data_dir(tmpdir_factory):
5555
# due to the above on Windows we cut the tmp path straight to /tmp/xxxxxxxx
5656
if platform.system() == "Windows":
5757
with tempfile.TemporaryDirectory() as tmp:
58-
yield tmp
58+
yield os.path.realpath(tmp)
5959
# We don't need to remove the directory since
6060
# tempfile.TemporaryDirectory deletes itself
6161
# automatically when exits its scope.
6262
else:
6363
data = tmpdir_factory.mktemp("ArduinoTest")
64-
yield str(data)
64+
yield os.path.realpath(data)
6565
shutil.rmtree(data, ignore_errors=True)
6666

6767

@@ -82,7 +82,7 @@ def downloads_dir(tmpdir_factory, worker_id):
8282
if not lock.is_file():
8383
lock.touch()
8484

85-
yield str(download_dir)
85+
yield os.path.realpath(download_dir)
8686
shutil.rmtree(download_dir, ignore_errors=True)
8787

8888

@@ -94,7 +94,7 @@ def working_dir(tmpdir_factory):
9494
at the end, this way all the tests work in isolation.
9595
"""
9696
work_dir = tmpdir_factory.mktemp("ArduinoTestWork")
97-
yield str(work_dir)
97+
yield os.path.realpath(work_dir)
9898
shutil.rmtree(work_dir, ignore_errors=True)
9999

100100

Diff for: test/test_compile.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ def test_compile_with_archives_and_long_paths(run_command):
581581
assert run_command("update")
582582

583583
# Install core to compile
584-
assert run_command("core install esp8266:esp8266")
584+
assert run_command("core install esp8266:esp8266@2.7.4")
585585

586586
# Install test library
587587
assert run_command("lib install ArduinoIoTCloud")

0 commit comments

Comments
 (0)