*** bochecha has quit IRC | 00:08 | |
*** valentind has joined #buildstream | 08:17 | |
*** bochecha has joined #buildstream | 09:09 | |
*** bethw has joined #buildstream | 09:30 | |
*** tiago has quit IRC | 09:42 | |
*** tiago has joined #buildstream | 09:46 | |
*** noisecell has joined #buildstream | 09:56 | |
*** ssam2 has joined #buildstream | 10:17 | |
*** tiagogomes has joined #buildstream | 10:59 | |
*** tiago has quit IRC | 10:59 | |
*** valentind has quit IRC | 12:22 | |
*** bethw has quit IRC | 13:10 | |
*** ssam2 has quit IRC | 13:46 | |
*** mcatanzaro has joined #buildstream | 13:57 | |
*** bethw has joined #buildstream | 14:05 | |
*** bethw has quit IRC | 14:08 | |
*** noah has joined #buildstream | 14:10 | |
*** ssam2 has joined #buildstream | 14:19 | |
*** noah has quit IRC | 14:21 | |
*** bethw has joined #buildstream | 15:06 | |
*** semanticdesign_ has joined #buildstream | 15:08 | |
*** bethw has quit IRC | 15:10 | |
*** bethw has joined #buildstream | 15:46 | |
*** bethw has quit IRC | 16:12 | |
*** noisecell has quit IRC | 16:50 | |
* tlater can't get pytest to capture stdout to read command output | 17:02 | |
ssam2 | you're using pytest to run a command ? | 17:04 |
---|---|---|
tlater | Yes, part of switching to integration tests | 17:05 |
ssam2 | why not use subprocess.check_call() ? | 17:07 |
tlater | I'd like to integrate with the testutils we currently have | 17:08 |
ssam2 | hmm, i guess then you only get the output at the end | 17:08 |
tlater | Main problem is that we switched over to using pytest internals | 17:08 |
ssam2 | that makes sense; but as far as I know those don't involve using pytest to call external programs ? or do they ? | 17:08 |
tlater | They use click to call buildstream | 17:08 |
ssam2 | ah, right | 17:09 |
tlater | Which then can be used to call `bst shell` | 17:09 |
ssam2 | so the issue is not with pytest, but with click.testing.CliRunner ? | 17:09 |
tlater | I'm not sure at this point | 17:09 |
ssam2 | ok | 17:09 |
tlater | Because we individually capture stdout/stderr produced by that | 17:09 |
tlater | Because it in turn doesn't support splitting those | 17:09 |
ssam2 | yeah | 17:09 |
tlater | Somehow the stdout gets lost, while stderr is preserved | 17:10 |
tlater | And pytest itself still finds the stdout that our wrapper should find | 17:10 |
ssam2 | ugh | 17:10 |
ssam2 | could be to do with pytest's stdout capturing | 17:10 |
ssam2 | try with `py.test --capture=no` ? | 17:10 |
ssam2 | that's not really a solution, but it if that works, we know what the problem is caused by ... | 17:11 |
tlater | Doesn't seem to be it | 17:11 |
tlater | Still the same symptoms | 17:12 |
ssam2 | ok | 17:12 |
ssam2 | i am suspicious of CliRunner to be honest, it looks pretty hacky | 17:12 |
* tlater is a bit lost, has even looked through the pytest source code for this and can't find anything that would look like it does this | 17:13 | |
tlater | It's possible that the CliRunner stuff redirects everything to and captures stdout or something, I suppose | 17:13 |
tlater | Hm, I wonder how Cli.get_element_config works then, it should need stdout | 17:15 |
*** bethw has joined #buildstream | 17:31 | |
*** bethw has quit IRC | 17:34 | |
*** tiagogomes has quit IRC | 17:52 | |
* tlater is very confused, the output seems to be correctly redirected in pytest for `bst show`, but not for `bst shell` | 17:54 | |
ssam2 | could be to do with forking | 17:55 |
ssam2 | CliRunner itself doesn't fork a new process, it hacks up the actual test process into running the click main entry point | 17:56 |
ssam2 | after modifying sys.stdout and sys.stderr so it can capture them | 17:56 |
ssam2 | but that presumably doesn't modify the processes actual file descriptors | 17:56 |
ssam2 | so if the main process forks off a bwrap instance, i guess it won't capture the output of that | 17:57 |
tlater | Yeah, we'd probably end up with a new sys.stdout | 17:57 |
ssam2 | well, for bwrap there's no such thing as sys.stdout | 17:57 |
ssam2 | just fd #2 | 17:57 |
tlater | On the other hand, why does pytest still capture that output then? | 17:57 |
ssam2 | perhaps it overrides the actual file descriptors | 17:57 |
tlater | We are using the same code for that now | 17:58 |
ssam2 | i don't understand what you mean by that | 17:58 |
tlater | We import the pytest internals to capture stdout/stderr separately | 17:59 |
tlater | Which means that we *also* override the actual file descriptors if pytest does so | 17:59 |
ssam2 | ah, i see | 18:00 |
ssam2 | i don't know then | 18:00 |
tlater | Eugh, this will take some more debugging tomorrow then, I guess :| | 18:01 |
tlater | ta for bouncing back ideas though, ssam2 :) | 18:01 |
*** mcatanzaro has quit IRC | 18:32 | |
*** ssam2 has quit IRC | 19:01 | |
*** valentind has joined #buildstream | 19:12 | |
gitlab-br-bot | buildstream: merge request (master->master: WIP: Documentation improvements) #183 changed state ("opened"): https://gitlab.com/BuildStream/buildstream/merge_requests/183 | 19:15 |
*** mcatanzaro has joined #buildstream | 20:50 | |
*** mcatanzaro has quit IRC | 21:13 | |
*** valentind has quit IRC | 23:07 |
Generated by irclog2html.py 2.15.3 by Marius Gedminas - find it at mg.pov.lt!