From b48824bddd7db6973dc32dbba262eae3478a9f10 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Wed, 3 Oct 2018 11:16:42 -0500 Subject: [PATCH] Fix #1065, correct test for pg10 Also add pg10 testing job on CircleCI --- .circleci/config.yml | 52 +++++++++++++++++++++++++++++---- test/Feature/AndOrParamsSpec.hs | 2 +- 2 files changed, 47 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 41817bafb..c84370bba 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -52,7 +52,7 @@ build-distro-bin: &build-distro-bin key: v1-{{ .Environment.CIRCLE_JOB }}-dependencies-{{ checksum "postgrest.cabal" }}-{{ checksum "stack.yaml" }} jobs: - build-test: + build-test-9.4: docker: - image: circleci/buildpack-deps:trusty environment: @@ -138,6 +138,38 @@ jobs: name: run tests command: POSTGREST_TEST_CONNECTION=$(test/create_test_db "postgres://circleci@localhost" postgrest_test) stack test + build-test-10: + docker: + - image: circleci/buildpack-deps:trusty + environment: + - PGHOST=localhost + - image: circleci/postgres:10.5 + environment: + - POSTGRES_USER=circleci + - POSTGRES_DB=circleci + steps: + - checkout + - restore_cache: + keys: + - v1-stack-dependencies-{{ checksum "postgrest.cabal" }}-{{ checksum "stack.yaml" }} + - run: + name: install stack & dependencies + command: | + curl -L https://github.com/commercialhaskell/stack/releases/download/v1.1.2/stack-1.1.2-linux-x86_64.tar.gz | tar zx -C /tmp + sudo mv /tmp/stack-1.1.2-linux-x86_64/stack /usr/bin + sudo apt-get update + sudo apt-get install -y libgmp-dev + sudo apt-get install -y postgresql-client + stack setup + - run: + name: build src and tests + command: | + stack build --fast -j1 + stack build --fast --test --no-run-tests + - run: + name: run tests + command: POSTGREST_TEST_CONNECTION=$(test/create_test_db "postgres://circleci@localhost" postgrest_test) stack test + build-prof-test: docker: - image: circleci/buildpack-deps:trusty @@ -224,7 +256,7 @@ workflows: version: 2 build-test-release: jobs: - - build-test: + - build-test-9.4: filters: tags: only: /v[0-9]+(\.[0-9]+)*/ @@ -232,14 +264,19 @@ workflows: filters: tags: only: /v[0-9]+(\.[0-9]+)*/ + - build-test-10: + filters: + tags: + only: /v[0-9]+(\.[0-9]+)*/ - build-prof-test: filters: tags: only: /v[0-9]+(\.[0-9]+)*/ - centos6: requires: - - build-test + - build-test-9.4 - build-test-9.6 + - build-test-10 - build-prof-test filters: tags: @@ -248,8 +285,9 @@ workflows: ignore: /.*/ - centos7: requires: - - build-test + - build-test-9.4 - build-test-9.6 + - build-test-10 - build-prof-test filters: tags: @@ -258,8 +296,9 @@ workflows: ignore: /.*/ - ubuntu: requires: - - build-test + - build-test-9.4 - build-test-9.6 + - build-test-10 - build-prof-test filters: tags: @@ -268,8 +307,9 @@ workflows: ignore: /.*/ - ubuntui386: requires: - - build-test + - build-test-9.4 - build-test-9.6 + - build-test-10 - build-prof-test filters: tags: diff --git a/test/Feature/AndOrParamsSpec.hs b/test/Feature/AndOrParamsSpec.hs index 8869eb7b2..c3092942e 100644 --- a/test/Feature/AndOrParamsSpec.hs +++ b/test/Feature/AndOrParamsSpec.hs @@ -167,7 +167,7 @@ spec = context "used with POST" $ it "includes related data with filters" $ - request methodPost "/child_entities?entities.or=(id.eq.2,id.eq.3)&select=id,entities(id)" + request methodPost "/child_entities?select=id,entities(id)&entities.or=(id.eq.2,id.eq.3)&entities.order=id" [("Prefer", "return=representation")] [json|[{"id":4,"name":"entity 4","parent_id":1}, {"id":5,"name":"entity 5","parent_id":2},