Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loading subunit stream from stdin with stestr load is broken #109

Closed
mtreinish opened this issue Oct 5, 2017 · 1 comment · Fixed by #110
Closed

loading subunit stream from stdin with stestr load is broken #109

mtreinish opened this issue Oct 5, 2017 · 1 comment · Fixed by #110
Assignees
Labels

Comments

@mtreinish
Copy link
Owner

Loading a subunit stream from stdin is not working for stestr load. A simple example to reproduce this is to run::

stestr last --subunit | stestr load

Which will yield this traceback:

Traceback (most recent call last):
File "/home/mtreinish/.venv2/bin/stestr", line 10, in
sys.exit(main())
File "/home/mtreinish/git/stestr/stestr/cli.py", line 102, in main
sys.exit(args[0].func(args))
File "/home/mtreinish/git/stestr/stestr/commands/load.py", line 75, in run
abbreviate=args.abbreviate)
File "/home/mtreinish/git/stestr/stestr/commands/load.py", line 128, in load
streams = [sys.stdin.buffer]
AttributeError: 'file' object has no attribute 'buffer'

We should fix this and add a unit and/or functional test checking that load from stdin works

@mtreinish mtreinish added the bug label Oct 5, 2017
@mtreinish
Copy link
Owner Author

Looks like we just need to drop the .buffer on L128 in stestr/commands/load.py

@mtreinish mtreinish self-assigned this Oct 5, 2017
mtreinish added a commit that referenced this issue Oct 5, 2017
This commit fixes a bug in stestr load when passing in a subunit stream
from stdin. It was previously trying to read the stream form the stdin
buffer, but that doesn't always (and in most cases) exist. It turns out
there was no need to do this, so this commit just fixes that by using
the stdin object itself.

Fixes #109
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant