Fix cleaning upload files after running tests

See https://elixirforum.com/t/running-code-after-all-exunit-tests-are-done/9937/6

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2019-09-09 09:55:33 +02:00
parent 8f50e88e1e
commit 60707b8f8d
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773
2 changed files with 6 additions and 5 deletions

View file

@ -132,8 +132,7 @@ defmodule Mobilizon.Mixfile do
test: [
"ecto.create --quiet",
"ecto.migrate",
"test",
"cmd ./script/clean_after_tests"
&run_test/1
],
"phx.deps_migrate_serve": [
"deps.get",
@ -145,6 +144,11 @@ defmodule Mobilizon.Mixfile do
]
end
defp run_test(args) do
Mix.Task.run("test", args)
File.rm_rf!("test/uploads")
end
defp docs() do
[
source_ref: "v#{@version}",

View file

@ -1,3 +0,0 @@
#!/bin/bash
rm -rf test/uploads