-
Notifications
You must be signed in to change notification settings - Fork 476
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
fast import: basic python test #10271
base: main
Are you sure you want to change the base?
Conversation
from fixtures.neon_fixtures import VanillaPostgres, PgProtocol, PgBin | ||
from fixtures.port_distributor import PortDistributor | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps makes sense to make this an extension to test_pgdata_import_smoke
, which has this comment currently:
# We have a Postgres data directory now.
# Make a localfs remote storage that looks like how after `fast_import` ran.
# TODO: actually exercise fast_import here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just thought that it might not worth doing it all in the same test due to increased complexity -> more complicated debugging if something is failing. Right now it is using vanilla postgres pgdata as we do in fast import, so it should be enough for testing pageserver part.
Moved mine simple test to the same file, but will keep test_pgdata_import_smoke
the same. Also added a todo to test full import flow separately, which will complement test_pgdata_import_smoke
and test_fast_import_binary
, but not complicate any of those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with John that extending test_pgdata_import_smoke
would be more valuable.
If I'm reading the TODO after your new test correctly, it would be completed by extending test_pgdata_import_smoke
with what you have in your new test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed in DM that I will keep test_pgdata_import_smoke
as is and add another one with s3 + pageserver + fast import binary, but if you don't mind I would do it in #10407 because it will anyway need something close
7359 tests run: 6977 passed, 0 failed, 382 skipped (full report)Flaky tests (6)Postgres 17
Postgres 16
Postgres 15
Postgres 14
Code coverage* (full report)
* collected from Rust tests only The comment gets automatically updated with the latest test results
fd09d31 at 2025-01-17T16:33:10.731Z :recycle: |
122e324
to
e856fae
Compare
73c14a7
to
ebe26e2
Compare
e856fae
to
a80dcfa
Compare
01e969b
to
047b986
Compare
compute_tools/src/bin/fast_import.rs
Outdated
let pg_port = if args.pg_port.is_some() { | ||
args.pg_port.unwrap() | ||
} else { | ||
info!("pg_port not specified, using default 5432"); | ||
5432 | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you can match instead and avoid the unwrap
let pg_port = match args.pg_port {
Some(port) => port,
None {
info!("...");
5432
}
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to a little shorter version with unwrap_or_else
if extra_env is None: | ||
env_vars = {} | ||
else: | ||
env_vars = extra_env.copy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: why is the copy
needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra_env
is passed as dict by reference, so it seems better to freeze it this way at the moment of initialization
basically copied from
neon/test_runner/fixtures/neon_cli.py
Lines 177 to 180 in fd09d31
if extra_env is None: | |
env_vars = {} | |
else: | |
env_vars = extra_env.copy() |
from fixtures.neon_fixtures import VanillaPostgres, PgProtocol, PgBin | ||
from fixtures.port_distributor import PortDistributor | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with John that extending test_pgdata_import_smoke
would be more valuable.
If I'm reading the TODO after your new test correctly, it would be completed by extending test_pgdata_import_smoke
with what you have in your new test.
We did not have any tests on fast_import binary yet.
In this PR I have introduced:
FastImport
class and tools for testing in pythonShould be merged after #10251