Rename internal build symbols

This drops the small/full build naming in favour of ce/ee
abbreviations for Community and Enterprise Edition respectively.
rename-build-names
Adam Rutkowski 3 years ago
parent 2fae0146a4
commit f3e344976c

@ -51,7 +51,7 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
MIX_ENV=small
MIX_ENV=ce
BUILD_METADATA=${{ steps.meta.outputs.json }}
ERL_FLAGS=+JPperf true

@ -46,7 +46,7 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
MIX_ENV=small
MIX_ENV=ce
BUILD_METADATA=${{ steps.meta.outputs.json }}
ERL_FLAGS=+JMsingle true

@ -10,7 +10,7 @@ concurrency:
cancel-in-progress: true
env:
CACHE_VERSION: v7
CACHE_VERSION: v8
PERSISTENT_CACHE_DIR: cached
jobs:
@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
mix_env: ['test', 'small_test']
mix_env: ['test', 'ce_test']
postgres_image: ['postgres:15', 'postgres:16']
env:
MIX_ENV: ${{ matrix.mix_env }}
@ -97,7 +97,7 @@ jobs:
- run: mix test --include slow --include minio --max-failures 1 --warnings-as-errors
if: env.MIX_ENV == 'test'
- run: mix test --include slow --max-failures 1 --warnings-as-errors
if: env.MIX_ENV == 'small_test'
if: env.MIX_ENV == 'ce_test'
static:
name: Static checks (format, credo, dialyzer)

@ -4,7 +4,7 @@
#### Builder
FROM hexpm/elixir:1.16.0-erlang-26.2.1-alpine-3.18.4 as buildcontainer
ARG MIX_ENV=small
ARG MIX_ENV=ce
# preparation
ENV MIX_ENV=$MIX_ENV
@ -60,7 +60,7 @@ LABEL maintainer="plausible.io <hello@plausible.io>"
ARG BUILD_METADATA={}
ENV BUILD_METADATA=$BUILD_METADATA
ENV LANG=C.UTF-8
ARG MIX_ENV=small
ARG MIX_ENV=ce
ENV MIX_ENV=$MIX_ENV
RUN adduser -S -H -u 999 -G nogroup plausible -g 'Plausible Analytics'

@ -6,11 +6,11 @@ if config_env() in [:dev, :test] do
Envy.load(["config/.env.#{config_env()}"])
end
if config_env() == :small_dev do
if config_env() == :ce_dev do
Envy.load(["config/.env.dev"])
end
if config_env() == :small_test do
if config_env() == :ce_test do
Envy.load(["config/.env.test"])
end

@ -3,7 +3,7 @@ defmodule Plausible do
Build-related macros
"""
@small_builds [:small, :small_test, :small_dev]
@ce_builds [:ce, :ce_test, :ce_dev]
defmacro __using__(_) do
quote do
@ -12,16 +12,16 @@ defmodule Plausible do
end
end
defmacro on_full_build(clauses) do
do_on_full_build(clauses)
defmacro on_ee(clauses) do
do_on_ee(clauses)
end
def do_on_full_build(do: block) do
do_on_full_build(do: block, else: nil)
def do_on_ee(do: block) do
do_on_ee(do: block, else: nil)
end
def do_on_full_build(do: do_block, else: else_block) do
if Mix.env() not in @small_builds do
def do_on_ee(do: do_block, else: else_block) do
if Mix.env() not in @ce_builds do
quote do
unquote(do_block)
end
@ -32,21 +32,21 @@ defmodule Plausible do
end
end
defmacro full_build?() do
full_build? = Mix.env() not in @small_builds
defmacro ee?() do
ee? = Mix.env() not in @ce_builds
# Tricking dialyzer as per:
# https://github.com/elixir-lang/elixir/blob/v1.12.3/lib/elixir/lib/gen_server.ex#L771-L778
quote do
:erlang.phash2(1, 1) == 0 and unquote(full_build?)
:erlang.phash2(1, 1) == 0 and unquote(ee?)
end
end
defmacro small_build?() do
small_build? = Mix.env() in @small_builds
defmacro ce_build?() do
ce_build? = Mix.env() in @ce_builds
quote do
unquote(small_build?)
unquote(ce_build?)
end
end
end

@ -7,7 +7,7 @@ defmodule Plausible.Application do
require Logger
def start(_type, _args) do
on_full_build(do: Plausible.License.ensure_valid_license())
on_ee(do: Plausible.License.ensure_valid_license())
children = [
Plausible.Cache.Stats,

@ -57,7 +57,7 @@ defmodule Plausible.Auth do
)
end
on_full_build do
on_ee do
def is_super_admin?(nil), do: false
def is_super_admin?(%Plausible.Auth.User{id: id}), do: is_super_admin?(id)

@ -252,7 +252,7 @@ defmodule Plausible.Auth.User do
end
defp trial_expiry() do
on_full_build do
on_ee do
Timex.today() |> Timex.shift(days: 30)
else
Timex.today() |> Timex.shift(years: 100)
@ -260,7 +260,7 @@ defmodule Plausible.Auth.User do
end
defp set_email_verification_status(user) do
on_full_build do
on_ee do
change(user, email_verified: false)
else
selfhosted_config = Application.get_env(:plausible, :selfhost)

@ -126,7 +126,7 @@ defmodule Plausible.Auth.UserAdmin do
end
end
on_full_build do
on_ee do
defp usage_link(user) do
path = PlausibleWeb.Router.Helpers.admin_path(PlausibleWeb.Endpoint, :usage, user.id)
{:safe, ~s(<a href="#{path}">Usage</a>)}

@ -45,7 +45,7 @@ defmodule Plausible.Billing.Quota do
end
end
on_full_build do
on_ee do
@limit_sites_since ~D[2021-05-05]
@site_limit_for_trials 10
@team_member_limit_for_trials 3
@ -349,7 +349,7 @@ defmodule Plausible.Billing.Quota do
stats_api_usage = from a in Plausible.Auth.ApiKey, where: a.user_id == ^user.id
queries =
on_full_build do
on_ee do
funnels_usage_query =
from f in "funnels",
inner_join: os in subquery(owned_sites_query(user)),
@ -378,7 +378,7 @@ defmodule Plausible.Billing.Quota do
props_exist = is_list(site.allowed_event_props) && site.allowed_event_props != []
funnels_exist =
on_full_build do
on_ee do
Plausible.Repo.exists?(from f in Plausible.Funnel, where: f.site_id == ^site.id)
else
false

@ -59,7 +59,7 @@ defmodule Plausible.Exports do
}
end
Plausible.on_full_build do
Plausible.on_ee do
defp sampled(table) do
Plausible.Stats.Sampling.add_query_hint(from(table))
end

@ -9,7 +9,7 @@ defmodule Plausible.Goal do
field :event_name, :string
field :page_path, :string
on_full_build do
on_ee do
field :currency, Ecto.Enum, values: Money.Currency.known_current_currencies()
many_to_many :funnels, Plausible.Funnel, join_through: Plausible.Funnel.Step
else
@ -22,7 +22,7 @@ defmodule Plausible.Goal do
timestamps()
end
@fields [:id, :site_id, :event_name, :page_path] ++ on_full_build(do: [:currency], else: [])
@fields [:id, :site_id, :event_name, :page_path] ++ on_ee(do: [:currency], else: [])
def changeset(goal, attrs \\ %{}) do
goal
@ -77,7 +77,7 @@ defmodule Plausible.Goal do
end
defp maybe_drop_currency(changeset) do
if full_build?() and get_field(changeset, :page_path) do
if ee?() and get_field(changeset, :page_path) do
delete_change(changeset, :currency)
else
changeset

@ -22,7 +22,7 @@ defmodule Plausible.Goals do
Repo.transaction(fn ->
case insert_goal(site, params, upsert?) do
{:ok, :insert, goal} ->
on_full_build do
on_ee do
now = Keyword.get(opts, :now, DateTime.utc_now())
# credo:disable-for-next-line Credo.Check.Refactor.Nesting
if Plausible.Goal.Revenue.revenue?(goal) do
@ -95,7 +95,7 @@ defmodule Plausible.Goals do
order_by: [desc: g.id],
preload: [:site]
if opts[:preload_funnels?] == true and full_build?() do
if opts[:preload_funnels?] == true and ee?() do
from(g in query,
left_join: assoc(g, :funnels),
group_by: g.id,
@ -128,7 +128,7 @@ defmodule Plausible.Goals do
where: g.site_id == ^site_id
)
goal_query = on_full_build(do: preload(goal_query, funnels: :steps), else: goal_query)
goal_query = on_ee(do: preload(goal_query, funnels: :steps), else: goal_query)
result =
Multi.new()

@ -290,7 +290,7 @@ defmodule Plausible.Ingestion.Event do
defp put_props(%__MODULE__{} = event), do: event
defp put_revenue(event) do
on_full_build do
on_ee do
attrs = Plausible.Ingestion.Event.Revenue.get_revenue_attrs(event)
update_event_attrs(event, attrs)
else

@ -42,7 +42,7 @@ defmodule Plausible.Ingestion.Request do
field :pathname, :string
field :props, :map
on_full_build do
on_ee do
field :revenue_source, :map
end
@ -95,7 +95,7 @@ defmodule Plausible.Ingestion.Request do
end
end
on_full_build do
on_ee do
defp put_revenue_source(changeset, request_body) do
Plausible.Ingestion.Request.Revenue.put_revenue_source(changeset, request_body)
end

@ -64,7 +64,7 @@ defmodule Plausible.Plugins.API.Token do
can scan repositories for accidental secret commits.
"""
def prefix() do
on_full_build do
on_ee do
env = Application.get_env(:plausible, :environment)
case env do

@ -59,7 +59,7 @@ defmodule Plausible.S3 do
# to make ClickHouse see MinIO in dev and test envs we replace
# the host in the S3 URL with whatever's set in S3_CLICKHOUSE_HOST env var
if Mix.env() in [:dev, :test, :small_dev, :small_test] do
if Mix.env() in [:dev, :test, :ce_dev, :ce_test] do
defp extract_s3_url(presigned_url) do
[s3_url, _] = String.split(presigned_url, "?")

@ -106,7 +106,7 @@ defmodule Plausible.Site.Memberships.AcceptInvitation do
|> downgrade_previous_owner(site, user)
|> Multi.insert_or_update(:membership, membership)
|> Multi.run(:update_locked_sites, fn _, _ ->
on_full_build do
on_ee do
# At this point this function should be guaranteed to unlock
# the site, via `Invitations.ensure_can_take_ownership/2`.
:unlocked = Billing.SiteLocker.update_sites_for(user, send_email?: false)

@ -64,7 +64,7 @@ defmodule Plausible.Site.Memberships.Invitations do
:ok
end
on_full_build do
on_ee do
@spec ensure_can_take_ownership(Site.t(), Auth.User.t()) ::
:ok | {:error, Quota.over_limits_error() | :no_plan}
def ensure_can_take_ownership(site, new_owner) do

@ -31,7 +31,7 @@ defmodule Plausible.Stats do
CurrentVisitors.current_visitors(site)
end
on_full_build do
on_ee do
def funnel(site, query, funnel) do
include_sentry_replay_info()
Plausible.Stats.Funnel.funnel(site, query, funnel)

@ -5,7 +5,7 @@ defmodule Plausible.Stats.Aggregate do
import Ecto.Query
alias Plausible.Stats.{Query, Util}
@revenue_metrics on_full_build(do: Plausible.Stats.Goal.Revenue.revenue_metrics(), else: [])
@revenue_metrics on_ee(do: Plausible.Stats.Goal.Revenue.revenue_metrics(), else: [])
@event_metrics [
:visitors,
@ -20,7 +20,7 @@ defmodule Plausible.Stats.Aggregate do
def aggregate(site, query, metrics) do
{currency, metrics} =
on_full_build do
on_ee do
Plausible.Stats.Goal.Revenue.get_revenue_tracking_currency(site, query, metrics)
else
{nil, metrics}
@ -214,7 +214,7 @@ defmodule Plausible.Stats.Aggregate do
defp maybe_round_value(entry), do: entry
on_full_build do
on_ee do
defp cast_revenue_metrics_to_money(results, revenue_goals) do
Plausible.Stats.Goal.Revenue.cast_revenue_metrics_to_money(results, revenue_goals)
end

@ -44,7 +44,7 @@ defmodule Plausible.Stats.Base do
where: e.timestamp >= ^first_datetime and e.timestamp < ^last_datetime
)
on_full_build do
on_ee do
q = Plausible.Stats.Sampling.add_query_hint(q, query)
end
@ -147,7 +147,7 @@ defmodule Plausible.Stats.Base do
from s in q, where: s.start >= ^first_datetime and s.start < ^last_datetime
end
on_full_build do
on_ee do
sessions_q = Plausible.Stats.Sampling.add_query_hint(sessions_q, query)
end
@ -237,7 +237,7 @@ defmodule Plausible.Stats.Base do
}
end
on_full_build do
on_ee do
defp select_event_metric(:total_revenue) do
%{total_revenue: Plausible.Stats.Goal.Revenue.total_revenue_query()}
end

@ -13,7 +13,7 @@ defmodule Plausible.Stats.Breakdown do
@session_metrics [:visits, :bounce_rate, :visit_duration]
@revenue_metrics on_full_build(do: Plausible.Stats.Goal.Revenue.revenue_metrics(), else: [])
@revenue_metrics on_ee(do: Plausible.Stats.Goal.Revenue.revenue_metrics(), else: [])
@event_metrics [:visitors, :pageviews, :events, :percentage] ++ @revenue_metrics
@ -38,7 +38,7 @@ defmodule Plausible.Stats.Breakdown do
no_revenue = {nil, metrics -- @revenue_metrics}
{revenue_goals, metrics} =
on_full_build do
on_ee do
if Plausible.Billing.Feature.RevenueGoals.enabled?(site) do
revenue_goals = Enum.filter(event_goals, &Plausible.Goal.Revenue.revenue?/1)
metrics = if Enum.empty?(revenue_goals), do: metrics -- @revenue_metrics, else: metrics
@ -123,7 +123,7 @@ defmodule Plausible.Stats.Breakdown do
def breakdown(site, query, "event:props:" <> custom_prop = property, metrics, pagination, opts) do
{currency, metrics} =
on_full_build do
on_ee do
Plausible.Stats.Goal.Revenue.get_revenue_tracking_currency(site, query, metrics)
else
{nil, metrics}
@ -786,7 +786,7 @@ defmodule Plausible.Stats.Breakdown do
])
end
on_full_build do
on_ee do
defp cast_revenue_metrics_to_money(results, revenue_goals) do
Plausible.Stats.Goal.Revenue.cast_revenue_metrics_to_money(results, revenue_goals)
end

@ -113,7 +113,7 @@ defmodule Plausible.Stats.Clickhouse do
offset: ^offset
)
on_full_build do
on_ee do
referrers = Plausible.Stats.Sampling.add_query_hint(referrers, 10_000_000)
end
@ -193,7 +193,7 @@ defmodule Plausible.Stats.Clickhouse do
order_by: [e.site_id, fragment("toStartOfHour(timestamp)")]
)
on_full_build do
on_ee do
current_q = Plausible.Stats.Sampling.add_query_hint(current_q)
end
@ -231,7 +231,7 @@ defmodule Plausible.Stats.Clickhouse do
},
group_by: [e.site_id]
on_full_build do
on_ee do
query = Plausible.Stats.Sampling.add_query_hint(query)
end
@ -260,7 +260,7 @@ defmodule Plausible.Stats.Clickhouse do
where: e.timestamp >= ^first_datetime and e.timestamp < ^last_datetime
)
on_full_build do
on_ee do
q = Plausible.Stats.Sampling.add_query_hint(q, 10_000_000)
end

@ -17,7 +17,7 @@ defmodule Plausible.Stats.Metrics do
:events,
:conversion_rate,
:time_on_page
] ++ on_full_build(do: Plausible.Stats.Goal.Revenue.revenue_metrics(), else: [])
] ++ on_ee(do: Plausible.Stats.Goal.Revenue.revenue_metrics(), else: [])
@metric_mappings Enum.into(@all_metrics, %{}, fn metric -> {to_string(metric), metric} end)

@ -29,7 +29,7 @@ defmodule Plausible.Stats.Query do
|> put_imported_opts(site, params)
|> maybe_drop_prop_filter(site)
on_full_build do
on_ee do
query = Plausible.Stats.Sampling.put_threshold(query, params)
end

@ -18,7 +18,7 @@ defmodule Plausible.Stats.Timeseries do
@typep value :: nil | integer() | float()
@type results :: nonempty_list(%{required(:date) => Date.t(), required(metric()) => value()})
@revenue_metrics on_full_build(do: Plausible.Stats.Goal.Revenue.revenue_metrics(), else: [])
@revenue_metrics on_ee(do: Plausible.Stats.Goal.Revenue.revenue_metrics(), else: [])
@event_metrics [:visitors, :pageviews, :events, :conversion_rate] ++ @revenue_metrics
@session_metrics [:visits, :bounce_rate, :visit_duration, :views_per_visit]
@ -29,7 +29,7 @@ defmodule Plausible.Stats.Timeseries do
session_metrics = Enum.filter(metrics, &(&1 in @session_metrics))
{currency, event_metrics} =
on_full_build do
on_ee do
Plausible.Stats.Goal.Revenue.get_revenue_tracking_currency(site, query, event_metrics)
else
{nil, event_metrics}
@ -249,7 +249,7 @@ defmodule Plausible.Stats.Timeseries do
end)
end
on_full_build do
on_ee do
defp cast_revenue_metrics_to_money(results, revenue_goals) do
Plausible.Stats.Goal.Revenue.cast_revenue_metrics_to_money(results, revenue_goals)
end

@ -12,7 +12,7 @@ defmodule Plausible.Users do
alias Plausible.Repo
@spec on_trial?(Auth.User.t()) :: boolean()
on_full_build do
on_ee do
def on_trial?(%Auth.User{trial_expiry_date: nil}), do: false
def on_trial?(user) do
@ -36,7 +36,7 @@ defmodule Plausible.Users do
end
@spec accept_traffic_until(Auth.User.t()) :: Date.t()
on_full_build do
on_ee do
def accept_traffic_until(user) do
user = with_subscription(user)

@ -12,7 +12,7 @@ defmodule Plausible.Release do
]
def should_be_first_launch? do
on_full_build do
on_ee do
false
else
not (_has_users? = Repo.exists?(Plausible.Auth.User))

@ -11,7 +11,7 @@ defmodule PlausibleWeb.Api.StatsController do
require Logger
@revenue_metrics on_full_build(do: Plausible.Stats.Goal.Revenue.revenue_metrics(), else: [])
@revenue_metrics on_ee(do: Plausible.Stats.Goal.Revenue.revenue_metrics(), else: [])
plug(:date_validation_plug)
@ -347,10 +347,10 @@ defmodule PlausibleWeb.Api.StatsController do
top_stats_entry(results, comparison, "Unique visitors", :total_visitors),
top_stats_entry(results, comparison, "Unique conversions", :visitors),
top_stats_entry(results, comparison, "Total conversions", :events),
on_full_build do
on_ee do
top_stats_entry(results, comparison, "Average revenue", :average_revenue, &format_money/1)
end,
on_full_build do
on_ee do
top_stats_entry(results, comparison, "Total revenue", :total_revenue, &format_money/1)
end,
top_stats_entry(results, comparison, "Conversion rate", :conversion_rate)
@ -450,7 +450,7 @@ defmodule PlausibleWeb.Api.StatsController do
end
end
on_full_build do
on_ee do
def funnel(conn, %{"id" => funnel_id} = params) do
site = Plausible.Repo.preload(conn.assigns.site, :owner)
@ -1347,7 +1347,7 @@ defmodule PlausibleWeb.Api.StatsController do
end
end
on_full_build do
on_ee do
defdelegate format_revenue_metric(metric_value), to: PlausibleWeb.Controllers.API.Revenue
defdelegate format_money(money), to: PlausibleWeb.Controllers.API.Revenue
else

@ -92,7 +92,7 @@ defmodule PlausibleWeb.StatsController do
end
end
on_full_build do
on_ee do
defp list_funnels(site) do
Plausible.Funnels.list(site)
end
@ -366,7 +366,7 @@ defmodule PlausibleWeb.StatsController do
end
defp is_dbip() do
on_full_build do
on_ee do
false
else
Plausible.Geo.database_type()

@ -36,7 +36,7 @@ defmodule PlausibleWeb.Endpoint do
static_paths = ~w(css js images favicon.ico)
static_paths =
on_full_build do
on_ee do
# NOTE: The Cloud uses custom robots.txt from https://github.com/plausible/website: https://plausible.io/robots.txt
static_paths
else
@ -50,7 +50,7 @@ defmodule PlausibleWeb.Endpoint do
only: static_paths
)
on_full_build do
on_ee do
plug(Plug.Static,
at: "/kaffy",
from: :kaffy,

@ -149,7 +149,7 @@ defmodule PlausibleWeb.Live.GoalSettings.Form do
</div>
<div
:if={full_build?()}
:if={ee?()}
class="mt-6 space-y-3"
x-data={
Jason.encode!(%{
@ -211,7 +211,7 @@ defmodule PlausibleWeb.Live.GoalSettings.Form do
submit_name={@f[:currency].name}
module={ComboBox}
suggest_fun={
on_full_build do
on_ee do
fn
"", [] ->
Plausible.Goal.Revenue.currency_options()

@ -64,7 +64,7 @@ defmodule PlausibleWeb.Live.RegisterForm do
~H"""
<div class="mx-auto mt-6 text-center dark:text-gray-300">
<h1 class="text-3xl font-black">
<%= if small_build?() or @live_action == :register_from_invitation_form do %>
<%= if ce_build?() or @live_action == :register_from_invitation_form do %>
Register your Plausible Analytics account
<% else %>
Register your 30-day free trial
@ -158,7 +158,7 @@ defmodule PlausibleWeb.Live.RegisterForm do
<% end %>
<% submit_text =
if small_build?() or @invitation do
if ce_build?() or @invitation do
"Create my account →"
else
"Start my free trial →"

@ -682,7 +682,7 @@ defmodule PlausibleWeb.Live.Sites do
defp check_limits(invitation, _), do: %{invitation: invitation}
defp check_features(%{role: :owner, site: site} = invitation, user) do
case Invitations.check_feature_access(site, user, small_build?()) do
case Invitations.check_feature_access(site, user, ce_build?()) do
:ok ->
%{invitation: invitation}

@ -10,7 +10,7 @@ defmodule PlausibleWeb.Router do
plug :fetch_live_flash
plug :put_secure_browser_headers
plug PlausibleWeb.Plugs.NoRobots
on_full_build(do: nil, else: plug(PlausibleWeb.FirstLaunchPlug, redirect_to: "/register"))
on_ee(do: nil, else: plug(PlausibleWeb.FirstLaunchPlug, redirect_to: "/register"))
plug PlausibleWeb.SessionTimeoutPlug, timeout_after_seconds: @two_weeks_in_seconds
plug PlausibleWeb.AuthPlug
plug PlausibleWeb.LastSeenPlug
@ -51,7 +51,7 @@ defmodule PlausibleWeb.Router do
plug :accepts, ["json"]
end
on_full_build do
on_ee do
pipeline :flags do
plug :accepts, ["html"]
plug :put_secure_browser_headers
@ -66,20 +66,20 @@ defmodule PlausibleWeb.Router do
forward "/sent-emails", Bamboo.SentEmailViewerPlug
end
on_full_build do
on_ee do
use Kaffy.Routes,
scope: "/crm",
pipe_through: [PlausibleWeb.Plugs.NoRobots, PlausibleWeb.CRMAuthPlug]
end
on_full_build do
on_ee do
scope "/crm", PlausibleWeb do
pipe_through :flags
get "/auth/user/:user_id/usage", AdminController, :usage
end
end
on_full_build do
on_ee do
scope path: "/flags" do
pipe_through :flags
forward "/", FunWithFlags.UI.Router, namespace: "flags"
@ -129,7 +129,7 @@ defmodule PlausibleWeb.Router do
scope "/api/stats", PlausibleWeb.Api do
pipe_through :internal_stats_api
on_full_build do
on_ee do
get "/:domain/funnels/:id", StatsController, :funnel
end
@ -168,7 +168,7 @@ defmodule PlausibleWeb.Router do
get "/timeseries", ExternalStatsController, :timeseries
end
on_full_build do
on_ee do
scope "/api/v1/sites", PlausibleWeb.Api do
pipe_through [:public_api, PlausibleWeb.AuthorizeSitesApiPlug]
@ -352,7 +352,7 @@ defmodule PlausibleWeb.Router do
get "/:website/settings/goals", SiteController, :settings_goals
get "/:website/settings/properties", SiteController, :settings_props
on_full_build do
on_ee do
get "/:website/settings/funnels", SiteController, :settings_funnels
end

@ -45,7 +45,7 @@
method: :post
) %> to <%= @conn.assigns[:current_user].email %>
</li>
<%= if full_build?() do %>
<%= if ee?() do %>
<li>
<a class="underline text-indigo-600" href="https://plausible.io/contact">
Contact us

@ -11,13 +11,13 @@
You might have used an email address that's not registered in our database. Please verify the email address associated with your Plausible account and attempt the password reset once more.
</div>
<div class="mt-2 text-sm text-gray-600 dark:text-gray-400 leading-tight">
<span :if={small_build?()}>
<span :if={ce_build?()}>
Certain that you're using the correct email address but still aren't receiving the password reset email? Please check your spam folder or ask on our <a
href="https://github.com/plausible/analytics/discussions"
class="text-indigo-500"
>community-supported forum</a>.
</span>
<span :if={full_build?()}>
<span :if={ee?()}>
Certain that you're using the correct email address but still aren't receiving the password reset email? Please check your spam folder or <a
href="https://plausible.io/contact"
class="text-indigo-500"

@ -1,5 +1,5 @@
<div x-data="{disable2FAOpen: false, regenerate2FAOpen: false}">
<%= if full_build?() do %>
<%= if ee?() do %>
<div class="max-w-2xl px-8 pt-4 pb-8 mx-auto mt-24 bg-white border-t-2 border-orange-200 rounded rounded-t-none shadow-md dark:bg-gray-800 dark:border-orange-200 ">
<div class="flex flex-wrap justify-between">
<h2 class="text-xl font-black dark:text-gray-100 w-max mr-4 mt-2">Subscription Plan</h2>

@ -30,7 +30,7 @@
>
Use recovery code
</a>
<%= if full_build?() do %>
<%= if ee?() do %>
<br /> Lost your recovery codes?
<a href="https://plausible.io/contact" class="underline text-indigo-600">
Contact us

@ -46,7 +46,7 @@
<a href={Routes.auth_path(@conn, :verify_2fa)} class="underline text-indigo-600">
Enter verification code
</a>
<%= if full_build?() do %>
<%= if ee?() do %>
<br /> Lost your recovery codes?
<a href="https://plausible.io/contact" class="underline text-indigo-600">
Contact us

@ -22,7 +22,7 @@
</ul>
<br />
If all of the above is fine, please try to do the import once again. Sometimes the Google Analytics API just randomly returns empty data. It's intermittent and random. Trying to do the import again may return what you need.
<%= if full_build?() do %>
<%= if ee?() do %>
<br /> <br />
Please reply to this email to let us know if you're still experiencing issues with the import.
<% end %>

@ -22,14 +22,14 @@
<div class="ml-3">
<h3 class="text-sm font-medium text-yellow-800 dark:text-yellow-400">
There has been a server error.
<%= if full_build?() do %>
<%= if ee?() do %>
But don't worry, we're on it!
<% end %>
</h3>
<div class="mt-2 text-sm text-yellow-700 dark:text-yellow-300">
<p>
<%= if assigns[:trace_id] && full_build?() do %>
<%= if assigns[:trace_id] && ee?() do %>
If you would like to help, tell us what you were trying to do. Our development team will receive your report.
<% else %>
We have been notified.
@ -40,7 +40,7 @@
</div>
</div>
<%= if full_build?() do %>
<%= if ee?() do %>
<%= if assigns[:trace_id] do %>
<div class="my-6">
<%= form_for :error, Routes.error_report_path(PlausibleWeb.Endpoint, :submit_error_report), fn f -> %>

@ -14,12 +14,12 @@
) %>
</h4>
<p class="mt-4 text-base text-gray-400 leading-6">
<%= if full_build?() do %>
<%= if ee?() do %>
Made and hosted in the EU <span class="text-lg">🇪🇺</span> <br />
Solely funded by our subscribers.
<% end %>
<%= if small_build?() do %>
<%= if ce_build?() do %>
This dashboard is running on self-managed infrastructure, not tested by Plausible Analytics. We cannot vouch for its performance or reliability. For official managed hosting, check out
<.styled_link href="https://plausible.io">
plausible.io

@ -28,7 +28,7 @@
<% @conn.assigns[:current_user] -> %>
<ul class="flex items-center w-full sm:w-auto">
<li
:if={full_build?() and Plausible.Users.on_trial?(@conn.assigns[:current_user])}
:if={ee?() and Plausible.Users.on_trial?(@conn.assigns[:current_user])}
class="hidden mr-6 sm:block"
>
<%= link(trial_notificaton(@conn.assigns[:current_user]),
@ -61,7 +61,7 @@
<.dropdown_link new_tab href="https://plausible.io/docs">
Help Center
</.dropdown_link>
<%= if full_build?() do %>
<%= if ee?() do %>
<.dropdown_link new_tab href="https://plausible.io/contact">
Contact Support
</.dropdown_link>
@ -80,7 +80,7 @@
</:panel>
</.dropdown>
</li>
<%= if @conn.assigns[:current_user] && full_build?() do %>
<%= if @conn.assigns[:current_user] && ee?() do %>
<li id="changelog-notification" class="relative py-2"></li>
<% end %>
</ul>

@ -1,4 +1,4 @@
<%= on_full_build do %>
<%= on_ee do %>
<%= if !@conn.assigns[:skip_plausible_tracking] do %>
<script
defer

@ -4,7 +4,7 @@
<p class="mt-2 text-sm leading-5 text-gray-500 dark:text-gray-200">
Define actions that you want your users to take, like visiting a certain page, submitting a form, etc.
</p>
<p :if={full_build?()} class="text-sm leading-5 text-gray-500 dark:text-gray-200">
<p :if={ee?()} class="text-sm leading-5 text-gray-500 dark:text-gray-200">
You can also <a
href={Routes.site_path(@conn, :settings_funnels, @site.domain)}
class="text-indigo-500 underline"

@ -42,12 +42,12 @@
</.styled_link>
<br />
<span :if={full_build?()}>
<span :if={ee?()}>
Still not working?
<.styled_link new_tab href="https://plausible.io/contact">Contact us</.styled_link>
and we will help you with your setup
</span>
<span :if={small_build?()}>
<span :if={ce_build?()}>
Still not working? Ask on our
<.styled_link new_tab href="https://github.com/plausible/analytics/discussions">
community-supported forum

@ -4,7 +4,7 @@ defmodule PlausibleWeb.ErrorView do
def render("500.json", %{conn: %{assigns: %{plugins_api: true}}}) do
contact_support_note =
on_full_build do
on_ee do
"If the problem persists please contact support@plausible.io"
end

@ -41,7 +41,7 @@ defmodule PlausibleWeb.LayoutView do
end
def logo_path(filename) do
if full_build?() do
if ee?() do
Path.join("/images/ee/", filename)
else
Path.join("/images/ce/", filename)
@ -54,7 +54,7 @@ defmodule PlausibleWeb.LayoutView do
%{key: "People", value: "people", icon: :users},
%{key: "Visibility", value: "visibility", icon: :eye},
%{key: "Goals", value: "goals", icon: :check_circle},
on_full_build do
on_ee do
%{key: "Funnels", value: "funnels", icon: :funnel}
end,
%{key: "Custom Properties", value: "properties", icon: :document_text},

@ -91,7 +91,7 @@ defmodule Plausible.Workers.ExportCSV do
# right now custom config is used in tests only (to access the minio container)
# ideally it would be passed via the s3 url
# but ExAws.S3.upload is hard to make work with s3 urls
if Mix.env() in [:test, :small_test] do
if Mix.env() in [:test, :ce_test] do
defp s3_config_overrides(args) do
if config_overrides = args["s3_config_overrides"] do
Enum.map(config_overrides, fn {k, v} -> {String.to_existing_atom(k), v} end)

@ -10,7 +10,7 @@ defmodule Plausible.MixProject do
version: System.get_env("APP_VERSION", "0.0.1"),
elixir: "~> 1.14",
elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() in [:prod, :small],
start_permanent: Mix.env() in [:prod, :ce],
aliases: aliases(),
deps: deps(),
test_coverage: [
@ -51,10 +51,10 @@ defmodule Plausible.MixProject do
defp elixirc_paths(env) when env in [:test, :dev],
do: ["lib", "test/support", "extra/lib"]
defp elixirc_paths(env) when env in [:small_test, :small_dev],
defp elixirc_paths(env) when env in [:ce_test, :ce_dev],
do: ["lib", "test/support"]
defp elixirc_paths(:small), do: ["lib"]
defp elixirc_paths(:ce), do: ["lib"]
defp elixirc_paths(_), do: ["lib", "extra/lib"]
# Specifies your project dependencies.
@ -68,7 +68,7 @@ defmodule Plausible.MixProject do
{:bamboo_smtp, "~> 4.1"},
{:bamboo_mua, "~> 0.1.4"},
{:bcrypt_elixir, "~> 3.0"},
{:bypass, "~> 2.1", only: [:dev, :test, :small_test]},
{:bypass, "~> 2.1", only: [:dev, :test, :ce_test]},
{:ecto_ch, "~> 0.3"},
{:cloak, "~> 1.1"},
{:cloak_ecto, "~> 1.2"},
@ -77,15 +77,15 @@ defmodule Plausible.MixProject do
{:credo, "~> 1.5", only: [:dev, :test], runtime: false},
{:csv, "~> 2.3"},
{:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false},
{:double, "~> 0.8.0", only: [:test, :small_test]},
{:double, "~> 0.8.0", only: [:test, :ce_test]},
{:ecto, "~> 3.11.0"},
{:ecto_sql, "~> 3.11.0"},
{:envy, "~> 1.1.1"},
{:eqrcode, "~> 0.1.10"},
{:ex_machina, "~> 2.3", only: [:dev, :test, :small_dev, :small_test]},
{:ex_machina, "~> 2.3", only: [:dev, :test, :ce_dev, :ce_test]},
{:excoveralls, "~> 0.10", only: :test},
{:finch, "~> 0.16.0"},
{:floki, "~> 0.35.0", only: [:dev, :test, :small_dev, :small_test]},
{:floki, "~> 0.35.0", only: [:dev, :test, :ce_dev, :ce_test]},
{:fun_with_flags, "~> 1.11.0"},
{:fun_with_flags_ui, "~> 1.0"},
{:locus, "~> 2.3"},
@ -94,7 +94,7 @@ defmodule Plausible.MixProject do
{:jason, "~> 1.3"},
{:kaffy, "~> 0.10.2", only: [:dev, :test, :staging, :prod]},
{:location, git: "https://github.com/plausible/location.git"},
{:mox, "~> 1.0", only: [:test, :small_test]},
{:mox, "~> 1.0", only: [:test, :ce_test]},
{:nanoid, "~> 2.1.0"},
{:nimble_totp, "~> 1.0"},
{:oban, "~> 2.17.0"},
@ -109,7 +109,7 @@ defmodule Plausible.MixProject do
{:phoenix_view, "~> 2.0"},
{:phoenix_ecto, "~> 4.0"},
{:phoenix_html, "~> 3.3", override: true},
{:phoenix_live_reload, "~> 1.2", only: [:dev, :small_dev]},
{:phoenix_live_reload, "~> 1.2", only: [:dev, :ce_dev]},
{:phoenix_pubsub, "~> 2.0"},
{:phoenix_live_view, "~> 0.18"},
{:php_serializer, "~> 2.0"},
@ -134,14 +134,14 @@ defmodule Plausible.MixProject do
{:joken, "~> 2.5"},
{:paginator, git: "https://github.com/duffelhq/paginator.git"},
{:scrivener_ecto, "~> 2.0"},
{:esbuild, "~> 0.7", runtime: Mix.env() in [:dev, :small_dev]},
{:tailwind, "~> 0.2.0", runtime: Mix.env() in [:dev, :small_dev]},
{:esbuild, "~> 0.7", runtime: Mix.env() in [:dev, :ce_dev]},
{:tailwind, "~> 0.2.0", runtime: Mix.env() in [:dev, :ce_dev]},
{:ex_json_logger, "~> 1.4.0"},
{:ecto_network, "~> 1.5.0"},
{:ex_aws, "~> 2.5"},
{:ex_aws_s3, "~> 2.5"},
{:sweet_xml, "~> 0.7.4"},
{:testcontainers, "~> 1.6", only: [:test, :small_test]},
{:testcontainers, "~> 1.6", only: [:test, :ce_test]},
{:zstream, "~> 0.6.4"},
{:con_cache, "~> 1.0"}
]

@ -20,7 +20,7 @@ defmodule Plausible.UsersTest do
end
describe "on_trial?" do
@describetag :full_build_only
@describetag :ee_only
test "is true with >= 0 trial days left" do
user = insert(:user)
@ -41,7 +41,7 @@ defmodule Plausible.UsersTest do
end
describe "update_accept_traffic_until" do
@describetag :full_build_only
@describetag :ee_only
test "update" do
user = insert(:user) |> User.start_trial() |> Repo.update!()
# 30 for trial + 14

@ -154,7 +154,7 @@ defmodule Plausible.BillingTest do
refute Repo.reload!(site).locked
end
@tag :full_build_only
@tag :ee_only
test "updates accept_traffic_until" do
user = insert(:user)
@ -228,7 +228,7 @@ defmodule Plausible.BillingTest do
refute Repo.reload!(site).locked
end
@tag :full_build_only
@tag :ee_only
test "updates accept_traffic_until" do
user = insert(:user)
subscription = insert(:subscription, user: user)
@ -359,7 +359,7 @@ defmodule Plausible.BillingTest do
end
describe "subscription_payment_succeeded" do
@tag :full_build_only
@tag :ee_only
test "updates accept_traffic_until" do
user = insert(:user)
subscription = insert(:subscription, user: user)

@ -307,7 +307,7 @@ defmodule Plausible.Billing.PlansTest do
assert Plans.suggest_tier(user) == :growth
end
@tag :full_build_only
@tag :ee_only
test "suggests Business tier for a user who used the Revenue Goals, even when they signed up before Business tier release" do
user = insert(:user, inserted_at: ~N[2023-10-25 10:00:00])
site = insert(:site, members: [user])

@ -4,7 +4,7 @@ defmodule Plausible.Billing.QuotaTest do
alias Plausible.Billing.{Quota, Plans}
alias Plausible.Billing.Feature.{Goals, Props, StatsAPI}
on_full_build do
on_ee do
alias Plausible.Billing.Feature.Funnels
alias Plausible.Billing.Feature.RevenueGoals
end
@ -17,7 +17,7 @@ defmodule Plausible.Billing.QuotaTest do
@v4_1m_plan_id "857101"
describe "site_limit/1" do
@describetag :full_build_only
@describetag :ee_only
test "returns 50 when user is on an old plan" do
user_on_v1 = insert(:user, subscription: build(:subscription, paddle_plan_id: @v1_plan_id))
@ -386,7 +386,7 @@ defmodule Plausible.Billing.QuotaTest do
end
describe "team_member_limit/1" do
@describetag :full_build_only
@describetag :ee_only
test "returns unlimited when user is on an old plan" do
user_on_v1 = insert(:user, subscription: build(:subscription, paddle_plan_id: @v1_plan_id))
user_on_v2 = insert(:user, subscription: build(:subscription, paddle_plan_id: @v2_plan_id))
@ -458,7 +458,7 @@ defmodule Plausible.Billing.QuotaTest do
assert [Props] == Quota.features_usage(user)
end
on_full_build do
on_ee do
test "returns [Funnels] when user/site uses funnels" do
user = insert(:user)
site = insert(:site, memberships: [build(:site_membership, user: user, role: :owner)])
@ -488,7 +488,7 @@ defmodule Plausible.Billing.QuotaTest do
assert [StatsAPI] == Quota.features_usage(user)
end
on_full_build do
on_ee do
test "returns multiple features" do
user = insert(:user)
@ -522,7 +522,7 @@ defmodule Plausible.Billing.QuotaTest do
end
describe "allowed_features_for/1" do
on_full_build do
on_ee do
test "users with expired trials have no access to subscription features" do
user = insert(:user, trial_expiry_date: ~D[2023-01-01])
assert [Goals] == Quota.allowed_features_for(user)
@ -544,7 +544,7 @@ defmodule Plausible.Billing.QuotaTest do
assert [Goals, Props, StatsAPI] == Quota.allowed_features_for(user)
end
on_full_build do
on_ee do
test "returns the enterprise plan features" do
user = insert(:user)

@ -1,10 +1,10 @@
defmodule Plausible.FunnelsTest do
use Plausible.DataCase
@moduletag :full_build_only
@moduletag :ee_only
use Plausible
on_full_build do
on_ee do
alias Plausible.Goals
alias Plausible.Funnels
alias Plausible.Stats

@ -48,7 +48,7 @@ defmodule Plausible.GoalsTest do
assert {"has already been taken", _} = changeset.errors[:event_name]
end
@tag :full_build_only
@tag :ee_only
test "create/2 sets site.updated_at for revenue goal" do
site_1 = insert(:site, updated_at: DateTime.add(DateTime.utc_now(), -3600))
@ -64,7 +64,7 @@ defmodule Plausible.GoalsTest do
:eq
end
@tag :full_build_only
@tag :ee_only
test "create/2 creates revenue goal" do
site = insert(:site)
{:ok, goal} = Goals.create(site, %{"event_name" => "Purchase", "currency" => "EUR"})
@ -73,7 +73,7 @@ defmodule Plausible.GoalsTest do
assert goal.currency == :EUR
end
@tag :full_build_only
@tag :ee_only
test "create/2 returns error when site does not have access to revenue goals" do
user = insert(:user, subscription: build(:growth_subscription))
site = insert(:site, members: [user])
@ -82,7 +82,7 @@ defmodule Plausible.GoalsTest do
Goals.create(site, %{"event_name" => "Purchase", "currency" => "EUR"})
end
@tag :full_build_only
@tag :ee_only
test "create/2 fails for unknown currency code" do
site = insert(:site)
@ -137,7 +137,7 @@ defmodule Plausible.GoalsTest do
assert [] = Goals.for_site(site)
end
on_full_build do
on_ee do
test "goals can be fetched with funnel count preloaded" do
site = insert(:site)

@ -199,7 +199,7 @@ defmodule Plausible.Ingestion.EventTest do
assert dropped.drop_reason == :payment_required
end
@tag :full_build_only
@tag :ee_only
test "saves revenue amount" do
site = insert(:site)
_goal = insert(:goal, event_name: "checkout", currency: "USD", site: site)

@ -171,7 +171,7 @@ defmodule Plausible.Ingestion.RequestTest do
assert request.props["custom2"] == "property2"
end
@tag :full_build_only
@tag :ee_only
test "parses revenue source field from a json string" do
payload = %{
name: "pageview",
@ -187,7 +187,7 @@ defmodule Plausible.Ingestion.RequestTest do
assert Decimal.new("20.2") == amount
end
@tag :full_build_only
@tag :ee_only
test "sets revenue source with integer amount" do
payload = %{
name: "pageview",
@ -206,7 +206,7 @@ defmodule Plausible.Ingestion.RequestTest do
assert Decimal.equal?(amount, Decimal.new("20.0"))
end
@tag :full_build_only
@tag :ee_only
test "sets revenue source with float amount" do
payload = %{
name: "pageview",
@ -225,7 +225,7 @@ defmodule Plausible.Ingestion.RequestTest do
assert Decimal.equal?(amount, Decimal.new("20.1"))
end
@tag :full_build_only
@tag :ee_only
test "parses string amounts into money structs" do
payload = %{
name: "pageview",
@ -244,7 +244,7 @@ defmodule Plausible.Ingestion.RequestTest do
assert Decimal.equal?(amount, Decimal.new("12.3"))
end
@tag :full_build_only
@tag :ee_only
test "ignores revenue data when currency is invalid" do
payload = %{
name: "pageview",
@ -429,7 +429,7 @@ defmodule Plausible.Ingestion.RequestTest do
assert changeset.errors[:request]
end
@tag :full_build_only
@tag :ee_only
test "encodable" do
params = %{
name: "pageview",

@ -3,7 +3,7 @@ defmodule Plausible.Plugins.API.TokenTest do
alias Plausible.Plugins.API.Token
@tag :full_build_only
@tag :ee_only
test "basic token properties" do
t1 = Token.generate()
t2 = Token.generate()
@ -25,23 +25,23 @@ defmodule Plausible.Plugins.API.TokenTest do
end
describe "prefix/0" do
@tag :full_build_only
@tag :ee_only
test "default prefix - full build" do
assert Token.prefix() == "plausible-plugin-test"
end
@tag :small_build_only
@tag :ce_build_only
test "selfhosted prefix" do
assert Token.prefix() == "plausible-plugin-selfhost"
end
@tag :full_build_only
@tag :ee_only
test "prod prefix" do
patch_env(:environment, "prod")
assert Token.prefix() == "plausible-plugin"
end
@tag :full_build_only
@tag :ee_only
test "staging prefix" do
patch_env(:environment, "staging")
assert Token.prefix() == "plausible-plugin-staging"

@ -4,25 +4,25 @@ defmodule Plausible.ReleaseTest do
import ExUnit.CaptureIO
describe "should_be_first_launch?/0" do
@tag :small_build_only
@tag :ce_build_only
test "returns true when self-hosted and no users" do
refute Repo.exists?(Auth.User)
assert Release.should_be_first_launch?()
end
@tag :full_build_only
@tag :ee_only
test "returns false when not self-hosted and has no users" do
refute Repo.exists?(Auth.User)
refute Release.should_be_first_launch?()
end
@tag :full_build_only
@tag :ee_only
test "returns false when not self-hosted and has users" do
insert(:user)
refute Release.should_be_first_launch?()
end
@tag :small_build_only
@tag :ce_build_only
test "returns false when self-hosted and has users" do
insert(:user)
refute Release.should_be_first_launch?()

@ -87,7 +87,7 @@ defmodule Plausible.Site.AdminTest do
action.(conn, [site], %{"email" => current_owner.email})
end
@tag :full_build_only
@tag :ee_only
test "new owner's plan must accommodate the transferred site", %{
conn: conn,
transfer_direct_action: action

@ -51,7 +51,7 @@ defmodule Plausible.Site.CacheTest do
refute Cache.get("site3.example.com", cache_name: test, force?: true)
end
@tag :full_build_only
@tag :ee_only
test "cache caches revenue goals", %{test: test} do
{:ok, _} =
Supervisor.start_link(
@ -83,7 +83,7 @@ defmodule Plausible.Site.CacheTest do
] = Enum.sort_by(cached_goals, & &1.event_name)
end
@tag :full_build_only
@tag :ee_only
test "cache caches revenue goals with event refresh", %{test: test} do
{:ok, _} =
Supervisor.start_link(

@ -32,7 +32,7 @@ defmodule Plausible.Site.Memberships.AcceptInvitationTest do
assert_no_emails_delivered()
end
@tag :full_build_only
@tag :ee_only
test "unlocks the site if it was previously locked" do
site = insert(:site, locked: true, memberships: [])
existing_owner = insert(:user)
@ -86,7 +86,7 @@ defmodule Plausible.Site.Memberships.AcceptInvitationTest do
assert Repo.reload!(owner).trial_expiry_date == nil
end
@tag :full_build_only
@tag :ee_only
test "does not allow transferring to an account without an active subscription" do
current_owner = insert(:user)
site = insert(:site, members: [current_owner])
@ -131,7 +131,7 @@ defmodule Plausible.Site.Memberships.AcceptInvitationTest do
AcceptInvitation.transfer_ownership(site, current_owner)
end
@tag :full_build_only
@tag :ee_only
test "does not allow transferring to and account without suitable plan" do
current_owner = insert(:user)
site = insert(:site, members: [current_owner])
@ -146,7 +146,7 @@ defmodule Plausible.Site.Memberships.AcceptInvitationTest do
AcceptInvitation.transfer_ownership(site, new_owner)
end
@tag :small_build_only
@tag :ce_build_only
test "allows transferring to an account without a subscription on self hosted" do
current_owner = insert(:user)
site = insert(:site, members: [current_owner])
@ -315,7 +315,7 @@ defmodule Plausible.Site.Memberships.AcceptInvitationTest do
)
end
@tag :full_build_only
@tag :ee_only
test "unlocks a previously locked site after transfer" do
site = insert(:site, locked: true, memberships: [])
existing_owner = insert(:user)
@ -405,7 +405,7 @@ defmodule Plausible.Site.Memberships.AcceptInvitationTest do
refute Repo.reload(invitation)
end
@tag :full_build_only
@tag :ee_only
test "does not allow transferring ownership to a non-member user when at team members limit" do
old_owner = insert(:user, subscription: build(:business_subscription))
new_owner = insert(:user, subscription: build(:growth_subscription))
@ -432,7 +432,7 @@ defmodule Plausible.Site.Memberships.AcceptInvitationTest do
)
end
@tag :full_build_only
@tag :ee_only
test "allows transferring ownership to existing site member when at team members limit" do
old_owner = insert(:user, subscription: build(:business_subscription))
new_owner = insert(:user, subscription: build(:growth_subscription))
@ -462,7 +462,7 @@ defmodule Plausible.Site.Memberships.AcceptInvitationTest do
)
end
@tag :full_build_only
@tag :ee_only
test "does not allow transferring ownership when sites limit exceeded" do
old_owner = insert(:user, subscription: build(:business_subscription))
new_owner = insert(:user, subscription: build(:growth_subscription))
@ -486,7 +486,7 @@ defmodule Plausible.Site.Memberships.AcceptInvitationTest do
)
end
@tag :full_build_only
@tag :ee_only
test "does not allow transferring ownership when pageview limit exceeded" do
old_owner = insert(:user, subscription: build(:business_subscription))
new_owner = insert(:user, subscription: build(:growth_subscription))
@ -515,7 +515,7 @@ defmodule Plausible.Site.Memberships.AcceptInvitationTest do
AcceptInvitation.accept_invitation(invitation.invitation_id, new_owner)
end
@tag :full_build_only
@tag :ee_only
test "allow_next_upgrade_override field has no effect when checking the pageview limit on ownership transfer" do
old_owner = insert(:user, subscription: build(:business_subscription))
@ -549,7 +549,7 @@ defmodule Plausible.Site.Memberships.AcceptInvitationTest do
AcceptInvitation.accept_invitation(invitation.invitation_id, new_owner)
end
@tag :full_build_only
@tag :ee_only
test "does not allow transferring ownership when many limits exceeded at once" do
old_owner = insert(:user, subscription: build(:business_subscription))
new_owner = insert(:user, subscription: build(:growth_subscription))

@ -66,7 +66,7 @@ defmodule Plausible.Site.Memberships.CreateInvitationTest do
)
end
@tag :full_build_only
@tag :ee_only
test "returns error when owner is over their team member limit" do
[owner, inviter, invitee] = insert_list(3, :user)
@ -82,7 +82,7 @@ defmodule Plausible.Site.Memberships.CreateInvitationTest do
CreateInvitation.create_invitation(site, inviter, invitee.email, :viewer)
end
@tag :full_build_only
@tag :ee_only
test "allows inviting users who were already invited to other sites, within the limit" do
owner = insert(:user)
@ -107,7 +107,7 @@ defmodule Plausible.Site.Memberships.CreateInvitationTest do
assert {:ok, _} = invite.(site2, "i3@example.com")
end
@tag :full_build_only
@tag :ee_only
test "allows inviting users who are already members of other sites, within the limit" do
[u1, u2, u3, u4] = insert_list(4, :user)
@ -385,7 +385,7 @@ defmodule Plausible.Site.Memberships.CreateInvitationTest do
)
end
@tag :full_build_only
@tag :ee_only
test "does not allow transferring ownership to a non-member user when at team members limit" do
old_owner = insert(:user, subscription: build(:business_subscription))
new_owner = insert(:user, subscription: build(:growth_subscription))
@ -401,7 +401,7 @@ defmodule Plausible.Site.Memberships.CreateInvitationTest do
CreateInvitation.bulk_transfer_ownership_direct([site], new_owner)
end
@tag :full_build_only
@tag :ee_only
test "allows transferring ownership to existing site member when at team members limit" do
old_owner = insert(:user, subscription: build(:business_subscription))
new_owner = insert(:user, subscription: build(:growth_subscription))
@ -420,7 +420,7 @@ defmodule Plausible.Site.Memberships.CreateInvitationTest do
CreateInvitation.bulk_transfer_ownership_direct([site], new_owner)
end
@tag :full_build_only
@tag :ee_only
test "does not allow transferring ownership when sites limit exceeded" do
old_owner = insert(:user, subscription: build(:business_subscription))
new_owner = insert(:user, subscription: build(:growth_subscription))
@ -433,7 +433,7 @@ defmodule Plausible.Site.Memberships.CreateInvitationTest do
CreateInvitation.bulk_transfer_ownership_direct([site], new_owner)
end
@tag :full_build_only
@tag :ee_only
test "exceeding limits error takes precedence over missing features" do
old_owner = insert(:user, subscription: build(:business_subscription))
new_owner = insert(:user, subscription: build(:growth_subscription))

@ -116,7 +116,7 @@ defmodule Plausible.SitesTest do
end
describe "get_for_user/2" do
@tag :full_build_only
@tag :ee_only
test "get site for super_admin" do
user1 = insert(:user)
user2 = insert(:user)

@ -177,13 +177,13 @@ defmodule Plausible.Stats.QueryTest do
assert q.interval == "date"
end
@tag :full_build_only
@tag :ee_only
test "adds sample_threshold :infinite to query struct", %{site: site} do
q = Query.from(site, %{"period" => "30d", "sample_threshold" => "infinite"})
assert q.sample_threshold == :infinite
end
@tag :full_build_only
@tag :ee_only
test "casts sample_threshold to integer in query struct", %{site: site} do
q = Query.from(site, %{"period" => "30d", "sample_threshold" => "30000000"})
assert q.sample_threshold == 30_000_000

@ -87,7 +87,7 @@ defmodule PlausibleWeb.Components.Billing.NoticeTest do
assert rendered =~ "please reach out to the site owner to upgrade their subscription"
end
@tag :full_build_only
@tag :ee_only
test "limit_exceeded/1 when billable user is on trial displays upgrade link" do
me = insert(:user)
@ -104,7 +104,7 @@ defmodule PlausibleWeb.Components.Billing.NoticeTest do
assert rendered =~ "/billing/choose-plan"
end
@tag :full_build_only
@tag :ee_only
test "limit_exceeded/1 when billable user is on an enterprise plan displays support email" do
me =
insert(:user,
@ -126,7 +126,7 @@ defmodule PlausibleWeb.Components.Billing.NoticeTest do
assert rendered =~ "upgrade your subscription"
end
@tag :full_build_only
@tag :ee_only
test "limit_exceeded/1 when billable user is on a business plan displays support email" do
me = insert(:user, subscription: build(:business_subscription))

@ -3,7 +3,7 @@ defmodule PlausibleWeb.AdminAuthControllerTest do
alias Plausible.Release
describe "GET /" do
@describetag :small_build_only
@describetag :ce_build_only
test "disable registration", %{conn: conn} do
insert(:user)
patch_config(disable_registration: true)

@ -4,7 +4,7 @@ defmodule PlausibleWeb.AdminControllerTest do
describe "GET /crm/auth/user/:user_id/usage" do
setup [:create_user, :log_in]
@tag :full_build_only
@tag :ee_only
test "returns 403 if the logged in user is not a super admin", %{conn: conn} do
conn = get(conn, "/crm/auth/user/1/usage")
assert response(conn, 403) == "Not allowed"

@ -727,7 +727,7 @@ defmodule PlausibleWeb.Api.ExternalControllerTest do
assert Map.get(event, :"meta.value") == ["true"]
end
@tag :full_build_only
@tag :ee_only
test "converts revenue values into the goal currency", %{conn: conn, site: site} do
params = %{
name: "Payment",
@ -744,7 +744,7 @@ defmodule PlausibleWeb.Api.ExternalControllerTest do
assert Decimal.equal?(Decimal.new("7.14"), amount)
end
@tag :full_build_only
@tag :ee_only
test "revenue values can be sent with minified keys", %{conn: conn, site: site} do
params = %{
"n" => "Payment",
@ -761,7 +761,7 @@ defmodule PlausibleWeb.Api.ExternalControllerTest do
assert Decimal.equal?(Decimal.new("7.14"), amount)
end
@tag :full_build_only
@tag :ee_only
test "saves the exact same amount when goal currency is the same as the event", %{
conn: conn,
site: site

@ -3,7 +3,7 @@ defmodule PlausibleWeb.Api.ExternalSitesControllerTest do
use PlausibleWeb.ConnCase, async: false
use Plausible.Repo
on_full_build do
on_ee do
setup :create_user
setup %{conn: conn, user: user} do

@ -67,7 +67,7 @@ defmodule PlausibleWeb.Api.ExternalStatsController.AuthTest do
end
describe "super admin access" do
@describetag :full_build_only
@describetag :ee_only
setup %{user: user} do
patch_env(:super_admin_user_ids, [user.id])
end

@ -5,7 +5,7 @@ defmodule PlausibleWeb.Api.InternalController.SyncTest do
describe "PUT /api/:domain/disable-feature" do
setup [:create_user, :log_in]
@tag :full_build_only
@tag :ee_only
test "when the logged-in user is an super-admin", %{conn: conn, user: user} do
site = insert(:site)
patch_env(:super_admin_user_ids, [user.id])

@ -265,7 +265,7 @@ defmodule PlausibleWeb.Api.StatsController.ConversionsTest do
]
end
@tag :full_build_only
@tag :ee_only
test "returns formatted average and total values for a conversion with revenue value", %{
conn: conn,
site: site
@ -306,7 +306,7 @@ defmodule PlausibleWeb.Api.StatsController.ConversionsTest do
]
end
@tag :full_build_only
@tag :ee_only
test "returns revenue goals as custom events if the plan doesn't cover the feature", %{
conn: conn,
site: site,
@ -350,7 +350,7 @@ defmodule PlausibleWeb.Api.StatsController.ConversionsTest do
]
end
@tag :full_build_only
@tag :ee_only
test "returns revenue metrics as nil for non-revenue goals", %{
conn: conn,
site: site

@ -745,7 +745,7 @@ defmodule PlausibleWeb.Api.StatsController.CustomPropBreakdownTest do
]
end
@tag :full_build_only
@tag :ee_only
test "returns revenue metrics when filtering by a revenue goal", %{conn: conn, site: site} do
prop_key = "logged_in"
@ -803,7 +803,7 @@ defmodule PlausibleWeb.Api.StatsController.CustomPropBreakdownTest do
]
end
@tag :full_build_only
@tag :ee_only
test "returns revenue metrics when filtering by many revenue goals with same currency", %{
conn: conn,
site: site

@ -1,9 +1,9 @@
defmodule PlausibleWeb.Api.StatsController.FunnelsTest do
use PlausibleWeb.ConnCase, async: true
use Plausible
@moduletag :full_build_only
@moduletag :ee_only
on_full_build do
on_ee do
@user_id 123
@other_user_id 456

@ -1123,7 +1123,7 @@ defmodule PlausibleWeb.Api.StatsController.MainGraphTest do
end
end
@tag :full_build_only
@tag :ee_only
describe "GET /api/stats/main-graph - total_revenue plot" do
setup [:create_user, :log_in, :create_new_site, :add_imported_data]
@ -1203,7 +1203,7 @@ defmodule PlausibleWeb.Api.StatsController.MainGraphTest do
end
end
@tag :full_build_only
@tag :ee_only
describe "GET /api/stats/main-graph - average_revenue plot" do
setup [:create_user, :log_in, :create_new_site, :add_imported_data]

@ -830,7 +830,7 @@ defmodule PlausibleWeb.Api.StatsController.TopStatsTest do
assert %{"name" => "Conversion rate", "value" => 33.3} in res["top_stats"]
end
@tag :full_build_only
@tag :ee_only
test "returns average and total when filtering by a revenue goal", %{conn: conn, site: site} do
insert(:goal, site: site, event_name: "Payment", currency: "USD")
insert(:goal, site: site, event_name: "AddToCart", currency: "EUR")
@ -873,7 +873,7 @@ defmodule PlausibleWeb.Api.StatsController.TopStatsTest do
} in top_stats
end
@tag :full_build_only
@tag :ee_only
test "returns average and total when filtering by many revenue goals with same currency", %{
conn: conn,
site: site

@ -8,7 +8,7 @@ defmodule PlausibleWeb.AuthControllerSyncTest do
describe "PUT /settings/email" do
setup [:create_user, :log_in]
@tag :small_build_only
@tag :ce_build_only
test "updates email but DOES NOT force reverification when feature disabled", %{
conn: conn,
user: user

@ -526,7 +526,7 @@ defmodule PlausibleWeb.AuthControllerTest do
assert resp =~ "Change email address"
end
@tag :full_build_only
@tag :ee_only
test "shows subscription", %{conn: conn, user: user} do
insert(:subscription, paddle_plan_id: "558018", user: user)
conn = get(conn, "/settings")
@ -534,7 +534,7 @@ defmodule PlausibleWeb.AuthControllerTest do
assert html_response(conn, 200) =~ "monthly billing"
end
@tag :full_build_only
@tag :ee_only
test "shows yearly subscription", %{conn: conn, user: user} do
insert(:subscription, paddle_plan_id: "590752", user: user)
conn = get(conn, "/settings")
@ -542,7 +542,7 @@ defmodule PlausibleWeb.AuthControllerTest do
assert html_response(conn, 200) =~ "yearly billing"
end
@tag :full_build_only
@tag :ee_only
test "shows free subscription", %{conn: conn, user: user} do
insert(:subscription, paddle_plan_id: "free_10k", user: user)
conn = get(conn, "/settings")
@ -550,7 +550,7 @@ defmodule PlausibleWeb.AuthControllerTest do
assert html_response(conn, 200) =~ "N/A billing"
end
@tag :full_build_only
@tag :ee_only
test "shows enterprise plan subscription", %{conn: conn, user: user} do
insert(:subscription, paddle_plan_id: "123", user: user)
@ -561,7 +561,7 @@ defmodule PlausibleWeb.AuthControllerTest do
assert html_response(conn, 200) =~ "yearly billing"
end
@tag :full_build_only
@tag :ee_only
test "shows current enterprise plan subscription when user has a new one to upgrade to", %{
conn: conn,
user: user
@ -585,7 +585,7 @@ defmodule PlausibleWeb.AuthControllerTest do
assert html_response(conn, 200) =~ "yearly billing"
end
@tag :full_build_only
@tag :ee_only
test "renders two links to '/billing/choose-plan` with the text 'Upgrade'", %{conn: conn} do
doc =
get(conn, "/settings")
@ -601,7 +601,7 @@ defmodule PlausibleWeb.AuthControllerTest do
assert text_of_attr(upgrade_link_2, "href") == Routes.billing_path(conn, :choose_plan)
end
@tag :full_build_only
@tag :ee_only
test "renders a link to '/billing/choose-plan' with the text 'Change plan' + cancel link", %{
conn: conn,
user: user
@ -661,7 +661,7 @@ defmodule PlausibleWeb.AuthControllerTest do
refute element_exists?(doc, "#upgrade-or-change-plan-link")
end
@tag :full_build_only
@tag :ee_only
test "renders two links to '/billing/choose-plan' with the text 'Upgrade' for a configured enterprise plan",
%{conn: conn, user: user} do
configure_enterprise_plan(user)
@ -684,7 +684,7 @@ defmodule PlausibleWeb.AuthControllerTest do
Routes.billing_path(conn, :choose_plan)
end
@tag :full_build_only
@tag :ee_only
test "links to '/billing/choose-plan' with the text 'Change plan' for a configured enterprise plan with an existing subscription + renders cancel button",
%{conn: conn, user: user} do
insert(:subscription, paddle_plan_id: @v3_plan_id, user: user)
@ -706,7 +706,7 @@ defmodule PlausibleWeb.AuthControllerTest do
Routes.billing_path(conn, :choose_plan)
end
@tag :full_build_only
@tag :ee_only
test "renders cancelled subscription notice", %{conn: conn, user: user} do
insert(:subscription,
paddle_plan_id: @v4_plan_id,
@ -724,7 +724,7 @@ defmodule PlausibleWeb.AuthControllerTest do
assert notice_text =~ "Upgrade your subscription to get access to your stats again"
end
@tag :full_build_only
@tag :ee_only
test "renders cancelled subscription notice with some subscription days still left", %{
conn: conn,
user: user
@ -746,7 +746,7 @@ defmodule PlausibleWeb.AuthControllerTest do
assert notice_text =~ "Upgrade your subscription to make sure you don't lose access"
end
@tag :full_build_only
@tag :ee_only
test "renders cancelled subscription notice with a warning about losing grandfathering", %{
conn: conn,
user: user
@ -770,7 +770,7 @@ defmodule PlausibleWeb.AuthControllerTest do
"by letting your subscription expire, you lose access to our grandfathered terms"
end
@tag :full_build_only
@tag :ee_only
test "shows invoices for subscribed user", %{conn: conn, user: user} do
insert(:subscription,
paddle_plan_id: "558018",
@ -785,7 +785,7 @@ defmodule PlausibleWeb.AuthControllerTest do
assert html_response(conn, 200) =~ "$22.00"
end
@tag :full_build_only
@tag :ee_only
test "shows 'something went wrong' on failed invoice request'", %{conn: conn, user: user} do
insert(:subscription,
paddle_plan_id: "558018",
@ -811,7 +811,7 @@ defmodule PlausibleWeb.AuthControllerTest do
refute html_response(conn, 200) =~ "Invoices"
end
@tag :full_build_only
@tag :ee_only
test "renders pageview usage for current, last, and penultimate billing cycles", %{
conn: conn,
user: user
@ -876,7 +876,7 @@ defmodule PlausibleWeb.AuthControllerTest do
assert text_of_element(doc, "#custom_events_penultimate_cycle") =~ "Custom events 1"
end
@tag :full_build_only
@tag :ee_only
test "renders pageview usage per billing cycle for active subscribers", %{
conn: conn,
user: user
@ -919,7 +919,7 @@ defmodule PlausibleWeb.AuthControllerTest do
get(conn, "/settings") |> html_response(200) |> assert_cycles_rendered.()
end
@tag :full_build_only
@tag :ee_only
test "penultimate cycle is disabled if there's no usage", %{conn: conn, user: user} do
site = insert(:site, members: [user])
@ -947,7 +947,7 @@ defmodule PlausibleWeb.AuthControllerTest do
assert text_of_element(doc, "#billing_cycle_tab_penultimate_cycle") =~ "Not available"
end
@tag :full_build_only
@tag :ee_only
test "penultimate and last cycles are both disabled if there's no usage", %{
conn: conn,
user: user
@ -982,7 +982,7 @@ defmodule PlausibleWeb.AuthControllerTest do
assert text_of_element(doc, "#billing_cycle_tab_penultimate_cycle") =~ "Not available"
end
@tag :full_build_only
@tag :ee_only
test "when last cycle usage is 0, it's still not disabled if penultimate cycle has usage", %{
conn: conn,
user: user
@ -1016,7 +1016,7 @@ defmodule PlausibleWeb.AuthControllerTest do
refute text_of_element(doc, "#billing_cycle_tab_penultimate_cycle") =~ "Not available"
end
@tag :full_build_only
@tag :ee_only
test "renders last 30 days pageview usage for trials and non-active/free_10k subscriptions",
%{
conn: conn,
@ -1072,7 +1072,7 @@ defmodule PlausibleWeb.AuthControllerTest do
get(conn, "/settings") |> html_response(200) |> assert_usage.()
end
@tag :full_build_only
@tag :ee_only
test "renders sites usage and limit", %{conn: conn, user: user} do
insert(:subscription, paddle_plan_id: @v3_plan_id, user: user)
insert(:site, members: [user])
@ -1086,7 +1086,7 @@ defmodule PlausibleWeb.AuthControllerTest do
assert site_usage_row_text =~ "Owned sites 1 / 50"
end
@tag :full_build_only
@tag :ee_only
test "renders team members usage and limit", %{conn: conn, user: user} do
insert(:subscription, paddle_plan_id: @v4_plan_id, user: user)
@ -1099,7 +1099,7 @@ defmodule PlausibleWeb.AuthControllerTest do
assert team_member_usage_row_text =~ "Team members 0 / 3"
end
@tag :full_build_only
@tag :ee_only
test "renders team member usage without limit if it's unlimited", %{conn: conn, user: user} do
insert(:subscription, paddle_plan_id: @v3_plan_id, user: user)

@ -1,6 +1,6 @@
defmodule PlausibleWeb.ErrorReportControllerTest do
use PlausibleWeb.ConnCase, async: true
@moduletag :full_build_only
@moduletag :ee_only
use Bamboo.Test

@ -85,7 +85,7 @@ defmodule PlausibleWeb.Site.InvitationControllerTest do
assert new_owner_membership.role == :owner
end
@tag :full_build_only
@tag :ee_only
test "fails when new owner has no plan", %{conn: conn, user: user} do
old_owner = insert(:user)
site = insert(:site, members: [old_owner])
@ -101,7 +101,7 @@ defmodule PlausibleWeb.Site.InvitationControllerTest do
"No existing subscription"
end
@tag :full_build_only
@tag :ee_only
test "fails when new owner's plan is unsuitable", %{conn: conn, user: user} do
old_owner = insert(:user)
site = insert(:site, members: [old_owner])

@ -21,7 +21,7 @@ defmodule PlausibleWeb.Site.MembershipControllerTest do
refute element_exists?(html, ~s/button[type=submit][disabled]/)
end
@tag :full_build_only
@tag :ee_only
test "display a notice when is over limit", %{conn: conn, user: user} do
memberships = [
build(:site_membership, user: user, role: :owner) | build_list(5, :site_membership)
@ -54,7 +54,7 @@ defmodule PlausibleWeb.Site.MembershipControllerTest do
assert redirected_to(conn) == "/#{URI.encode_www_form(site.domain)}/settings/people"
end
@tag :full_build_only
@tag :ee_only
test "fails to create invitation when is over limit", %{conn: conn, user: user} do
memberships = [
build(:site_membership, user: user, role: :owner) | build_list(5, :site_membership)

@ -303,7 +303,7 @@ defmodule PlausibleWeb.SiteControllerTest do
assert_no_emails_delivered()
end
@tag :full_build_only
@tag :ee_only
test "does not allow site creation when the user is at their site limit", %{
conn: conn,
user: user

@ -78,7 +78,7 @@ defmodule PlausibleWeb.StatsControllerTest do
end
describe "GET /:website - as a super admin" do
@describetag :full_build_only
@describetag :ee_only
setup [:create_user, :make_user_super_admin, :log_in]
test "can view a private dashboard with stats", %{conn: conn} do

@ -1,6 +1,6 @@
defmodule PlausibleWeb.Live.ChoosePlanTest do
use PlausibleWeb.ConnCase, async: true
@moduletag :full_build_only
@moduletag :ee_only
import Phoenix.LiveViewTest
import Plausible.Test.Support.HTML

@ -1,6 +1,6 @@
defmodule PlausibleWeb.Live.FunnelSettings.FormTest do
use PlausibleWeb.ConnCase, async: true
@moduletag :full_build_only
@moduletag :ee_only
import Phoenix.LiveViewTest
import Plausible.Test.Support.HTML

@ -1,9 +1,9 @@
defmodule PlausibleWeb.Live.FunnelSettingsTest do
use PlausibleWeb.ConnCase, async: true
use Plausible
@moduletag :full_build_only
@moduletag :ee_only
on_full_build do
on_ee do
import Phoenix.LiveViewTest
import Plausible.Test.Support.HTML

@ -26,7 +26,7 @@ defmodule PlausibleWeb.Live.GoalSettings.FormTest do
describe "Goal submission" do
setup [:create_user, :log_in, :create_site]
@tag :full_build_only
@tag :ee_only
test "renders form fields (with currency)", %{conn: conn, site: site} do
lv = get_liveview(conn, site)
html = render(lv)
@ -46,7 +46,7 @@ defmodule PlausibleWeb.Live.GoalSettings.FormTest do
assert name_of(page_path) == "goal[page_path]"
end
@tag :small_build_only
@tag :ce_build_only
test "renders form fields (no currency)", %{conn: conn, site: site} do
lv = get_liveview(conn, site)
html = render(lv)
@ -87,7 +87,7 @@ defmodule PlausibleWeb.Live.GoalSettings.FormTest do
assert html =~ "Custom Event"
end
@tag :full_build_only
@tag :ee_only
test "creates a revenue goal", %{conn: conn, site: site} do
lv = get_liveview(conn, site)
refute render(lv) =~ "SampleRevenueGoal"
@ -115,7 +115,7 @@ defmodule PlausibleWeb.Live.GoalSettings.FormTest do
describe "Combos integration" do
setup [:create_user, :log_in, :create_site]
@tag :full_build_only
@tag :ee_only
test "currency combo works", %{conn: conn, site: site} do
lv = get_liveview(conn, site)

@ -6,7 +6,7 @@ defmodule PlausibleWeb.Live.GoalSettingsTest do
describe "GET /:website/settings/goals" do
setup [:create_user, :log_in, :create_site]
@tag :full_build_only
@tag :ee_only
test "lists goals for the site and renders links", %{conn: conn, site: site} do
{:ok, [g1, g2, g3]} = setup_goals(site)
conn = get(conn, "/#{site.domain}/settings/goals")
@ -25,7 +25,7 @@ defmodule PlausibleWeb.Live.GoalSettingsTest do
assert resp =~ "Revenue Goal"
end
@tag :full_build_only
@tag :ee_only
test "lists Revenue Goals with feature availability annotation if the plan does not cover them",
%{conn: conn, user: user, site: site} do
{:ok, [_, _, g3]} = setup_goals(site)

@ -15,7 +15,7 @@ defmodule PlausibleWeb.Live.SitesTest do
assert text(html) =~ "You don't have any sites yet"
end
@tag :full_build_only
@tag :ee_only
test "renders ownership transfer invitation for a case with no plan", %{
conn: conn,
user: user
@ -37,7 +37,7 @@ defmodule PlausibleWeb.Live.SitesTest do
assert get_in(invitation_data, ["invitations", invitation.invitation_id, "no_plan"])
end
@tag :full_build_only
@tag :ee_only
test "renders ownership transfer invitation for a case with exceeded limits", %{
conn: conn,
user: user
@ -65,7 +65,7 @@ defmodule PlausibleWeb.Live.SitesTest do
"site limit"
end
@tag :full_build_only
@tag :ee_only
test "renders ownership transfer invitation for a case with missing features", %{
conn: conn,
user: user

@ -35,7 +35,7 @@ defmodule PlausibleWeb.Plugins.API.Controllers.CustomPropsTest do
end
describe "business tier" do
@describetag :full_build_only
@describetag :ee_only
test "fails on custom prop enable attempt with insufficient plan", %{
site: site,
token: token,

@ -46,7 +46,7 @@ defmodule PlausibleWeb.Plugins.API.Controllers.GoalsTest do
end
describe "business tier" do
@tag :full_build_only
@tag :ee_only
test "fails on revenue goal creation attempt with insufficient plan", %{
site: site,
token: token,
@ -72,7 +72,7 @@ defmodule PlausibleWeb.Plugins.API.Controllers.GoalsTest do
|> assert_schema("PaymentRequiredError", spec())
end
@tag :full_build_only
@tag :ee_only
test "fails on bulk revenue goal creation attempt with insufficient plan", %{
site: site,
token: token,
@ -155,7 +155,7 @@ defmodule PlausibleWeb.Plugins.API.Controllers.GoalsTest do
assert [%{event_name: "Signup"}] = Plausible.Goals.for_site(site)
end
@tag :full_build_only
@tag :ee_only
test "creates a revenue goal", %{conn: conn, token: token, site: site} do
url = Routes.plugins_api_goals_url(PlausibleWeb.Endpoint, :create)
@ -193,7 +193,7 @@ defmodule PlausibleWeb.Plugins.API.Controllers.GoalsTest do
assert [%{event_name: "Purchase", currency: :EUR}] = Plausible.Goals.for_site(site)
end
@tag :full_build_only
@tag :ee_only
test "fails to create a revenue goal with unknown currency", %{
conn: conn,
token: token,
@ -222,7 +222,7 @@ defmodule PlausibleWeb.Plugins.API.Controllers.GoalsTest do
assert [%{detail: "currency: is invalid"}] = resp.errors
end
@tag :full_build_only
@tag :ee_only
test "edge case - revenue goal exists under the same name and different currency", %{
conn: conn,
token: token,
@ -306,7 +306,7 @@ defmodule PlausibleWeb.Plugins.API.Controllers.GoalsTest do
end
describe "put /goals - bulk creation" do
@tag :full_build_only
@tag :ee_only
test "creates a goal of each type", %{conn: conn, token: token, site: site} do
url = Routes.plugins_api_goals_url(PlausibleWeb.Endpoint, :create)
@ -398,7 +398,7 @@ defmodule PlausibleWeb.Plugins.API.Controllers.GoalsTest do
} in resp.errors
end
@tag :full_build_only
@tag :ee_only
test "is idempotent", %{conn: conn, token: token, site: site} do
url = Routes.plugins_api_goals_url(PlausibleWeb.Endpoint, :create)
@ -433,7 +433,7 @@ defmodule PlausibleWeb.Plugins.API.Controllers.GoalsTest do
|> assert_schema("Goal.ListResponse", spec())
end
@tag :full_build_only
@tag :ee_only
test "edge case - revenue goals exist under the same name and different currency", %{
conn: conn,
token: token,
@ -479,7 +479,7 @@ defmodule PlausibleWeb.Plugins.API.Controllers.GoalsTest do
assert %{errors: [%{detail: "Invalid integer. Got: string"}]} = resp
end
@tag :full_build_only
@tag :ee_only
test "retrieves revenue goal by ID", %{conn: conn, site: site, token: token} do
{:ok, goal} =
Plausible.Goals.create(site, %{"event_name" => "Purchase", "currency" => "EUR"})
@ -557,7 +557,7 @@ defmodule PlausibleWeb.Plugins.API.Controllers.GoalsTest do
assert resp.meta.pagination.links == %{}
end
@tag :full_build_only
@tag :ee_only
test "returns a list of goals of each possible goal type", %{
conn: conn,
site: site,

@ -1,6 +1,6 @@
defmodule PlausibleWeb.FirstLaunchPlugTest do
use PlausibleWeb.ConnCase
@moduletag :small_build_only
@moduletag :ce_build_only
import Plug.Test
alias PlausibleWeb.FirstLaunchPlug

@ -6,10 +6,10 @@ FunWithFlags.enable(:imports_exports)
FunWithFlags.enable(:shield_pages)
Ecto.Adapters.SQL.Sandbox.mode(Plausible.Repo, :manual)
if Mix.env() == :small_test do
IO.puts("Test mode: SMALL")
ExUnit.configure(exclude: [:slow, :minio, :full_build_only])
if Mix.env() == :ce_test do
IO.puts("Test mode: Community Edition")
ExUnit.configure(exclude: [:slow, :minio, :ee_only])
else
IO.puts("Test mode: FULL")
ExUnit.configure(exclude: [:slow, :minio, :small_build_only])
IO.puts("Test mode: Enterprise Edition")
ExUnit.configure(exclude: [:slow, :minio, :ce_build_only])
end

@ -4,7 +4,7 @@ defmodule Plausible.Workers.AcceptTrafficUntilTest do
alias Plausible.Workers.AcceptTrafficUntil
@moduletag :full_build_only
@moduletag :ee_only
test "does not send any notifications when sites have no stats" do
today = Date.utc_today()

Loading…
Cancel
Save