Skip to content

Update CI to test latest version of stack #48

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 4 commits into from
Mar 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ executors:
- image: circleci/php:<< parameters.php-version >>-browsers
environment:
CIRCLE_EXECUTOR: stack
- image: docker.elastic.co/elasticsearch/elasticsearch:7.8.0
- image: docker.elastic.co/elasticsearch/elasticsearch:7.12.0
name: elasticsearch
environment:
cluster.name: es-cluster
Expand All @@ -26,14 +26,16 @@ executors:
xpack.license.self_generated.type: trial
xpack.security.authc.api_key.enabled: true
ELASTIC_PASSWORD: password
- image: docker.elastic.co/enterprise-search/enterprise-search:7.8.0
ES_JAVA_OPTS: -Xms512m -Xmx512m
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This helps prevent the ES container from grinding to a halt during integration tests.

- image: docker.elastic.co/enterprise-search/enterprise-search:7.12.0
name: appsearch
environment:
elasticsearch.host: http://elasticsearch:9200
elasticsearch.password: password
ENT_SEARCH_DEFAULT_PASSWORD: password
secret_management.encryption_keys: "[changeme]"
allow_es_settings_modification: true
elasticsearch.startup_retry.interval: 15
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This retry interval is a temporary workaround for a known race condition in Enterprise Search startup when waiting for the ES license server to be available. Without it, App Search can sporadically fail to start.


commands:
install_deps:
Expand Down
53 changes: 53 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# A docker-compose to make it easier to run PHP integration tests locally with different PHP versions.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I was wrestling with inconsistent CI build failures, I ended up creating a docker-compose to make it easier to test ideas locally. Thought it might help others in the future.

version: "2"

services:

elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.12.0
environment:
- "discovery.type=single-node"
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "xpack.security.enabled=true"
- "xpack.security.authc.api_key.enabled=true"
- "ELASTIC_PASSWORD=password"
ulimits:
memlock:
soft: -1
hard: -1
ports:
- 9200:9200

entsearch:
image: docker.elastic.co/enterprise-search/enterprise-search:7.12.0
depends_on:
- "elasticsearch"
environment:
- "ENT_SEARCH_DEFAULT_PASSWORD=password"
- "elasticsearch.username=elastic"
- "elasticsearch.password=password"
- "elasticsearch.host=http://elasticsearch:9200"
- "allow_es_settings_modification=true"
- "secret_management.encryption_keys=[4a2cd3f81d39bf28738c10db0ca782095ffac07279561809eecc722e0c20eb09]"
- "elasticsearch.startup_retry.interval=15"
ports:
- 3002:3002

# php_client - Helpful for running integration tests locally.
# docker-compose build --build-arg base_image=php:7.3-cli
# docker-compose run php_client bash
# # source .circleci/retrieve-credentials.sh
# # vendor/bin/phpunit -c phpunit.xml.dist --testsuite integration
php_client:
build:
context: .
args:
base_image: php:7.3-cli
image: php_client
depends_on:
- "elasticsearch"
- "entsearch"
environment:
- "AS_URL=http://entsearch:3002"
- "ES_URL=http://elasticsearch:9200"
- "AS_ENGINE_NAME=php-integration-test-7.3"