From 1ec0f8065176923708fb79833eb5d77a31101ce5 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Sat, 4 May 2019 11:18:41 -0500 Subject: [PATCH] automated testing updates --- .github/README.md | 17 ++++++++++++++++- docker-compose.data.services.yml | 13 +++++++++++++ docker-compose.data.tests.yml | 7 +++++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 docker-compose.data.services.yml diff --git a/.github/README.md b/.github/README.md index 6b8b54785..660c28c28 100644 --- a/.github/README.md +++ b/.github/README.md @@ -37,17 +37,32 @@ We have containerized FilterLists to make it as easy as possible for contributer 2. Clone the FilterLists git repository to your computer. [Docs](https://help.github.com/en/articles/cloning-a-repository) 3. Navigate to the root directory of your locally cloned FilterLists git repository in a command-line interface (bash, cmd, etc.). 4. Execute `docker-compose up -d`. -5. Visit the locally running version of FilterLists in a web browser at `http://localhost/` (web) and `http://localhost/api/v1/lists` (API). +5. Visit the locally running version of FilterLists in a web browser at `http://localhost/`. ### Testing changes to the data (.json files) +#### Automated + +Execute `docker-compose -f docker-compose.data.tests.yml down -v && docker-compose -f docker-compose.data.tests.yml build api && docker-compose -f docker-compose.data.tests.yml run api` + +#### Manual + 1. Execute `docker container ls` to find the `CONTAINER ID` of the `filterlists.api` container. 2. Execute `docker-compose up -d --build [CONTAINER ID]` replacing `[CONTAINER ID]` with the hash from step 1. +3. Verify your changes are properly reflected at `http://localhost/`. ### Testing changes to the `Api`, `Services`, or `Data` projects +#### Automated + +- `Services`: Execute `docker-compose -f docker-compose.services.tests.yml down -v && docker-compose -f docker-compose.services.tests.yml build api && docker-compose -f docker-compose.services.tests.yml run api` +- `Data`: Execute `docker-compose -f docker-compose.data.tests.yml down -v && docker-compose -f docker-compose.data.tests.yml build api && docker-compose -f docker-compose.data.tests.yml run api` + +#### Manual + 1. Execute `docker container ls` to find the `CONTAINER ID` of the `filterlists.api` container. 2. Execute `docker-compose up -d --build [CONTAINER ID]` replacing `[CONTAINER ID]` with the hash from step 1. +3. Verify your changes are properly reflected at `http://localhost/api`. ### Testing changes to the `Web` project diff --git a/docker-compose.data.services.yml b/docker-compose.data.services.yml new file mode 100644 index 000000000..d6a3dda41 --- /dev/null +++ b/docker-compose.data.services.yml @@ -0,0 +1,13 @@ +version: "3.7" + +services: + api: + build: + context: . + dockerfile: src/FilterLists.Api/Dockerfile + target: test-services + networks: + - test-services + +networks: + test-services: diff --git a/docker-compose.data.tests.yml b/docker-compose.data.tests.yml index 8910d8e33..a1802e0b8 100644 --- a/docker-compose.data.tests.yml +++ b/docker-compose.data.tests.yml @@ -6,11 +6,15 @@ services: context: . dockerfile: src/FilterLists.Api/Dockerfile target: test-data + networks: + - test-data depends_on: - mariadb mariadb: image: mariadb:10 + networks: + - test-data environment: - MYSQL_ROOT_PASSWORD=filterlists - MYSQL_DATABASE=filterlists @@ -22,3 +26,6 @@ services: "--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_520_ci" ] + +networks: + test-data: