Skip to content

Commit c794aaa

Browse files
committed
FEATURE-ci-v3-integration: canonicalize aliased shell fixture roots
1 parent 8d074d6 commit c794aaa

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

‎scripts/test-v3-installed-consumer.py‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class InstalledShellTest(unittest.TestCase):
2828
def setUp(self):
2929
self.temp = tempfile.TemporaryDirectory()
3030
self.addCleanup(self.temp.cleanup)
31-
self.root = Path(self.temp.name)
31+
self.root = Path(self.temp.name).resolve()
3232
self.selected = self.root / 'MSYS tools'
3333
self.selected.mkdir()
3434
self.bash = self.selected / ('bash.exe' if os.name == 'nt' else 'bash')
@@ -96,9 +96,17 @@ def test_windows_missing_path_bash_fails_before_launching_competing_shell(self):
9696

9797
@unittest.skipIf(os.name == 'nt', 'ps observation uses POSIX process groups; Windows exercises native jobs')
9898
class InstalledShellPSTest(InstalledShellTest):
99-
"""Replay the shell contracts through real ps observation on POSIX hosts."""
99+
"""Replay shell contracts with a temporary path alias and real ps observation."""
100100
def setUp(self):
101-
super().setUp()
101+
outer = tempfile.TemporaryDirectory()
102+
self.addCleanup(outer.cleanup)
103+
root = Path(outer.name).resolve()
104+
real = root / 'real'
105+
real.mkdir()
106+
alias = root / 'alias'
107+
alias.symlink_to(real, target_is_directory=True)
108+
with patch.object(tempfile, 'tempdir', str(alias)):
109+
super().setUp()
102110
observation = patch.object(commands.sys, 'platform', 'darwin')
103111
observation.start()
104112
self.addCleanup(observation.stop)

0 commit comments

Comments
 (0)