A fork of attic a self-hostable Nix Binary Cache server
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

integration-tests/basic: Dump schema after test

Not doing anything with the dumped schema yet, but we will
have automated checks to ensure the schema isn't changed
in an incompatible way.

+25 -1
+25 -1
integration-tests/basic/default.nix
··· 29 29 ''; 30 30 31 31 databaseModules = { 32 - sqlite = {}; 32 + sqlite = { 33 + testScriptPost = '' 34 + from pathlib import Path 35 + import os 36 + 37 + schema = server.succeed("${pkgs.sqlite}/bin/sqlite3 /var/lib/atticd/server.db '.schema --indent'") 38 + 39 + schema_path = Path(os.environ.get("out", os.getcwd())) / "schema.sql" 40 + with open(schema_path, 'w') as f: 41 + f.write(schema) 42 + ''; 43 + }; 33 44 postgres = { 34 45 server = { 35 46 services.postgresql = { ··· 57 68 database.url = "postgresql:///attic?host=/run/postgresql"; 58 69 }; 59 70 }; 71 + testScriptPost = '' 72 + from pathlib import Path 73 + import os 74 + 75 + schema = server.succeed("pg_dump --schema-only attic") 76 + 77 + schema_path = Path(os.environ.get("out", os.getcwd())) / "schema.sql" 78 + with open(schema_path, 'w') as f: 79 + f.write(schema) 80 + ''; 60 81 }; 61 82 }; 62 83 ··· 229 250 client.succeed("attic cache destroy --no-confirm test") 230 251 client.fail("attic cache info test") 231 252 client.fail("curl -sL --fail-with-body http://server:8080/test/nix-cache-info") 253 + 254 + ${databaseModules.${config.database}.testScriptPost or ""} 255 + ${storageModules.${config.storage}.testScriptPost or ""} 232 256 ''; 233 257 }; 234 258 }