tests: relax check_proj_consistency url checks on windows
The test_import_project*() cases in test_project.py are failing on windows for reasons that are irrelevant and ultimately down to path comparisons not being canonicalized for that platform. Rather than fix tests I don't really think are broken, check if the expected URL is an actual directory and fall back on PurePath comparisons instead. Keep the behavior the same for macOS and Linux. Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
parent
a0f390ab23
commit
1a9721b062
|
@ -3,7 +3,7 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from pathlib import PurePath
|
from pathlib import Path, PurePath
|
||||||
import platform
|
import platform
|
||||||
import shlex
|
import shlex
|
||||||
import shutil
|
import shutil
|
||||||
|
@ -41,6 +41,8 @@ manifest:
|
||||||
|
|
||||||
WEST_SKIP_SLOW_TESTS = bool(int(os.environ.get('WEST_SKIP_SLOW_TESTS', 1)))
|
WEST_SKIP_SLOW_TESTS = bool(int(os.environ.get('WEST_SKIP_SLOW_TESTS', 1)))
|
||||||
|
|
||||||
|
WINDOWS = (platform.system() == 'Windows')
|
||||||
|
|
||||||
#
|
#
|
||||||
# Test fixtures
|
# Test fixtures
|
||||||
#
|
#
|
||||||
|
@ -226,7 +228,7 @@ def cmd(cmd, cwd=None, stderr=None, env=None):
|
||||||
# a python subprocess so that program-level setup and teardown
|
# a python subprocess so that program-level setup and teardown
|
||||||
# happen fresh.
|
# happen fresh.
|
||||||
cmd = 'west ' + cmd
|
cmd = 'west ' + cmd
|
||||||
if platform.system() != 'Windows':
|
if not WINDOWS:
|
||||||
cmd = shlex.split(cmd)
|
cmd = shlex.split(cmd)
|
||||||
print('running:', cmd)
|
print('running:', cmd)
|
||||||
if env:
|
if env:
|
||||||
|
@ -369,7 +371,9 @@ def check_proj_consistency(actual, expected):
|
||||||
assert a_abs == e_abs
|
assert a_abs == e_abs
|
||||||
assert a_psx == e_psx
|
assert a_psx == e_psx
|
||||||
|
|
||||||
assert actual.url == expected.url
|
assert (actual.url == expected.url or
|
||||||
|
(WINDOWS and Path(expected.url).is_dir() and
|
||||||
|
(PurePath(actual.url) == PurePath(expected.url))))
|
||||||
assert actual.clone_depth == expected.clone_depth
|
assert actual.clone_depth == expected.clone_depth
|
||||||
assert actual.revision == expected.revision
|
assert actual.revision == expected.revision
|
||||||
assert actual.west_commands == expected.west_commands
|
assert actual.west_commands == expected.west_commands
|
||||||
|
|
Loading…
Reference in New Issue