diff --git a/Makefile b/Makefile index 99c3adc..d77ce74 100644 --- a/Makefile +++ b/Makefile @@ -74,3 +74,8 @@ selfcheck: ## check that the Makefile is well-formed pylintrc: ## check that the Makefile is well-formed edx_lint write pylintrc + +nuke: + @echo "Removing containers, networks, and data... 🧨" + @echo + docker compose down -v diff --git a/README_TESTS.md b/README_TESTS.md index b5f36a5..eba9188 100644 --- a/README_TESTS.md +++ b/README_TESTS.md @@ -1,4 +1,4 @@ -# Running Tests +# Running Tests and experimenting locally ## Running Tests Locally with one version of python on mac @@ -24,4 +24,12 @@ * `make test` to run tests ## Running Tests Locally with multiple versions of python on mac +TBD +## Running Elasticsearch and Kibana locally +* `docker compose up` should bring up kibana as long as it's uncommented + * It will take a while to start up +* run `make test` to run tests, which should create the schema in elasticsearch +* run `./manage.py es_update all` to update all the indexes + * At some point you'll see `"message":"Server running at http://0:5601"}` in kibana service logs + * When kibana is ready, you should see `test_movies-1` schema at http://0.0.0.0:5601/ in kibana under `discover` diff --git a/docker-compose.yml b/docker-compose.yml index 6511eb1..73cdd70 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,7 +24,13 @@ services: interval: 10s timeout: 10s retries: 10 -# commented out because right now we're not using postgres for tests + volumes: + # for normal elasticsearch: + # - elasticsearch:/usr/share/elasticsearch/data + # for webhippie/elasticsearch: + - elasticsearch:/var/lib/elasticsearch + + # commented out because right now we're not using postgres for tests # comment back in if we need it for multiprocessing tests # db: # image: postgres @@ -38,19 +44,21 @@ services: # uncomment to get kibana, which can be useful for analyzing index contents # this is currently not a required part of testing infrastructure, just left here for convenience -# kibana: -# image: docker.elastic.co/kibana/kibana:6.0.1 -# depends_on: -# elastic: -# condition: service_healthy -# links: -# - elastic -# ports: -# - 5601:5601 -# environment: -# - "ELASTICSEARCH_URL=http://elastic:9200" -# healthcheck: -# test: ["CMD", "curl", "-f", "http://localhost:5601"] -# interval: 10s -# timeout: 10s -# retries: 10 \ No newline at end of file + kibana: + image: docker.elastic.co/kibana/kibana:6.4.3 + depends_on: + elastic: + condition: service_healthy + links: + - elastic + ports: + - 5601:5601 + environment: + - "ELASTICSEARCH_URL=http://elastic:9200" + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:5601"] + interval: 10s + timeout: 10s + retries: 10 +volumes: + elasticsearch: \ No newline at end of file