mirror of
https://github.com/plausible/analytics.git
synced 2024-11-22 02:27:57 +03:00
Only test clickhouse functions
This commit is contained in:
parent
539fe44e70
commit
e12784031a
@ -69,25 +69,10 @@ defmodule Plausible.Ingestion.AcquisitionTest do
|
||||
for {test_data, index} <- Enum.with_index(@static_tests, 1) do
|
||||
@tag test_data: test_data
|
||||
test "static test #{index} - #{Jason.encode!(test_data)}", %{test_data: test_data} do
|
||||
assert reference_channel(test_data) == test_data.expected
|
||||
assert clickhouse_channel(test_data) == test_data.expected
|
||||
end
|
||||
end
|
||||
|
||||
def reference_channel(test_data) do
|
||||
request = %{
|
||||
query_params: %{
|
||||
"utm_medium" => test_data[:utm_medium],
|
||||
"utm_campaign" => test_data[:utm_campaign],
|
||||
"utm_source" => test_data[:utm_source],
|
||||
"gclid" => if(test_data[:click_id_source] == "Google", do: "123", else: nil),
|
||||
"msclkid" => if(test_data[:click_id_source] == "Bing", do: "123", else: nil)
|
||||
}
|
||||
}
|
||||
|
||||
Plausible.Ingestion.Acquisition.get_channel(request, test_data[:referrer_source])
|
||||
end
|
||||
|
||||
def clickhouse_channel(test_data) do
|
||||
%{rows: [[channel]]} =
|
||||
Plausible.IngestRepo.query!(
|
||||
|
Loading…
Reference in New Issue
Block a user