From a4d236b02fa1b1a13a8828f0a1c9db8b768c90ad Mon Sep 17 00:00:00 2001 From: Alek Westover Date: Wed, 21 Jun 2023 11:00:36 -0400 Subject: [PATCH] finishing cleanup debugging --- test_runner/fixtures/neon_fixtures.py | 10 ++------- .../regress/test_download_extensions.py | 22 +++++++++---------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/test_runner/fixtures/neon_fixtures.py b/test_runner/fixtures/neon_fixtures.py index 7becacb0c5..b985f9b7f3 100644 --- a/test_runner/fixtures/neon_fixtures.py +++ b/test_runner/fixtures/neon_fixtures.py @@ -673,8 +673,8 @@ class NeonEnvBuilder: assert force_enable or self.remote_storage is None, "remote storage is enabled already" self.remote_storage = LocalFsStorage(Path(self.repo_dir / "local_fs_remote_storage")) - # TODO: presumably we need a new method... - # because we are not the pageserver... + # TODO: do we need a new method here? for remote_ext_config because we are not the pageserver? + # or is it ok to re-use the s3 bucket? def enable_mock_s3_remote_storage(self, bucket_name: str, force_enable: bool = True): """ Sets up the pageserver to use the S3 mock server, creates the bucket, if it's not present already. @@ -981,8 +981,6 @@ class NeonEnv: safekeeper = Safekeeper(env=self, id=id, port=port) self.safekeepers.append(safekeeper) - # TODO: alek, for reference, this is where neon_cli is init'd. I don't think I need to modify this. - # if you do, maybe do a toml+= extension config type of thing. log.info(f"Config: {toml}") self.neon_cli.init(toml) @@ -1177,7 +1175,6 @@ class AbstractNeonCli(abc.ABC): If `check_return_code`, on non-zero exit code logs failure and raises. """ - log.warn("reached rawcli") assert type(arguments) == list assert type(self.COMMAND) == str @@ -1482,10 +1479,7 @@ class NeonCli(AbstractNeonCli): if hot_standby: args.extend(["--hot-standby", "true"]) if remote_ext_config is not None: - # TODO: I worry that this is not properly escaped... args.extend(["--remote-ext-config", remote_ext_config]) - log.info(args) - log.warning("ALEK") res = self.raw_cli(args) res.check_returncode() diff --git a/test_runner/regress/test_download_extensions.py b/test_runner/regress/test_download_extensions.py index 7bed15f037..04a44c1308 100644 --- a/test_runner/regress/test_download_extensions.py +++ b/test_runner/regress/test_download_extensions.py @@ -30,7 +30,17 @@ import requests def test_file_download(neon_env_builder: NeonEnvBuilder): - """Tests we can download a file""" + """ + Tests we can download a file + First we set up the mock s3 bucket by uploading test_ext.control to the bucket + Then, we download test_ext.control from the bucket to pg_install/v15/share/postgresql/extension/ + Finally, we list available extensions and assert that test_ext is present + + Right now we are downloading the file in python + However, we have all the argument passing set up so that when an endpoint starts + it knows about the bucket and can list_files in the bucket. This is written to ALEK_LIST_FILES.txt + A good next step is to get rust to downlaod the public_extensions control files to the correct place + """ neon_env_builder.enable_remote_storage( remote_storage_kind=RemoteStorageKind.MOCK_S3, test_name="test_file_download", @@ -55,7 +65,6 @@ 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"] for pgres_version in ("v15", "v14"): fname = f"pg_install/{pgres_version}/share/postgresql/extension/test_ext.control" @@ -77,15 +86,6 @@ 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") - # log.info("*\n" * 100) - # log.info("IMPORTANT") - # log.info(str(env.neon_cli.__dict__["env"].__dict__)) - # log.info(response.content.decode("utf-8")) - with closing(endpoint.connect()) as conn: with conn.cursor() as cur: # test query: insert some values and select them