Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ def create_container_config(
'Hostname': hostname,
'Domainname': domainname,
'ExposedPorts': ports,
'User': user,
'User': six.text_type(user) if user else None,
'Tty': tty,
'OpenStdin': stdin_open,
'StdinOnce': stdin_once,
Expand Down
6 changes: 6 additions & 0 deletions tests/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1624,3 +1624,9 @@ def test_649(self):
ctnr = self.client.create_container('busybox', ['sleep', '2'])
self.client.start(ctnr)
self.client.stop(ctnr)

def test_715(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we give this test a more descriptive name? Also, we should assert that the container came out with the right uid.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's part of the TestRegressions class, which all simply reference the issue number they're testing for. But yeah, I'll add the test for the correctness of the user ID.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK... I'm not sure about that as a general thing. It places a rather unnecessary demand on people reading the code. Out of scope for this PR, but maybe we could rename them with descriptive names and include the URL to the GitHub issue in a docstring?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. My reasoning was that those tests won't be read unless there's an issue (regression) happening, in which case the person examining it will probably go to the original issue anyway. If you think there's value in renaming them that's fine too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also a fan of having a descriptive name and linking to the issue in the git commit

ctnr = self.client.create_container('busybox', ['id', '-u'], user=1000)
self.client.start(ctnr)
self.client.wait(ctnr)
assert self.client.logs(ctnr) == '1000\n'