Skip to content

Allow to feed smth into stdin of psql and safe_psql, enable node restart logging #29

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

Merged
merged 4 commits into from
Dec 14, 2017

Conversation

arssher
Copy link
Contributor

@arssher arssher commented Dec 7, 2017

  1. Feeding data into stdin allows to test e.g. COPY FROM, see https://github.com/postgrespro/pg_shardman/commit/0f3866d6e7db820622480fa62a3abc5e748e965d#diff-9c0147891760ab4b5aea57c1d48e4ec0R311 for example
  2. Is there a reason logging was disabled for pg_ctl restart?

@arssher arssher changed the title Allow to feed smth into stdin of psql and safe_psql, Enable node restart logging Allow to feed smth into stdin of psql and safe_psql, enable node restart logging Dec 7, 2017
@ildus
Copy link
Collaborator

ildus commented Dec 8, 2017

Please fix the tests.

node.restart() logging was previously broken: -l option was not supplied, so its
stdout/err wasn't redirected -- this is option of pg_ctl, not of postgres
itself, and pg_ctl didn't reused it. That was also the reason of 'write_to_pipe'
existence: if pg_ctl restart's stdout was fed to pipe, communicate() hanged,
reading stdout of postgres infinitely. Now we ride on 'start' routine for
restart and get the same behaviour, including logging.

'inp' param of safe_psql and psql was renamed to input for consistency (we don't
use here standard input() function quite often, right?), test for it was added.
@codecov-io
Copy link

codecov-io commented Dec 8, 2017

Codecov Report

Merging #29 into master will decrease coverage by 0.08%.
The diff coverage is 93.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #29      +/-   ##
==========================================
- Coverage   95.17%   95.08%   -0.09%     
==========================================
  Files           4        4              
  Lines         829      835       +6     
==========================================
+ Hits          789      794       +5     
- Misses         40       41       +1
Impacted Files Coverage Δ
tests/test_simple.py 99.01% <100%> (+0.01%) ⬆️
testgres/testgres.py 94.42% <90%> (-0.19%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1444759...f5732d1. Read the comment docs.

@funbringer funbringer merged commit f5732d1 into postgrespro:master Dec 14, 2017
@funbringer
Copy link
Collaborator

Merged, thx!

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

Successfully merging this pull request may close these issues.

4 participants