Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/actions/test-record/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ runs:
continue-on-error: true
uses: QueryaHub/Querya-Desktop/.github/actions/test-extension@33c8853ea97f22ed0dc626dca7ca6320cc6b066a
with:
# "latest" is the newest stable Querya Desktop, whose tester (0.4.19)
# does not send the --connect password with system.injectCredentials,
# so a driver that reads its password from the injected secret cannot
# log in (ClickHouse: AUTHENTICATION_FAILED). 0.5.0-beta.1 has the fix;
# go back to "latest" once a stable release carries it.
querya-version: "0.5.0-beta.1"
extension-dir: ${{ steps.check.outputs.ext }}
target-version: ${{ inputs.host }}
connect: ${{ steps.check.outputs.connect }}
Expand Down
32 changes: 32 additions & 0 deletions extensions/queryahub.clickhouse-driver.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"id": "queryahub.clickhouse-driver",
"version": "1.0.3",
"platforms": {
"linux-x64": {
"downloadUrl": "https://github.com/QueryaHub/clickhouse-query-ext/releases/download/v1.0.3/clickhouse-query-ext-1.0.3-x86_64-unknown-linux-gnu.qext",
"sha256": "ca02db23d98633cd182d6bd5770f21b165523a2f0c4730c795fe1285932c6e83"
},
"macos-arm64": {
"downloadUrl": "https://github.com/QueryaHub/clickhouse-query-ext/releases/download/v1.0.3/clickhouse-query-ext-1.0.3-aarch64-apple-darwin.qext",
"sha256": "815e0cf9081ec7b4304f342660d58a1fc8fed1e69db9f784e7463a182fa0368f"
},
"macos-x64": {
"downloadUrl": "https://github.com/QueryaHub/clickhouse-query-ext/releases/download/v1.0.3/clickhouse-query-ext-1.0.3-x86_64-apple-darwin.qext",
"sha256": "dc86e5036cc87117214657de53eced1c35ad133da34b665bc8d4f5ad574b7eda"
},
"windows-x64": {
"downloadUrl": "https://github.com/QueryaHub/clickhouse-query-ext/releases/download/v1.0.3/clickhouse-query-ext-1.0.3-x86_64-pc-windows-msvc.qext",
"sha256": "706eafca617dfd0a0cee2cd988408c02fad7c53ace36e865064b980583a7cb9e"
}
},
"testEnv": {
"image": "ghcr.io/queryahub/querya-testdb-clickhouse:0.4.19",
"port": 8123,
"connect": {
"username": "querya",
"password": "querya"
},
"database": "querya",
"query": "SELECT count() FROM querya.customers"
}
}
8 changes: 8 additions & 0 deletions scripts/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,14 @@ def cmd_check(args):
if args.extract and testable is not None:
with zipfile.ZipFile(testable) as zf:
zf.extractall(args.extract)
# extractall drops the Unix mode, and the sandboxed test would run
# a driver binary that is no longer executable ("Permission
# denied"). Give back the execute bit the archive carries, nothing
# else (the entry names were validated above).
for info in zf.infolist():
if not info.is_dir() and (info.external_attr >> 16) & 0o111:
target = Path(args.extract) / info.filename
target.chmod(target.stat().st_mode | 0o755)
if not args.keep_archive:
for key in platforms:
if key not in local:
Expand Down
16 changes: 16 additions & 0 deletions tests/test_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,22 @@ def test_the_linux_build_is_what_gets_extracted_for_testing(self):
self.assertEqual(self.run_check(archives, self.record(archives), extract)[0], 0)
self.assertEqual((extract / "bin" / "driver").read_text(), "l")

def test_an_executable_binary_stays_executable_when_extracted(self):
path = self.dir / "linux-x64.zip"
with zipfile.ZipFile(path, "w") as zf:
zf.writestr("manifest.json", json.dumps(MANIFEST))
info = zipfile.ZipInfo("bin/driver")
info.external_attr = 0o100755 << 16
zf.writestr(info, "l")
plain = zipfile.ZipInfo("assets/note.txt")
plain.external_attr = 0o100644 << 16
zf.writestr(plain, "n")
archives = {"linux-x64": path}
extract = self.dir / "ext"
self.assertEqual(self.run_check(archives, self.record(archives), extract)[0], 0)
self.assertTrue((extract / "bin" / "driver").stat().st_mode & 0o111)
self.assertFalse((extract / "assets" / "note.txt").stat().st_mode & 0o111)

def test_no_linux_build_means_nothing_to_extract_or_test(self):
archives = {"macos-arm64": self.build("m")}
extract = self.dir / "ext"
Expand Down
Loading