mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-14 17:02:56 +00:00
fixed an issue with the wrong path
This commit is contained in:
@@ -1 +1 @@
|
||||
{'repo_dir': PosixPath('/home/alek/Desktop/neonX/test_output/test_file_download[debug-pg14]/repo'), 'rust_log_override': None, 'port_distributor': <fixtures.neon_fixtures.PortDistributor object at 0x7faa9ed4a860>, 's3_mock_server': <fixtures.neon_fixtures.MockS3Server object at 0x7faa9ed4a920>, 'neon_cli': <fixtures.neon_fixtures.NeonCli object at 0x7faa9d2c3a30>, 'endpoints': <fixtures.neon_fixtures.EndpointFactory object at 0x7faa9d2c39a0>, 'safekeepers': [Safekeeper(env=<fixtures.neon_fixtures.NeonEnv object at 0x7faa9d2c3a00>, port=SafekeeperPort(pg=15004, http=15005), id=1, running=True), Safekeeper(env=<fixtures.neon_fixtures.NeonEnv object at 0x7faa9d2c3a00>, port=SafekeeperPort(pg=15006, http=15007), id=2, running=True), Safekeeper(env=<fixtures.neon_fixtures.NeonEnv object at 0x7faa9d2c3a00>, port=SafekeeperPort(pg=15008, http=15009), id=3, running=True)], 'broker': NeonBroker(logfile=PosixPath('/home/alek/Desktop/neonX/test_output/test_file_download[debug-pg14]/repo/storage_broker.log'), port=15001, neon_binpath=PosixPath('/home/alek/Desktop/neonX/target/debug'), handle=<Popen: returncode: None args: ['/home/alek/Desktop/neonX/target/debug/stora...>), 'remote_storage': S3Storage(bucket_name='test_file_download', bucket_region='us-east-1', access_key='test', secret_key='test', endpoint='http://127.0.0.1:15000', prefix_in_bucket=None), 'remote_storage_users': <RemoteStorageUsers.PAGESERVER: 1>, 'pg_version': '14', 'neon_binpath': PosixPath('/home/alek/Desktop/neonX/target/debug'), 'pg_distrib_dir': PosixPath('/home/alek/Desktop/neonX/pg_install'), 'endpoint_counter': 0, 'initial_tenant': `TenantId("15347163e7f9bb87079f0afbe58b2c5a"), 'initial_timeline': TimelineId("ac505335c89aa4e6c2e5b5660be3edd4"), 'pageserver': <fixtures.neon_fixtures.NeonPageserver object at 0x7faa9d2c38b0>}
|
||||
{'repo_dir': PosixPath('/home/alek/Desktop/neonX/test_output/test_file_download[debug-pg14]/repo'), 'rust_log_override': None, 'port_distributor': <fixtures.neon_fixtures.PortDistributor object at 0x7ff05375f070>, 's3_mock_server': <fixtures.neon_fixtures.MockS3Server object at 0x7ff05375f0a0>, 'neon_cli': <fixtures.neon_fixtures.NeonCli object at 0x7ff051cc3790>, 'endpoints': <fixtures.neon_fixtures.EndpointFactory object at 0x7ff051cc3760>, 'safekeepers': [Safekeeper(env=<fixtures.neon_fixtures.NeonEnv object at 0x7ff051cc3820>, port=SafekeeperPort(pg=15004, http=15005), id=1, running=True), Safekeeper(env=<fixtures.neon_fixtures.NeonEnv object at 0x7ff051cc3820>, port=SafekeeperPort(pg=15006, http=15007), id=2, running=True), Safekeeper(env=<fixtures.neon_fixtures.NeonEnv object at 0x7ff051cc3820>, port=SafekeeperPort(pg=15008, http=15009), id=3, running=True)], 'broker': NeonBroker(logfile=PosixPath('/home/alek/Desktop/neonX/test_output/test_file_download[debug-pg14]/repo/storage_broker.log'), port=15001, neon_binpath=PosixPath('/home/alek/Desktop/neonX/target/debug'), handle=<Popen: returncode: None args: ['/home/alek/Desktop/neonX/target/debug/stora...>), 'remote_storage': S3Storage(bucket_name='test_file_download', bucket_region='us-east-1', access_key='test', secret_key='test', endpoint='http://127.0.0.1:15000', prefix_in_bucket=None), 'remote_storage_users': <RemoteStorageUsers.PAGESERVER: 1>, 'pg_version': '14', 'neon_binpath': PosixPath('/home/alek/Desktop/neonX/target/debug'), 'pg_distrib_dir': PosixPath('/home/alek/Desktop/neonX/pg_install'), 'endpoint_counter': 0, 'initial_tenant': `TenantId("a44445be5a0a92eba8f870768ca18ae8"), 'initial_timeline': TimelineId("704923c28b34c445b3b4e2b75f468d00"), 'pageserver': <fixtures.neon_fixtures.NeonPageserver object at 0x7ff051cc3670>}
|
||||
@@ -1,5 +1,5 @@
|
||||
# mock extension
|
||||
comment = 'Mock extension'
|
||||
comment = 'This is a mock extension'
|
||||
default_version = '1.0'
|
||||
module_pathname = '$libdir/test_ext'
|
||||
relocatable = true
|
||||
|
||||
@@ -1 +1 @@
|
||||
[('neon_utils', '1.0', None, 'neon_utils - small useful functions'), ('pg_buffercache', '1.3', None, 'examine the shared buffer cache'), ('pageinspect', '1.9', None, 'inspect the contents of database pages at a low level'), ('neon', '1.0', None, 'cloud storage for PostgreSQL'), ('test_load', '1.0', None, 'Mock extension'), ('plpgsql', '1.0', '1.0', 'PL/pgSQL procedural language'), ('neon_test_utils', '1.0', None, 'helpers for neon testing and debugging'), ('pg_prewarm', '1.2', None, 'prewarm relation data'), ('hnsw', '0.1.0', None, 'hNsw index')]
|
||||
['neon_utils', 'pg_buffercache', 'pageinspect', 'neon', 'test_load', 'plpgsql', 'test_ext', 'neon_test_utils', 'pg_prewarm', 'hnsw']
|
||||
@@ -694,7 +694,7 @@ fn handle_endpoint(ep_match: &ArgMatches, env: &local_env::LocalEnv) -> Result<(
|
||||
.copied()
|
||||
.unwrap_or(false);
|
||||
|
||||
// TODO maybe this is the place
|
||||
// TODO alek maybe this is the place to pass args
|
||||
if let Some(endpoint) = endpoint {
|
||||
match (&endpoint.mode, hot_standby) {
|
||||
(ComputeMode::Static(_), true) => {
|
||||
|
||||
@@ -26,6 +26,7 @@ from fixtures.utils import wait_until
|
||||
from prometheus_client.samples import Sample
|
||||
|
||||
import json
|
||||
import requests
|
||||
|
||||
|
||||
def test_file_download(neon_env_builder: NeonEnvBuilder):
|
||||
@@ -57,9 +58,12 @@ def test_file_download(neon_env_builder: NeonEnvBuilder):
|
||||
resp = neon_env_builder.remote_storage_client.get_object(
|
||||
Bucket=neon_env_builder.remote_storage.bucket_name, Key=TEST_EXT_PATH
|
||||
)
|
||||
# UPDATE: this is the wrong place to install it
|
||||
response = resp["Body"]
|
||||
with open("pg_install/v15/lib/test_ext.control", "wb") as f:
|
||||
f.write(response.read())
|
||||
for pgres_version in ("v15", "v14"):
|
||||
fname = f"pg_install/{pgres_version}/share/postgresql/extension/test_ext.control"
|
||||
with open(fname, "wb") as f:
|
||||
f.write(response.read())
|
||||
|
||||
tenant, _ = env.neon_cli.create_tenant()
|
||||
env.neon_cli.create_timeline("test_file_download", tenant_id=tenant)
|
||||
@@ -75,21 +79,28 @@ def test_file_download(neon_env_builder: NeonEnvBuilder):
|
||||
endpoint = env.endpoints.create_start(
|
||||
"test_file_download", tenant_id=tenant, remote_ext_config=remote_ext_config
|
||||
)
|
||||
|
||||
# step 5 attempt 2
|
||||
# TODO: I'm not even remotely confident this is the correct port
|
||||
# response = requests.post("http://localhost:15000/extension_server/postgis-3.so")
|
||||
# print(response)
|
||||
|
||||
with closing(endpoint.connect()) as conn:
|
||||
with conn.cursor() as cur:
|
||||
# test query: insert some values and select them
|
||||
cur.execute("CREATE TABLE t(key int primary key, value text)")
|
||||
for i in range(100):
|
||||
cur.execute(f"insert into t values({i}, {2*i})")
|
||||
cur.execute("select * from t")
|
||||
x = cur.fetchall()
|
||||
log.info(x)
|
||||
log.info(cur.fetchall())
|
||||
|
||||
# TODO: we should see the test_ext extension here
|
||||
# the real test query: check that test_ext is present
|
||||
cur.execute("SELECT * FROM pg_available_extensions")
|
||||
x = cur.fetchall()
|
||||
all_extensions = [x[0] for x in cur.fetchall()]
|
||||
with open("alek/win.txt", "w") as f:
|
||||
f.write(str(x))
|
||||
log.info(x)
|
||||
f.write(str(all_extensions))
|
||||
log.info(all_extensions)
|
||||
assert "test_ext" in all_extensions
|
||||
|
||||
endpoint.stop()
|
||||
env.pageserver.http_client().tenant_detach(tenant)
|
||||
|
||||
Reference in New Issue
Block a user