-
-
Notifications
You must be signed in to change notification settings - Fork 203
feat: multiple versions for the timescaledb-apache
extension
#1749
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
12e9433
chores: opted-out nix-fast-build
yvan-sraka dd833ab
chores: set up nix-github-actions
yvan-sraka a17d9af
chores: comment out vestigal testinfra-ami-build
yvan-sraka 6509b7c
chores: use custom github runners
yvan-sraka 7ddc794
feat: multiple versions for the timescaledb-apache extension
yvan-sraka b2fcade
feat: multiversion timescaledb
samrose 34b5f28
fix: refactor a bit to complete the extension
samrose 28659b0
test: remove older version of integration test
samrose 578af45
fix: make sure integration tests
samrose 638c0b4
test: revert to use test in nix/tests for timescale
samrose 7db6348
fix: integrtion tests
samrose 5466049
Move timescaledb nixos test to nix/ext/tests
jfroche f921941
chore: bump for test
samrose 90c5e4b
fix: need to also handle timescaledb-loader
samrose 7cce2c2
chore: bump version for fix
samrose 5cbce8f
fix: didn't need "loader"
samrose bdfc3e1
chore: bump version for testing
samrose c0e5f3f
fix: does need loader
samrose 33d6a4f
feat: switch both timescaledb and its loader when switching versions
jfroche eb7407a
chore: bump to test
samrose c7604f1
fix: must symlink to timescaledb.so on switch
samrose 24d7bc2
chore: bump for release
samrose File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{ self, pkgs }: | ||
let | ||
pname = "timescaledb"; | ||
inherit (pkgs) lib; | ||
installedExtension = | ||
postgresMajorVersion: self.packages.${pkgs.system}."psql_${postgresMajorVersion}/exts/${pname}-all"; | ||
versions = (installedExtension "15").versions; | ||
postgresqlWithExtension = | ||
postgresql: | ||
let | ||
majorVersion = lib.versions.major postgresql.version; | ||
pkg = pkgs.buildEnv { | ||
name = "postgresql-${majorVersion}-${pname}"; | ||
paths = [ | ||
postgresql | ||
postgresql.lib | ||
(installedExtension majorVersion) | ||
]; | ||
passthru = { | ||
inherit (postgresql) version psqlSchema; | ||
lib = pkg; | ||
withPackages = _: pkg; | ||
}; | ||
nativeBuildInputs = [ pkgs.makeWrapper ]; | ||
pathsToLink = [ | ||
"/" | ||
"/bin" | ||
"/lib" | ||
]; | ||
postBuild = '' | ||
wrapProgram $out/bin/postgres --set NIX_PGLIBDIR $out/lib | ||
wrapProgram $out/bin/pg_ctl --set NIX_PGLIBDIR $out/lib | ||
wrapProgram $out/bin/pg_upgrade --set NIX_PGLIBDIR $out/lib | ||
''; | ||
}; | ||
in | ||
pkg; | ||
psql_15 = postgresqlWithExtension self.packages.${pkgs.system}.postgresql_15; | ||
in | ||
self.inputs.nixpkgs.lib.nixos.runTest { | ||
name = "timescaledb"; | ||
hostPkgs = pkgs; | ||
nodes.server = | ||
{ ... }: | ||
{ | ||
services.postgresql = { | ||
enable = true; | ||
package = (postgresqlWithExtension psql_15); | ||
settings = { | ||
shared_preload_libraries = "timescaledb"; | ||
}; | ||
}; | ||
}; | ||
testScript = | ||
{ ... }: | ||
'' | ||
${builtins.readFile ./lib.py} | ||
|
||
start_all() | ||
|
||
server.wait_for_unit("multi-user.target") | ||
server.wait_for_unit("postgresql.service") | ||
|
||
versions = { | ||
"15": [${lib.concatStringsSep ", " (map (s: ''"${s}"'') versions)}], | ||
} | ||
extension_name = "${pname}" | ||
support_upgrade = True | ||
|
||
test = PostgresExtensionTest(server, extension_name, versions, support_upgrade) | ||
|
||
with subtest("Check upgrade path with postgresql 15"): | ||
test.check_upgrade_path("15") | ||
|
||
with subtest("Test switch_${pname}_version"): | ||
test.check_switch_extension_with_background_worker(Path("${psql_15}/lib/${pname}.so"), "15") | ||
''; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.