Files
omnivore/docker-compose-test.yml
Hongbo Wu ae0d1dd2ee Feature/search highlights backend (#395)
* add highlight mappings

* return highlight in resolvers

* temporarily skip highlight tests

* add test for getting highlights

* update merge highlight

* separate elastic methods

* roll back merge highlight test

* add highlight to elastic script

* update delete highlight in elastic

* migrate highlight data from postgres to elastic

* rescue not found exception when page is not found in the migration script

* exclude highlights in searching pages results

* search pages with highlights only with has:highlight query

* add search endpoint to search pages or highlights

* reduce code smell in search api

* fix rebase error

* fix tests

* add test for search highlight

* add test for new search endpoint

* add labels to search results

* update schema

* update search query

* fix update/share highlights

* fix rebase error

* fix tests

* add highlight model in elastic

* add savedAt and publishedAt date range in search query

* add sort by updated and recently read

* fix tests

* close db connection when tests are done

* test github action

* revert github action test

* fix rebase error

* add docker-compose for api-test

* remove unused env

* remove highlights with no page attached to

* allow get_articles resolver to search for query so we can merge it without web changes
2022-04-12 12:31:08 +08:00

74 lines
2.1 KiB
YAML

version: '3'
services:
postgres-test:
image: "postgres:12.8"
container_name: "omnivore-postgres-test"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=omnivore_test
- PG_POOL_MAX=20
healthcheck:
test: "exit 0"
interval: 2s
timeout: 12s
retries: 3
expose:
- 5432
elastic-test:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.1
container_name: "omnivore-elastic-test"
healthcheck:
test: curl 0.0.0.0:9201/_cat/health >/dev/null || exit 1
interval: 2s
timeout: 2s
retries: 5
environment:
- discovery.type=single-node
- http.cors.allow-origin=*
- http.cors.enabled=true
- http.cors.allow-headers=X-Requested-With,X-Auth-Token,Content-Type,Content-Length,Authorization
- http.cors.allow-credentials=true
- http.port=9201
volumes:
- ./.docker/elastic-data:/usr/share/elasticsearch/data
ports:
- "9201:9201"
api-test:
build:
context: .
dockerfile: ./packages/api/Dockerfile-test
container_name: "omnivore-api-test"
environment:
- API_ENV=local
- PG_HOST=postgres-test
- PG_USER=postgres
- PG_PASSWORD=postgres
- PG_DB=omnivore_test
- PG_PORT=5432
- PG_POOL_MAX=20
- ELASTIC_URL=http://elastic-test:9201
- IMAGE_PROXY_URL=http://localhost:9999
- IMAGE_PROXY_SECRET=some-secret
- JWT_SECRET=some_secret
- SSO_JWT_SECRET=some_sso_secret
- CLIENT_URL=http://localhost:3000
- GATEWAY_URL=http://localhost:8080/api
- PUPPETEER_TASK_HANDLER_URL=http://localhost:9090/
- REMINDER_TASK_HANDLER_URL=/svc/reminders/trigger
- BOOKMARKLET_JWT_SECRET=some_bookmarklet_secret
- BOOKMARKLET_VERSION=1.0.0
- PREVIEW_IMAGE_WRAPPER_ID='selected_highlight_wrapper'
- GCP_PROJECT_ID=omnivore-local
- GAUTH_CLIENT_ID='notset'
- GAUTH_SECRET='notset'
- SEGMENT_WRITE_KEY='test'
- PUBSUB_VERIFICATION_TOKEN='123456'
depends_on:
postgres-test:
condition: service_healthy
elastic-test:
condition: service_healthy