-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
postgresqlPackages.tsja: make passthru.tests work with correct package
Same reasoning as commit before.
- Loading branch information
1 parent
7a48f9e
commit 27b25e2
Showing
2 changed files
with
42 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,45 @@ | ||
import ./make-test-python.nix ({ pkgs, lib, ...} : { | ||
name = "tsja"; | ||
meta = { | ||
maintainers = with lib.maintainers; [ chayleaf ]; | ||
}; | ||
{ system ? builtins.currentSystem | ||
, config ? {} | ||
, pkgs ? import ../.. { inherit system config; } | ||
}: | ||
|
||
nodes = { | ||
master = | ||
{ config, ... }: | ||
let | ||
makeTsjaTest = postgresqlPackage: | ||
import ./make-test-python.nix ({ pkgs, lib, ...} : { | ||
name = "tsja-${postgresqlPackage.name}"; | ||
meta = { | ||
maintainers = with lib.maintainers; [ chayleaf ]; | ||
}; | ||
|
||
nodes = { | ||
master = | ||
{ config, ... }: | ||
|
||
{ | ||
services.postgresql = { | ||
enable = true; | ||
extraPlugins = ps: with ps; [ | ||
tsja | ||
]; | ||
}; | ||
{ | ||
services.postgresql = { | ||
enable = true; | ||
extraPlugins = ps: with ps; [ | ||
tsja | ||
]; | ||
}; | ||
}; | ||
}; | ||
}; | ||
|
||
testScript = '' | ||
start_all() | ||
master.wait_for_unit("postgresql") | ||
master.succeed("sudo -u postgres psql -f /run/current-system/sw/share/postgresql/extension/libtsja_dbinit.sql") | ||
# make sure "日本語" is parsed as a separate lexeme | ||
master.succeed(""" | ||
sudo -u postgres \\ | ||
psql -c "SELECT * FROM ts_debug('japanese', 'PostgreSQLで日本語のテキスト検索ができます。')" \\ | ||
| grep "{日本語}" | ||
""") | ||
''; | ||
}) | ||
testScript = '' | ||
start_all() | ||
master.wait_for_unit("postgresql") | ||
master.succeed("sudo -u postgres psql -f /run/current-system/sw/share/postgresql/extension/libtsja_dbinit.sql") | ||
# make sure "日本語" is parsed as a separate lexeme | ||
master.succeed(""" | ||
sudo -u postgres \\ | ||
psql -c "SELECT * FROM ts_debug('japanese', 'PostgreSQLで日本語のテキスト検索ができます。')" \\ | ||
| grep "{日本語}" | ||
""") | ||
''; | ||
}); | ||
in | ||
{ | ||
default = makeTsjaTest pkgs.postgresql; | ||
jit = makeTsjaTest pkgs.postgresql_jit; | ||
passthru.override = p: makeTsjaTest p; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters