Skip to content

Commit 2b8d57c

Browse files
committed
test: sort the environment for remote-run
With Python 3, there have been some sorting inconsistencies. Always sort the items to allow for the lit test to reliably match the output.
1 parent d3b5996 commit 2b8d57c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

test/remote-run/env.test-sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ RUN: env REMOTE_RUN_CHILD_FOO=foo REMOTE_RUN_CHILD_BAR=bar %debug-remote-run -v
55

66
CHECK: {{^:foo: :bar:$}}
77

8-
VERBOSE: /usr/bin/env FOO=foo BAR=bar sh -c echo ":${FOO}:" ":${BAR}:"
8+
VERBOSE: /usr/bin/env BAR=bar FOO=foo sh -c echo ":${FOO}:" ":${BAR}:"

utils/remote-run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class CommandRunner(object):
6868
self.run_sftp(sftp_commands)
6969

7070
def run_remote(self, command, remote_env={}):
71-
env_strings = ['{0}={1}'.format(k,v) for k,v in remote_env.items()]
71+
env_strings = ['{0}={1}'.format(k,v) for k,v in sorted(remote_env.items())]
7272
remote_invocation = self.remote_invocation(
7373
['/usr/bin/env'] + env_strings + command)
7474
remote_proc = self.popen(remote_invocation, stdin=subprocess.PIPE,

0 commit comments

Comments
 (0)