This commit is contained in:
Mayel de Borniol 2022-03-16 17:30:58 +13:00
parent 8ccacf9c7f
commit 25de5dbe96
14 changed files with 58 additions and 23 deletions

View file

@ -7,5 +7,26 @@ alias Bonfire.Data
alias Bonfire.Me
alias Bonfire.Social
alias Bonfire.Common
import Common.Utils
import Common.URIs
use Common.Utils
import Bonfire.Me.Fake
require Logger
if module_enabled?(IExWatchTests) do
# to run tests from iex
# Code.compiler_options(ignore_module_conflict: true)
# Code.compile_file("~/.iex/iex_watch_tests.exs", File.cwd!())
unless GenServer.whereis(IExWatchTests) do
{:ok, pid} = IExWatchTests.start_link()
# Process will not exit when the iex goes out
Process.unlink(pid)
end
IExWatchTests.Helpers.ready
else
Logger.info("IExWatchTests is not available")
end
import_if_enabled IExWatchTests.Helpers

View file

@ -110,7 +110,7 @@ doc: ## Generate docs from code & readmes
recompile: ## Force the app to recompile
@make --no-print-directory cmd cmd="mix compile --force"
dev.test: init test.env dev.run
dev.test: init test.env.server dev.run
dev.bg: init ## Run the app in dev mode, as a background service
ifeq ($(WITH_DOCKER), total)
@ -295,7 +295,9 @@ git.publish:
test.env:
$(eval export MIX_ENV=test)
$(eval export)
test.env.server: test.env
$(eval export START_SERVER=true)
test: init test.env ## Run tests. You can also run only specific tests, eg: `make test only=forks/bonfire_social/test`
ifeq ($(WITH_DOCKER), total)

View file

@ -22,5 +22,5 @@ config :tesla, adapter: Tesla.Mock
config :logger, level: :warn
config :activity_pub, ActivityPubWeb.Endpoint,
http: [port: 4002],
http: [port: 4000],
server: false

View file

@ -53,7 +53,10 @@ config :bonfire,
encryption_salt: encryption_salt,
signing_salt: signing_salt
start_server? = if config_env() == :test, do: System.get_env("START_SERVER", "false"), else: System.get_env("START_SERVER", "true")
config :bonfire, Bonfire.Web.Endpoint,
server: String.to_existing_atom(start_server?),
url: [
host: host,
port: public_port

View file

@ -35,11 +35,8 @@ config :bonfire, Bonfire.Repo,
database: db,
slow_query_ms: 500
# We don't run a server during test. If one is required,
# you can enable the server option below.
config :bonfire, Bonfire.Web.Endpoint,
http: [port: 4002],
server: false
http: [port: 4000]
config :bonfire, Oban,
crontab: false,
@ -58,3 +55,7 @@ config :paginator, Paginator.Repo,
password: System.get_env("POSTGRES_PASSWORD", "postgres"),
hostname: System.get_env("POSTGRES_HOST", "localhost"),
database: db
config :exsync,
src_monitor: false,
extra_extensions: [".leex", ".js", ".css", ".sface"]

View file

@ -10,7 +10,7 @@ config :activity_pub, ActivityPub.TestRepo,
pool_size: 60
config :activity_pub, ActivityPubWeb.Endpoint,
http: [port: 4002],
http: [port: 4000],
server: false
config :activity_pub, :adapter, Bonfire.Federate.ActivityPub.Adapter

View file

@ -32,7 +32,7 @@ config :bonfire, Bonfire.Repo,
# We don't run a server during test. If one is required,
# you can enable the server option below.
config :bonfire, Bonfire.Web.Endpoint,
http: [port: 4002],
http: [port: 4000],
server: false
config :bonfire, Oban,

View file

@ -10,7 +10,7 @@ config :activity_pub, ActivityPub.TestRepo,
pool_size: 60
config :activity_pub, ActivityPubWeb.Endpoint,
http: [port: 4002],
http: [port: 4000],
server: false
config :activity_pub, :adapter, Bonfire.Federate.ActivityPub.Adapter

View file

@ -32,7 +32,7 @@ config :bonfire, Bonfire.Repo,
# We don't run a server during test. If one is required,
# you can enable the server option below.
config :bonfire, Bonfire.Web.Endpoint,
http: [port: 4002],
http: [port: 4000],
server: false
config :bonfire, Oban,

View file

@ -10,7 +10,7 @@ config :activity_pub, ActivityPub.TestRepo,
pool_size: 60
config :activity_pub, ActivityPubWeb.Endpoint,
http: [port: 4002],
http: [port: 4000],
server: false
config :activity_pub, :adapter, Bonfire.Federate.ActivityPub.Adapter

View file

@ -32,7 +32,7 @@ config :bonfire, Bonfire.Repo,
# We don't run a server during test. If one is required,
# you can enable the server option below.
config :bonfire, Bonfire.Web.Endpoint,
http: [port: 4002],
http: [port: 4000],
server: false
config :bonfire, Oban,

View file

@ -1,4 +1,4 @@
if Bonfire.Common.Utils.module_enabled?(Bonfire.API.GraphQL) and Bonfire.Common.Utils.module_enabled?(ValueFlows.Schema) and Bonfire.Common.Utils.module_enabled?(Absinthe.Schema.Notation) do
if Bonfire.Common.Extend.module_enabled?(Bonfire.API.GraphQL) and Bonfire.Common.Extend.module_enabled?(ValueFlows.Schema) and Bonfire.Common.Extend.module_enabled?(Absinthe.Schema.Notation) do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Bonfire.API.GraphQL.Schema do
@moduledoc """

View file

@ -4,7 +4,13 @@ DEPS=${1}
for dep in $DEPS ; do
printf "Install JS deps from extension %s... " "$dep"
if cd "forks/$dep/assets" 2>/dev/null || cd "deps/$dep/assets" 2>/dev/null ; then
if cd "forks/$dep/assets" 2>/dev/null ; then
pnpm install
cd ../../../
fi
if cd "deps/$dep/assets" 2>/dev/null ; then
pnpm install
cd ../../../
else

View file

@ -1,5 +1,7 @@
ExUnit.configure formatters: [ExUnit.CLIFormatter, ExUnitNotifier]
# ExUnit.configure formatters: [ExUnit.CLIFormatter, ExUnitNotifier, Bonfire.UI.Coordination.TestDrivenCoordination]
++ [Bonfire.Common.TestSummary]
# ++ [Bonfire.UI.Kanban.TestDrivenCoordination]
ExUnit.start(exclude: [:skip, :todo, :fixme])
Mix.Task.run("ecto.create")
@ -8,9 +10,9 @@ Mix.Task.run("ecto.migrate")
# Ecto.Adapters.SQL.Sandbox.mode(Bonfire.Repo, :manual)
Ecto.Adapters.SQL.Sandbox.mode(Bonfire.Repo, :auto)
ExUnit.after_suite(fn results ->
# do stuff
IO.inspect(test_results: results)
# ExUnit.after_suite(fn results ->
# # do stuff
# IO.inspect(test_results: results)
:ok
end)
# :ok
# end)