From 8b63d928aeb6ffc34c0d3a942858d110fa830c52 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Fri, 7 Jan 2022 10:09:17 +0100 Subject: [PATCH] test: Reorganize test/ folder into one subdirectory for each test type --- .github/workflows/ci.yaml | 2 +- nix/README.md | 2 +- nix/tools/loadtest.nix | 6 +++--- nix/tools/memory.nix | 2 +- nix/tools/tests.nix | 8 ++++---- nix/tools/withTools.nix | 2 +- postgrest.cabal | 6 +++--- test/{doctests => doc}/Main.hs | 0 test/{io-tests => io}/configs/aliases.config | 0 test/{io-tests => io}/configs/app-settings.config | 0 .../configs/base64-secret-from-file.config | 0 .../{io-tests => io}/configs/boolean-numeric.config | 0 test/{io-tests => io}/configs/boolean-string.config | 0 .../{io-tests => io}/configs/dburi-from-file.config | 0 test/{io-tests => io}/configs/defaults.config | 0 .../configs/expected/aliases.config | 0 .../configs/expected/boolean-numeric.config | 0 .../configs/expected/boolean-string.config | 0 .../configs/expected/defaults.config | 0 .../no-defaults-with-db-other-authenticator.config | 0 .../configs/expected/no-defaults-with-db.config | 0 .../configs/expected/no-defaults.config | 0 test/{io-tests => io}/configs/expected/types.config | 0 test/{io-tests => io}/configs/invalid.yaml | 0 test/{io-tests => io}/configs/no-defaults-env.yaml | 0 test/{io-tests => io}/configs/no-defaults.config | 0 test/{io-tests => io}/configs/role-claim-key.config | 0 .../configs/secret-from-file.config | 0 .../configs/sigusr2-settings-external-secret.config | 0 .../configs/sigusr2-settings.config | 0 test/{io-tests => io}/configs/simple.config | 0 test/{io-tests => io}/configs/types.config | 0 test/{io-tests => io}/db_config.sql | 0 test/{io-tests => io}/fixtures.sql | 0 test/{io-tests => io}/fixtures.yaml | 0 test/{io-tests => io}/secrets/ascii.b64 | 0 test/{io-tests => io}/secrets/ascii.jwt | 0 test/{io-tests => io}/secrets/ascii.noeol | 0 test/{io-tests => io}/secrets/ascii.txt | 0 test/{io-tests => io}/secrets/binary.b64 | 0 test/{io-tests => io}/secrets/binary.eol | 0 test/{io-tests => io}/secrets/binary.jwt | 0 test/{io-tests => io}/secrets/binary.noeol | 0 test/{io-tests => io}/secrets/utf8.b64 | 0 test/{io-tests => io}/secrets/utf8.jwt | 0 test/{io-tests => io}/secrets/utf8.noeol | 0 test/{io-tests => io}/secrets/utf8.txt | 0 test/{io-tests => io}/secrets/word.b64 | 0 test/{io-tests => io}/secrets/word.jwt | 0 test/{io-tests => io}/secrets/word.noeol | 0 test/{io-tests => io}/secrets/word.txt | 0 test/{io-tests => io}/test_io.py | 0 test/{loadtest => load}/fixtures.sql | 0 test/{loadtest => load}/patch.json | 0 test/{loadtest => load}/post.json | 0 test/{loadtest => load}/put.json | 0 test/{loadtest => load}/rpc.json | 0 test/{loadtest => load}/targets.http | 0 test/{ => memory}/memory-tests.sh | 0 test/{ => spec}/Feature/AndOrParamsSpec.hs | 0 test/{ => spec}/Feature/AsymmetricJwtSpec.hs | 0 test/{ => spec}/Feature/AudienceJwtSecretSpec.hs | 0 test/{ => spec}/Feature/AuthSpec.hs | 0 test/{ => spec}/Feature/BinaryJwtSecretSpec.hs | 0 test/{ => spec}/Feature/ConcurrentSpec.hs | 0 test/{ => spec}/Feature/CorsSpec.hs | 0 test/{ => spec}/Feature/DeleteSpec.hs | 0 test/{ => spec}/Feature/DisabledOpenApiSpec.hs | 0 test/{ => spec}/Feature/EmbedDisambiguationSpec.hs | 0 test/{ => spec}/Feature/EmbedInnerJoinSpec.hs | 0 test/{ => spec}/Feature/ExtraSearchPathSpec.hs | 0 test/{ => spec}/Feature/HtmlRawOutputSpec.hs | 0 test/{ => spec}/Feature/IgnorePrivOpenApiSpec.hs | 0 test/{ => spec}/Feature/InsertSpec.hs | 0 test/{ => spec}/Feature/JsonOperatorSpec.hs | 0 test/{ => spec}/Feature/LegacyGucsSpec.hs | 0 test/{ => spec}/Feature/MultipleSchemaSpec.hs | 0 test/{ => spec}/Feature/NoJwtSpec.hs | 0 test/{ => spec}/Feature/NonexistentSchemaSpec.hs | 0 test/{ => spec}/Feature/OpenApiSpec.hs | 0 test/{ => spec}/Feature/OptionsSpec.hs | 0 test/{ => spec}/Feature/ProxySpec.hs | 0 test/{ => spec}/Feature/QueryLimitedSpec.hs | 0 test/{ => spec}/Feature/QuerySpec.hs | 0 test/{ => spec}/Feature/RangeSpec.hs | 0 test/{ => spec}/Feature/RawOutputTypesSpec.hs | 0 test/{ => spec}/Feature/RollbackSpec.hs | 0 test/{ => spec}/Feature/RootSpec.hs | 0 test/{ => spec}/Feature/RpcPreRequestGucsSpec.hs | 0 test/{ => spec}/Feature/RpcSpec.hs | 6 +++--- test/{ => spec}/Feature/SingularSpec.hs | 0 test/{ => spec}/Feature/UnicodeSpec.hs | 0 test/{ => spec}/Feature/UpdateSpec.hs | 0 test/{ => spec}/Feature/UpsertSpec.hs | 0 test/{ => spec}/Main.hs | 0 test/{ => spec}/QueryCost.hs | 0 test/{ => spec}/SpecHelper.hs | 2 +- test/{ => spec}/TestTypes.hs | 0 test/{ => spec}/fixtures/data.sql | 0 test/{ => spec}/fixtures/database.sql | 0 test/{ => spec}/fixtures/draft04.json | 0 test/{C.png => spec/fixtures/image.png} | Bin test/{ => spec}/fixtures/jsonschema.sql | 0 test/{ => spec}/fixtures/jwt.sql | 0 test/{ => spec}/fixtures/load.sql | 0 test/{ => spec}/fixtures/openapi.json | 0 test/{ => spec}/fixtures/privileges.sql | 0 test/{ => spec}/fixtures/roles.sql | 0 test/{ => spec}/fixtures/schema.sql | 0 test/with_tmp_db | 2 +- 110 files changed, 19 insertions(+), 19 deletions(-) rename test/{doctests => doc}/Main.hs (100%) rename test/{io-tests => io}/configs/aliases.config (100%) rename test/{io-tests => io}/configs/app-settings.config (100%) rename test/{io-tests => io}/configs/base64-secret-from-file.config (100%) rename test/{io-tests => io}/configs/boolean-numeric.config (100%) rename test/{io-tests => io}/configs/boolean-string.config (100%) rename test/{io-tests => io}/configs/dburi-from-file.config (100%) rename test/{io-tests => io}/configs/defaults.config (100%) rename test/{io-tests => io}/configs/expected/aliases.config (100%) rename test/{io-tests => io}/configs/expected/boolean-numeric.config (100%) rename test/{io-tests => io}/configs/expected/boolean-string.config (100%) rename test/{io-tests => io}/configs/expected/defaults.config (100%) rename test/{io-tests => io}/configs/expected/no-defaults-with-db-other-authenticator.config (100%) rename test/{io-tests => io}/configs/expected/no-defaults-with-db.config (100%) rename test/{io-tests => io}/configs/expected/no-defaults.config (100%) rename test/{io-tests => io}/configs/expected/types.config (100%) rename test/{io-tests => io}/configs/invalid.yaml (100%) rename test/{io-tests => io}/configs/no-defaults-env.yaml (100%) rename test/{io-tests => io}/configs/no-defaults.config (100%) rename test/{io-tests => io}/configs/role-claim-key.config (100%) rename test/{io-tests => io}/configs/secret-from-file.config (100%) rename test/{io-tests => io}/configs/sigusr2-settings-external-secret.config (100%) rename test/{io-tests => io}/configs/sigusr2-settings.config (100%) rename test/{io-tests => io}/configs/simple.config (100%) rename test/{io-tests => io}/configs/types.config (100%) rename test/{io-tests => io}/db_config.sql (100%) rename test/{io-tests => io}/fixtures.sql (100%) rename test/{io-tests => io}/fixtures.yaml (100%) rename test/{io-tests => io}/secrets/ascii.b64 (100%) rename test/{io-tests => io}/secrets/ascii.jwt (100%) rename test/{io-tests => io}/secrets/ascii.noeol (100%) rename test/{io-tests => io}/secrets/ascii.txt (100%) rename test/{io-tests => io}/secrets/binary.b64 (100%) rename test/{io-tests => io}/secrets/binary.eol (100%) rename test/{io-tests => io}/secrets/binary.jwt (100%) rename test/{io-tests => io}/secrets/binary.noeol (100%) rename test/{io-tests => io}/secrets/utf8.b64 (100%) rename test/{io-tests => io}/secrets/utf8.jwt (100%) rename test/{io-tests => io}/secrets/utf8.noeol (100%) rename test/{io-tests => io}/secrets/utf8.txt (100%) rename test/{io-tests => io}/secrets/word.b64 (100%) rename test/{io-tests => io}/secrets/word.jwt (100%) rename test/{io-tests => io}/secrets/word.noeol (100%) rename test/{io-tests => io}/secrets/word.txt (100%) rename test/{io-tests => io}/test_io.py (100%) rename test/{loadtest => load}/fixtures.sql (100%) rename test/{loadtest => load}/patch.json (100%) rename test/{loadtest => load}/post.json (100%) rename test/{loadtest => load}/put.json (100%) rename test/{loadtest => load}/rpc.json (100%) rename test/{loadtest => load}/targets.http (100%) rename test/{ => memory}/memory-tests.sh (100%) rename test/{ => spec}/Feature/AndOrParamsSpec.hs (100%) rename test/{ => spec}/Feature/AsymmetricJwtSpec.hs (100%) rename test/{ => spec}/Feature/AudienceJwtSecretSpec.hs (100%) rename test/{ => spec}/Feature/AuthSpec.hs (100%) rename test/{ => spec}/Feature/BinaryJwtSecretSpec.hs (100%) rename test/{ => spec}/Feature/ConcurrentSpec.hs (100%) rename test/{ => spec}/Feature/CorsSpec.hs (100%) rename test/{ => spec}/Feature/DeleteSpec.hs (100%) rename test/{ => spec}/Feature/DisabledOpenApiSpec.hs (100%) rename test/{ => spec}/Feature/EmbedDisambiguationSpec.hs (100%) rename test/{ => spec}/Feature/EmbedInnerJoinSpec.hs (100%) rename test/{ => spec}/Feature/ExtraSearchPathSpec.hs (100%) rename test/{ => spec}/Feature/HtmlRawOutputSpec.hs (100%) rename test/{ => spec}/Feature/IgnorePrivOpenApiSpec.hs (100%) rename test/{ => spec}/Feature/InsertSpec.hs (100%) rename test/{ => spec}/Feature/JsonOperatorSpec.hs (100%) rename test/{ => spec}/Feature/LegacyGucsSpec.hs (100%) rename test/{ => spec}/Feature/MultipleSchemaSpec.hs (100%) rename test/{ => spec}/Feature/NoJwtSpec.hs (100%) rename test/{ => spec}/Feature/NonexistentSchemaSpec.hs (100%) rename test/{ => spec}/Feature/OpenApiSpec.hs (100%) rename test/{ => spec}/Feature/OptionsSpec.hs (100%) rename test/{ => spec}/Feature/ProxySpec.hs (100%) rename test/{ => spec}/Feature/QueryLimitedSpec.hs (100%) rename test/{ => spec}/Feature/QuerySpec.hs (100%) rename test/{ => spec}/Feature/RangeSpec.hs (100%) rename test/{ => spec}/Feature/RawOutputTypesSpec.hs (100%) rename test/{ => spec}/Feature/RollbackSpec.hs (100%) rename test/{ => spec}/Feature/RootSpec.hs (100%) rename test/{ => spec}/Feature/RpcPreRequestGucsSpec.hs (100%) rename test/{ => spec}/Feature/RpcSpec.hs (99%) rename test/{ => spec}/Feature/SingularSpec.hs (100%) rename test/{ => spec}/Feature/UnicodeSpec.hs (100%) rename test/{ => spec}/Feature/UpdateSpec.hs (100%) rename test/{ => spec}/Feature/UpsertSpec.hs (100%) rename test/{ => spec}/Main.hs (100%) rename test/{ => spec}/QueryCost.hs (100%) rename test/{ => spec}/SpecHelper.hs (99%) rename test/{ => spec}/TestTypes.hs (100%) rename test/{ => spec}/fixtures/data.sql (100%) rename test/{ => spec}/fixtures/database.sql (100%) rename test/{ => spec}/fixtures/draft04.json (100%) rename test/{C.png => spec/fixtures/image.png} (100%) rename test/{ => spec}/fixtures/jsonschema.sql (100%) rename test/{ => spec}/fixtures/jwt.sql (100%) rename test/{ => spec}/fixtures/load.sql (100%) rename test/{ => spec}/fixtures/openapi.json (100%) rename test/{ => spec}/fixtures/privileges.sql (100%) rename test/{ => spec}/fixtures/roles.sql (100%) rename test/{ => spec}/fixtures/schema.sql (100%) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c28e3eb1b..9eb5cd8bb 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -82,7 +82,7 @@ jobs: - name: Run IO tests if: always() - run: postgrest-with-postgresql-${{ matrix.pgVersion }} -f test/io-tests/fixtures.sql postgrest-test-io + run: postgrest-with-postgresql-${{ matrix.pgVersion }} -f test/io/fixtures.sql postgrest-test-io - name: Run query cost tests if: always() diff --git a/nix/README.md b/nix/README.md index 614ea04d4..0c44a7ad3 100644 --- a/nix/README.md +++ b/nix/README.md @@ -149,7 +149,7 @@ the PostgREST repo. Paths are resolved relative to the repo root: $ cd src # Even though the current directory is ./src, the config path must still start # from the repo root: -$ postgrest-run test/io-tests/configs/simple.conf +$ postgrest-run test/io/configs/simple.conf ``` ## Testing diff --git a/nix/tools/loadtest.nix b/nix/tools/loadtest.nix index a7e207809..c2c282b42 100644 --- a/nix/tools/loadtest.nix +++ b/nix/tools/loadtest.nix @@ -39,7 +39,7 @@ let docs = "Run the vegeta loadtests with PostgREST."; args = [ "ARG_OPTIONAL_SINGLE([output], [o], [Filename to dump json output to], [./loadtest/result.bin])" - "ARG_OPTIONAL_SINGLE([testdir], [t], [Directory to load tests and fixtures from], [./test/loadtest])" + "ARG_OPTIONAL_SINGLE([testdir], [t], [Directory to load tests and fixtures from], [./test/load])" "ARG_LEFTOVERS([additional vegeta arguments])" ]; inRootDir = true; @@ -97,7 +97,7 @@ let # Save the results in the current working tree, too, # otherwise they'd be lost in the temporary working tree # created by withTools.withGit. - ${withTools.withGit} "$_arg_target" ${loadtest} --output "$PWD/loadtest/$_arg_target.bin" --testdir "$PWD/test/loadtest" "''${_arg_leftovers[@]}" + ${withTools.withGit} "$_arg_target" ${loadtest} --output "$PWD/loadtest/$_arg_target.bin" --testdir "$PWD/test/load" "''${_arg_leftovers[@]}" cat << EOF @@ -111,7 +111,7 @@ let EOF - ${loadtest} --output "$PWD/loadtest/head.bin" --testdir "$PWD/test/loadtest" "''${_arg_leftovers[@]}" + ${loadtest} --output "$PWD/loadtest/head.bin" --testdir "$PWD/test/load" "''${_arg_leftovers[@]}" cat << EOF diff --git a/nix/tools/memory.nix b/nix/tools/memory.nix index dcf34483f..bdfa3c5da 100644 --- a/nix/tools/memory.nix +++ b/nix/tools/memory.nix @@ -17,7 +17,7 @@ let withPath = [ postgrestProfiled curl ]; } '' - ${withTools.withPg} test/memory-tests.sh + ${withTools.withPg} test/memory/memory-tests.sh ''; in diff --git a/nix/tools/tests.nix b/nix/tools/tests.nix index b54604c51..1a79402da 100644 --- a/nix/tools/tests.nix +++ b/nix/tools/tests.nix @@ -92,8 +92,8 @@ let } '' ${cabal-install}/bin/cabal v2-build ${devCabalOptions} - ${cabal-install}/bin/cabal v2-exec -- ${withTools.withPg} -f test/io-tests/fixtures.sql \ - ${ioTestPython}/bin/pytest -v test/io-tests "''${_arg_leftovers[@]}" + ${cabal-install}/bin/cabal v2-exec -- ${withTools.withPg} -f test/io/fixtures.sql \ + ${ioTestPython}/bin/pytest -v test/io "''${_arg_leftovers[@]}" ''; dumpSchema = @@ -137,8 +137,8 @@ let # collect all tests HPCTIXFILE="$tmpdir"/io.tix \ - ${withTools.withPg} -f test/io-tests/fixtures.sql ${cabal-install}/bin/cabal v2-exec ${devCabalOptions} -- \ - ${ioTestPython}/bin/pytest -v test/io-tests + ${withTools.withPg} -f test/io/fixtures.sql ${cabal-install}/bin/cabal v2-exec ${devCabalOptions} -- \ + ${ioTestPython}/bin/pytest -v test/io HPCTIXFILE="$tmpdir"/spec.tix \ ${withTools.withPg} ${cabal-install}/bin/cabal v2-run ${devCabalOptions} test:spec diff --git a/nix/tools/withTools.nix b/nix/tools/withTools.nix index 9473e76f7..4e281a377 100644 --- a/nix/tools/withTools.nix +++ b/nix/tools/withTools.nix @@ -19,7 +19,7 @@ let docs = "Run the given command in a temporary database with ${name}"; args = [ - "ARG_OPTIONAL_SINGLE([fixtures], [f], [SQL file to load fixtures from], [test/fixtures/load.sql])" + "ARG_OPTIONAL_SINGLE([fixtures], [f], [SQL file to load fixtures from], [test/spec/fixtures/load.sql])" "ARG_POSITIONAL_SINGLE([command], [Command to run])" "ARG_LEFTOVERS([command arguments])" "ARG_USE_ENV([PGUSER], [postgrest_test_authenticator], [Authenticator PG role])" diff --git a/postgrest.cabal b/postgrest.cabal index 4f19b0e7d..bd98d8199 100644 --- a/postgrest.cabal +++ b/postgrest.cabal @@ -160,7 +160,7 @@ test-suite spec default-extensions: OverloadedStrings QuasiQuotes NoImplicitPrelude - hs-source-dirs: test + hs-source-dirs: test/spec main-is: Main.hs other-modules: Feature.AndOrParamsSpec Feature.AsymmetricJwtSpec @@ -237,7 +237,7 @@ test-suite querycost default-extensions: OverloadedStrings QuasiQuotes NoImplicitPrelude - hs-source-dirs: test + hs-source-dirs: test/spec main-is: QueryCost.hs other-modules: SpecHelper build-depends: base >= 4.9 && < 4.16 @@ -271,7 +271,7 @@ test-suite doctests default-language: Haskell2010 default-extensions: OverloadedStrings NoImplicitPrelude - hs-source-dirs: test/doctests + hs-source-dirs: test/doc main-is: Main.hs build-depends: base >= 4.9 && < 4.16 , doctest >= 0.8 diff --git a/test/doctests/Main.hs b/test/doc/Main.hs similarity index 100% rename from test/doctests/Main.hs rename to test/doc/Main.hs diff --git a/test/io-tests/configs/aliases.config b/test/io/configs/aliases.config similarity index 100% rename from test/io-tests/configs/aliases.config rename to test/io/configs/aliases.config diff --git a/test/io-tests/configs/app-settings.config b/test/io/configs/app-settings.config similarity index 100% rename from test/io-tests/configs/app-settings.config rename to test/io/configs/app-settings.config diff --git a/test/io-tests/configs/base64-secret-from-file.config b/test/io/configs/base64-secret-from-file.config similarity index 100% rename from test/io-tests/configs/base64-secret-from-file.config rename to test/io/configs/base64-secret-from-file.config diff --git a/test/io-tests/configs/boolean-numeric.config b/test/io/configs/boolean-numeric.config similarity index 100% rename from test/io-tests/configs/boolean-numeric.config rename to test/io/configs/boolean-numeric.config diff --git a/test/io-tests/configs/boolean-string.config b/test/io/configs/boolean-string.config similarity index 100% rename from test/io-tests/configs/boolean-string.config rename to test/io/configs/boolean-string.config diff --git a/test/io-tests/configs/dburi-from-file.config b/test/io/configs/dburi-from-file.config similarity index 100% rename from test/io-tests/configs/dburi-from-file.config rename to test/io/configs/dburi-from-file.config diff --git a/test/io-tests/configs/defaults.config b/test/io/configs/defaults.config similarity index 100% rename from test/io-tests/configs/defaults.config rename to test/io/configs/defaults.config diff --git a/test/io-tests/configs/expected/aliases.config b/test/io/configs/expected/aliases.config similarity index 100% rename from test/io-tests/configs/expected/aliases.config rename to test/io/configs/expected/aliases.config diff --git a/test/io-tests/configs/expected/boolean-numeric.config b/test/io/configs/expected/boolean-numeric.config similarity index 100% rename from test/io-tests/configs/expected/boolean-numeric.config rename to test/io/configs/expected/boolean-numeric.config diff --git a/test/io-tests/configs/expected/boolean-string.config b/test/io/configs/expected/boolean-string.config similarity index 100% rename from test/io-tests/configs/expected/boolean-string.config rename to test/io/configs/expected/boolean-string.config diff --git a/test/io-tests/configs/expected/defaults.config b/test/io/configs/expected/defaults.config similarity index 100% rename from test/io-tests/configs/expected/defaults.config rename to test/io/configs/expected/defaults.config diff --git a/test/io-tests/configs/expected/no-defaults-with-db-other-authenticator.config b/test/io/configs/expected/no-defaults-with-db-other-authenticator.config similarity index 100% rename from test/io-tests/configs/expected/no-defaults-with-db-other-authenticator.config rename to test/io/configs/expected/no-defaults-with-db-other-authenticator.config diff --git a/test/io-tests/configs/expected/no-defaults-with-db.config b/test/io/configs/expected/no-defaults-with-db.config similarity index 100% rename from test/io-tests/configs/expected/no-defaults-with-db.config rename to test/io/configs/expected/no-defaults-with-db.config diff --git a/test/io-tests/configs/expected/no-defaults.config b/test/io/configs/expected/no-defaults.config similarity index 100% rename from test/io-tests/configs/expected/no-defaults.config rename to test/io/configs/expected/no-defaults.config diff --git a/test/io-tests/configs/expected/types.config b/test/io/configs/expected/types.config similarity index 100% rename from test/io-tests/configs/expected/types.config rename to test/io/configs/expected/types.config diff --git a/test/io-tests/configs/invalid.yaml b/test/io/configs/invalid.yaml similarity index 100% rename from test/io-tests/configs/invalid.yaml rename to test/io/configs/invalid.yaml diff --git a/test/io-tests/configs/no-defaults-env.yaml b/test/io/configs/no-defaults-env.yaml similarity index 100% rename from test/io-tests/configs/no-defaults-env.yaml rename to test/io/configs/no-defaults-env.yaml diff --git a/test/io-tests/configs/no-defaults.config b/test/io/configs/no-defaults.config similarity index 100% rename from test/io-tests/configs/no-defaults.config rename to test/io/configs/no-defaults.config diff --git a/test/io-tests/configs/role-claim-key.config b/test/io/configs/role-claim-key.config similarity index 100% rename from test/io-tests/configs/role-claim-key.config rename to test/io/configs/role-claim-key.config diff --git a/test/io-tests/configs/secret-from-file.config b/test/io/configs/secret-from-file.config similarity index 100% rename from test/io-tests/configs/secret-from-file.config rename to test/io/configs/secret-from-file.config diff --git a/test/io-tests/configs/sigusr2-settings-external-secret.config b/test/io/configs/sigusr2-settings-external-secret.config similarity index 100% rename from test/io-tests/configs/sigusr2-settings-external-secret.config rename to test/io/configs/sigusr2-settings-external-secret.config diff --git a/test/io-tests/configs/sigusr2-settings.config b/test/io/configs/sigusr2-settings.config similarity index 100% rename from test/io-tests/configs/sigusr2-settings.config rename to test/io/configs/sigusr2-settings.config diff --git a/test/io-tests/configs/simple.config b/test/io/configs/simple.config similarity index 100% rename from test/io-tests/configs/simple.config rename to test/io/configs/simple.config diff --git a/test/io-tests/configs/types.config b/test/io/configs/types.config similarity index 100% rename from test/io-tests/configs/types.config rename to test/io/configs/types.config diff --git a/test/io-tests/db_config.sql b/test/io/db_config.sql similarity index 100% rename from test/io-tests/db_config.sql rename to test/io/db_config.sql diff --git a/test/io-tests/fixtures.sql b/test/io/fixtures.sql similarity index 100% rename from test/io-tests/fixtures.sql rename to test/io/fixtures.sql diff --git a/test/io-tests/fixtures.yaml b/test/io/fixtures.yaml similarity index 100% rename from test/io-tests/fixtures.yaml rename to test/io/fixtures.yaml diff --git a/test/io-tests/secrets/ascii.b64 b/test/io/secrets/ascii.b64 similarity index 100% rename from test/io-tests/secrets/ascii.b64 rename to test/io/secrets/ascii.b64 diff --git a/test/io-tests/secrets/ascii.jwt b/test/io/secrets/ascii.jwt similarity index 100% rename from test/io-tests/secrets/ascii.jwt rename to test/io/secrets/ascii.jwt diff --git a/test/io-tests/secrets/ascii.noeol b/test/io/secrets/ascii.noeol similarity index 100% rename from test/io-tests/secrets/ascii.noeol rename to test/io/secrets/ascii.noeol diff --git a/test/io-tests/secrets/ascii.txt b/test/io/secrets/ascii.txt similarity index 100% rename from test/io-tests/secrets/ascii.txt rename to test/io/secrets/ascii.txt diff --git a/test/io-tests/secrets/binary.b64 b/test/io/secrets/binary.b64 similarity index 100% rename from test/io-tests/secrets/binary.b64 rename to test/io/secrets/binary.b64 diff --git a/test/io-tests/secrets/binary.eol b/test/io/secrets/binary.eol similarity index 100% rename from test/io-tests/secrets/binary.eol rename to test/io/secrets/binary.eol diff --git a/test/io-tests/secrets/binary.jwt b/test/io/secrets/binary.jwt similarity index 100% rename from test/io-tests/secrets/binary.jwt rename to test/io/secrets/binary.jwt diff --git a/test/io-tests/secrets/binary.noeol b/test/io/secrets/binary.noeol similarity index 100% rename from test/io-tests/secrets/binary.noeol rename to test/io/secrets/binary.noeol diff --git a/test/io-tests/secrets/utf8.b64 b/test/io/secrets/utf8.b64 similarity index 100% rename from test/io-tests/secrets/utf8.b64 rename to test/io/secrets/utf8.b64 diff --git a/test/io-tests/secrets/utf8.jwt b/test/io/secrets/utf8.jwt similarity index 100% rename from test/io-tests/secrets/utf8.jwt rename to test/io/secrets/utf8.jwt diff --git a/test/io-tests/secrets/utf8.noeol b/test/io/secrets/utf8.noeol similarity index 100% rename from test/io-tests/secrets/utf8.noeol rename to test/io/secrets/utf8.noeol diff --git a/test/io-tests/secrets/utf8.txt b/test/io/secrets/utf8.txt similarity index 100% rename from test/io-tests/secrets/utf8.txt rename to test/io/secrets/utf8.txt diff --git a/test/io-tests/secrets/word.b64 b/test/io/secrets/word.b64 similarity index 100% rename from test/io-tests/secrets/word.b64 rename to test/io/secrets/word.b64 diff --git a/test/io-tests/secrets/word.jwt b/test/io/secrets/word.jwt similarity index 100% rename from test/io-tests/secrets/word.jwt rename to test/io/secrets/word.jwt diff --git a/test/io-tests/secrets/word.noeol b/test/io/secrets/word.noeol similarity index 100% rename from test/io-tests/secrets/word.noeol rename to test/io/secrets/word.noeol diff --git a/test/io-tests/secrets/word.txt b/test/io/secrets/word.txt similarity index 100% rename from test/io-tests/secrets/word.txt rename to test/io/secrets/word.txt diff --git a/test/io-tests/test_io.py b/test/io/test_io.py similarity index 100% rename from test/io-tests/test_io.py rename to test/io/test_io.py diff --git a/test/loadtest/fixtures.sql b/test/load/fixtures.sql similarity index 100% rename from test/loadtest/fixtures.sql rename to test/load/fixtures.sql diff --git a/test/loadtest/patch.json b/test/load/patch.json similarity index 100% rename from test/loadtest/patch.json rename to test/load/patch.json diff --git a/test/loadtest/post.json b/test/load/post.json similarity index 100% rename from test/loadtest/post.json rename to test/load/post.json diff --git a/test/loadtest/put.json b/test/load/put.json similarity index 100% rename from test/loadtest/put.json rename to test/load/put.json diff --git a/test/loadtest/rpc.json b/test/load/rpc.json similarity index 100% rename from test/loadtest/rpc.json rename to test/load/rpc.json diff --git a/test/loadtest/targets.http b/test/load/targets.http similarity index 100% rename from test/loadtest/targets.http rename to test/load/targets.http diff --git a/test/memory-tests.sh b/test/memory/memory-tests.sh similarity index 100% rename from test/memory-tests.sh rename to test/memory/memory-tests.sh diff --git a/test/Feature/AndOrParamsSpec.hs b/test/spec/Feature/AndOrParamsSpec.hs similarity index 100% rename from test/Feature/AndOrParamsSpec.hs rename to test/spec/Feature/AndOrParamsSpec.hs diff --git a/test/Feature/AsymmetricJwtSpec.hs b/test/spec/Feature/AsymmetricJwtSpec.hs similarity index 100% rename from test/Feature/AsymmetricJwtSpec.hs rename to test/spec/Feature/AsymmetricJwtSpec.hs diff --git a/test/Feature/AudienceJwtSecretSpec.hs b/test/spec/Feature/AudienceJwtSecretSpec.hs similarity index 100% rename from test/Feature/AudienceJwtSecretSpec.hs rename to test/spec/Feature/AudienceJwtSecretSpec.hs diff --git a/test/Feature/AuthSpec.hs b/test/spec/Feature/AuthSpec.hs similarity index 100% rename from test/Feature/AuthSpec.hs rename to test/spec/Feature/AuthSpec.hs diff --git a/test/Feature/BinaryJwtSecretSpec.hs b/test/spec/Feature/BinaryJwtSecretSpec.hs similarity index 100% rename from test/Feature/BinaryJwtSecretSpec.hs rename to test/spec/Feature/BinaryJwtSecretSpec.hs diff --git a/test/Feature/ConcurrentSpec.hs b/test/spec/Feature/ConcurrentSpec.hs similarity index 100% rename from test/Feature/ConcurrentSpec.hs rename to test/spec/Feature/ConcurrentSpec.hs diff --git a/test/Feature/CorsSpec.hs b/test/spec/Feature/CorsSpec.hs similarity index 100% rename from test/Feature/CorsSpec.hs rename to test/spec/Feature/CorsSpec.hs diff --git a/test/Feature/DeleteSpec.hs b/test/spec/Feature/DeleteSpec.hs similarity index 100% rename from test/Feature/DeleteSpec.hs rename to test/spec/Feature/DeleteSpec.hs diff --git a/test/Feature/DisabledOpenApiSpec.hs b/test/spec/Feature/DisabledOpenApiSpec.hs similarity index 100% rename from test/Feature/DisabledOpenApiSpec.hs rename to test/spec/Feature/DisabledOpenApiSpec.hs diff --git a/test/Feature/EmbedDisambiguationSpec.hs b/test/spec/Feature/EmbedDisambiguationSpec.hs similarity index 100% rename from test/Feature/EmbedDisambiguationSpec.hs rename to test/spec/Feature/EmbedDisambiguationSpec.hs diff --git a/test/Feature/EmbedInnerJoinSpec.hs b/test/spec/Feature/EmbedInnerJoinSpec.hs similarity index 100% rename from test/Feature/EmbedInnerJoinSpec.hs rename to test/spec/Feature/EmbedInnerJoinSpec.hs diff --git a/test/Feature/ExtraSearchPathSpec.hs b/test/spec/Feature/ExtraSearchPathSpec.hs similarity index 100% rename from test/Feature/ExtraSearchPathSpec.hs rename to test/spec/Feature/ExtraSearchPathSpec.hs diff --git a/test/Feature/HtmlRawOutputSpec.hs b/test/spec/Feature/HtmlRawOutputSpec.hs similarity index 100% rename from test/Feature/HtmlRawOutputSpec.hs rename to test/spec/Feature/HtmlRawOutputSpec.hs diff --git a/test/Feature/IgnorePrivOpenApiSpec.hs b/test/spec/Feature/IgnorePrivOpenApiSpec.hs similarity index 100% rename from test/Feature/IgnorePrivOpenApiSpec.hs rename to test/spec/Feature/IgnorePrivOpenApiSpec.hs diff --git a/test/Feature/InsertSpec.hs b/test/spec/Feature/InsertSpec.hs similarity index 100% rename from test/Feature/InsertSpec.hs rename to test/spec/Feature/InsertSpec.hs diff --git a/test/Feature/JsonOperatorSpec.hs b/test/spec/Feature/JsonOperatorSpec.hs similarity index 100% rename from test/Feature/JsonOperatorSpec.hs rename to test/spec/Feature/JsonOperatorSpec.hs diff --git a/test/Feature/LegacyGucsSpec.hs b/test/spec/Feature/LegacyGucsSpec.hs similarity index 100% rename from test/Feature/LegacyGucsSpec.hs rename to test/spec/Feature/LegacyGucsSpec.hs diff --git a/test/Feature/MultipleSchemaSpec.hs b/test/spec/Feature/MultipleSchemaSpec.hs similarity index 100% rename from test/Feature/MultipleSchemaSpec.hs rename to test/spec/Feature/MultipleSchemaSpec.hs diff --git a/test/Feature/NoJwtSpec.hs b/test/spec/Feature/NoJwtSpec.hs similarity index 100% rename from test/Feature/NoJwtSpec.hs rename to test/spec/Feature/NoJwtSpec.hs diff --git a/test/Feature/NonexistentSchemaSpec.hs b/test/spec/Feature/NonexistentSchemaSpec.hs similarity index 100% rename from test/Feature/NonexistentSchemaSpec.hs rename to test/spec/Feature/NonexistentSchemaSpec.hs diff --git a/test/Feature/OpenApiSpec.hs b/test/spec/Feature/OpenApiSpec.hs similarity index 100% rename from test/Feature/OpenApiSpec.hs rename to test/spec/Feature/OpenApiSpec.hs diff --git a/test/Feature/OptionsSpec.hs b/test/spec/Feature/OptionsSpec.hs similarity index 100% rename from test/Feature/OptionsSpec.hs rename to test/spec/Feature/OptionsSpec.hs diff --git a/test/Feature/ProxySpec.hs b/test/spec/Feature/ProxySpec.hs similarity index 100% rename from test/Feature/ProxySpec.hs rename to test/spec/Feature/ProxySpec.hs diff --git a/test/Feature/QueryLimitedSpec.hs b/test/spec/Feature/QueryLimitedSpec.hs similarity index 100% rename from test/Feature/QueryLimitedSpec.hs rename to test/spec/Feature/QueryLimitedSpec.hs diff --git a/test/Feature/QuerySpec.hs b/test/spec/Feature/QuerySpec.hs similarity index 100% rename from test/Feature/QuerySpec.hs rename to test/spec/Feature/QuerySpec.hs diff --git a/test/Feature/RangeSpec.hs b/test/spec/Feature/RangeSpec.hs similarity index 100% rename from test/Feature/RangeSpec.hs rename to test/spec/Feature/RangeSpec.hs diff --git a/test/Feature/RawOutputTypesSpec.hs b/test/spec/Feature/RawOutputTypesSpec.hs similarity index 100% rename from test/Feature/RawOutputTypesSpec.hs rename to test/spec/Feature/RawOutputTypesSpec.hs diff --git a/test/Feature/RollbackSpec.hs b/test/spec/Feature/RollbackSpec.hs similarity index 100% rename from test/Feature/RollbackSpec.hs rename to test/spec/Feature/RollbackSpec.hs diff --git a/test/Feature/RootSpec.hs b/test/spec/Feature/RootSpec.hs similarity index 100% rename from test/Feature/RootSpec.hs rename to test/spec/Feature/RootSpec.hs diff --git a/test/Feature/RpcPreRequestGucsSpec.hs b/test/spec/Feature/RpcPreRequestGucsSpec.hs similarity index 100% rename from test/Feature/RpcPreRequestGucsSpec.hs rename to test/spec/Feature/RpcPreRequestGucsSpec.hs diff --git a/test/Feature/RpcSpec.hs b/test/spec/Feature/RpcSpec.hs similarity index 99% rename from test/Feature/RpcSpec.hs rename to test/spec/Feature/RpcSpec.hs index f14bbfc90..55e52e85d 100644 --- a/test/Feature/RpcSpec.hs +++ b/test/spec/Feature/RpcSpec.hs @@ -1155,7 +1155,7 @@ spec actualPgVersion = [str|unnamed text arg|] it "can insert bytea directly" $ do - let file = unsafePerformIO $ BL.readFile "test/C.png" + let file = unsafePerformIO $ BL.readFile "test/spec/fixtures/image.png" r <- request methodPost "/rpc/unnamed_bytea_param" [("Content-Type", "application/octet-stream"), ("Accept", "application/octet-stream")] file @@ -1189,7 +1189,7 @@ spec actualPgVersion = } it "will err when no function with single unnamed bytea parameter exists and application/octet-stream is specified" $ - let file = unsafePerformIO $ BL.readFile "test/C.png" in + let file = unsafePerformIO $ BL.readFile "test/spec/fixtures/image.png" in request methodPost "/rpc/unnamed_int_param" [("Content-Type", "application/octet-stream")] file @@ -1229,7 +1229,7 @@ spec actualPgVersion = [str|unnamed text arg|] `shouldRespondWith` [str|unnamed text arg|] - let file = unsafePerformIO $ BL.readFile "test/C.png" + let file = unsafePerformIO $ BL.readFile "test/spec/fixtures/image.png" r <- request methodPost "/rpc/overloaded_unnamed_param" [("Content-Type", "application/octet-stream"), ("Accept", "application/octet-stream")] file diff --git a/test/Feature/SingularSpec.hs b/test/spec/Feature/SingularSpec.hs similarity index 100% rename from test/Feature/SingularSpec.hs rename to test/spec/Feature/SingularSpec.hs diff --git a/test/Feature/UnicodeSpec.hs b/test/spec/Feature/UnicodeSpec.hs similarity index 100% rename from test/Feature/UnicodeSpec.hs rename to test/spec/Feature/UnicodeSpec.hs diff --git a/test/Feature/UpdateSpec.hs b/test/spec/Feature/UpdateSpec.hs similarity index 100% rename from test/Feature/UpdateSpec.hs rename to test/spec/Feature/UpdateSpec.hs diff --git a/test/Feature/UpsertSpec.hs b/test/spec/Feature/UpsertSpec.hs similarity index 100% rename from test/Feature/UpsertSpec.hs rename to test/spec/Feature/UpsertSpec.hs diff --git a/test/Main.hs b/test/spec/Main.hs similarity index 100% rename from test/Main.hs rename to test/spec/Main.hs diff --git a/test/QueryCost.hs b/test/spec/QueryCost.hs similarity index 100% rename from test/QueryCost.hs rename to test/spec/QueryCost.hs diff --git a/test/SpecHelper.hs b/test/spec/SpecHelper.hs similarity index 99% rename from test/SpecHelper.hs rename to test/spec/SpecHelper.hs index 304295748..8941d9a68 100644 --- a/test/SpecHelper.hs +++ b/test/spec/SpecHelper.hs @@ -55,7 +55,7 @@ validateOpenApiResponse headers = do respHeaders `shouldSatisfy` \hs -> ("Content-Type", "application/openapi+json; charset=utf-8") `elem` hs let Just body = decode (simpleBody r) - Just schema <- liftIO $ decode <$> BL.readFile "test/fixtures/openapi.json" + Just schema <- liftIO $ decode <$> BL.readFile "test/spec/fixtures/openapi.json" let args :: M.Map Text Value args = M.fromList [ ( "schema", schema ) diff --git a/test/TestTypes.hs b/test/spec/TestTypes.hs similarity index 100% rename from test/TestTypes.hs rename to test/spec/TestTypes.hs diff --git a/test/fixtures/data.sql b/test/spec/fixtures/data.sql similarity index 100% rename from test/fixtures/data.sql rename to test/spec/fixtures/data.sql diff --git a/test/fixtures/database.sql b/test/spec/fixtures/database.sql similarity index 100% rename from test/fixtures/database.sql rename to test/spec/fixtures/database.sql diff --git a/test/fixtures/draft04.json b/test/spec/fixtures/draft04.json similarity index 100% rename from test/fixtures/draft04.json rename to test/spec/fixtures/draft04.json diff --git a/test/C.png b/test/spec/fixtures/image.png similarity index 100% rename from test/C.png rename to test/spec/fixtures/image.png diff --git a/test/fixtures/jsonschema.sql b/test/spec/fixtures/jsonschema.sql similarity index 100% rename from test/fixtures/jsonschema.sql rename to test/spec/fixtures/jsonschema.sql diff --git a/test/fixtures/jwt.sql b/test/spec/fixtures/jwt.sql similarity index 100% rename from test/fixtures/jwt.sql rename to test/spec/fixtures/jwt.sql diff --git a/test/fixtures/load.sql b/test/spec/fixtures/load.sql similarity index 100% rename from test/fixtures/load.sql rename to test/spec/fixtures/load.sql diff --git a/test/fixtures/openapi.json b/test/spec/fixtures/openapi.json similarity index 100% rename from test/fixtures/openapi.json rename to test/spec/fixtures/openapi.json diff --git a/test/fixtures/privileges.sql b/test/spec/fixtures/privileges.sql similarity index 100% rename from test/fixtures/privileges.sql rename to test/spec/fixtures/privileges.sql diff --git a/test/fixtures/roles.sql b/test/spec/fixtures/roles.sql similarity index 100% rename from test/fixtures/roles.sql rename to test/spec/fixtures/roles.sql diff --git a/test/fixtures/schema.sql b/test/spec/fixtures/schema.sql similarity index 100% rename from test/fixtures/schema.sql rename to test/spec/fixtures/schema.sql diff --git a/test/with_tmp_db b/test/with_tmp_db index 478d5a19e..5808f2226 100755 --- a/test/with_tmp_db +++ b/test/with_tmp_db @@ -86,7 +86,7 @@ stop() { trap stop EXIT log "Loading fixtures..." -psql -v ON_ERROR_STOP=1 -f test/fixtures/load.sql >> "$setuplog" +psql -v ON_ERROR_STOP=1 -f test/spec/fixtures/load.sql >> "$setuplog" log "Done. Running command..." # Run the command that was given as an argument. The `exit` trap above will