From f4736bd1b9dce273e0e18773c69d042f8f478d97 Mon Sep 17 00:00:00 2001 From: Mayel Date: Tue, 19 Oct 2021 17:10:10 +1300 Subject: [PATCH] little things to setup & run tests (using docker) --- Dockerfile | 2 +- Makefile | 14 +++++++------- mix.exs | 1 + 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0c80b83da..8d6afe8ee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM elixir:alpine -RUN apk add --no-cache inotify-tools postgresql-client yarn file make gcc libc-dev argon2 imagemagick cmake build-base libwebp-tools bash ncurses git +RUN apk add --no-cache inotify-tools postgresql-client yarn file make gcc libc-dev argon2 imagemagick cmake build-base libwebp-tools bash ncurses git python3 RUN mix local.hex --force && mix local.rebar --force diff --git a/Makefile b/Makefile index f0eb6eff6..44a88ef37 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ init: - @bash docker/message.sh "start" + @bash docker/message.sh "Start" make start setup: stop @@ -10,16 +10,16 @@ migrate: logs: docker-compose logs -f start: stop - @bash docker/message.sh "starting Mobilizon with docker" + @bash docker/message.sh "Starting Mobilizon with Docker" docker-compose up -d api - @bash docker/message.sh "Docker server started." + @bash docker/message.sh "Docker server started" stop: - @bash docker/message.sh "stopping Mobilizon" + @bash docker/message.sh "Stopping Mobilizon" docker-compose down - @bash docker/message.sh "stopped" + @bash docker/message.sh "Mobilizon is stopped" test: stop @bash docker/message.sh "Running tests" - docker-compose -f docker-compose.yml -f docker-compose.test.yml run api mix test - @bash docker/message.sh "Tests runned" + docker-compose -f docker-compose.yml -f docker-compose.test.yml run api mix test $(only) + @bash docker/message.sh "Done running tests" target: init diff --git a/mix.exs b/mix.exs index fbdf2cecf..ab4276597 100644 --- a/mix.exs +++ b/mix.exs @@ -247,6 +247,7 @@ defmodule Mobilizon.Mixfile do test: [ "ecto.create", "ecto.migrate", + "tz_world.update", &run_test/1 ], "phx.deps_migrate_serve": [