In AshSql: lib/expr.ex, in maybe_type_expr/6
, I added the following debug statements:
other ->
dbg(query)
dbg(other)
dbg(bindings)
dbg(embedded?)
dbg(acc)
dbg(type)
In AshSql: lib/expr.ex, in maybe_type_expr/6
, I added the following debug statements:
other ->
dbg(query)
dbg(other)
dbg(bindings)
dbg(embedded?)
dbg(acc)
dbg(type)
defmodule TestReporter do | |
# Why: This is useful for tracking down intermittent errors and output in tests. | |
# What: Reports the test that ran in the test suite, in the order that they ran, and includes each test's ordinal number | |
# in the order of the test's finish time. | |
# | |
# Usage: | |
# 1. Save this file to `tests/support` or anywhere it'll get picked up by the Elixir compiler. | |
# 2. In test_helper.ex, add this GenServer as an ExUnit formater, like this: | |
# `ExUnit.start(exclude: [:external], formatters: [ExUnit.CLIFormatter, TestReporter])` | |
# 3. Run the test suite. At the end of the run, it will list all the tests that ran, in the order that they ran. |
#!/bin/sh | |
# Example: | |
# gclean master | |
trunk="$1" | |
if [ -z "${trunk}" ]; then | |
echo "Usage: $0 TRUNK" | |
exit 2 | |
fi |
defmodule MoxleyApiUtil.TypescriptInterfaceGenerator do | |
alias OpenApiSpex.Schema | |
def to_ts_interface(%Schema{type: :object} = schema) do | |
header = "interface #{schema.title} {" | |
body = Enum.map(schema.properties, &to_ts_property_line/1) |> Enum.join("\n") | |
header <> "\n" <> body <> "\n}\n" | |
end | |
defp to_ts_property_line({name, schema}) do |
defmodule MyApp.Repo.Migrations.InitialSchema do | |
use Ecto.Migration | |
def up do | |
db = Application.fetch_env!(:my_app, MyApp.Repo) | |
file_path = "priv/repo/initial_schema.sql" | |
{output, errno} = | |
System.cmd( | |
"psql", |
Error message:
[error] GenServer #PID<0.1901.0> terminating
** (MatchError) no match of right hand side value: :external
(phoenix_live_view) lib/phoenix_live_view/channel.ex:152: Phoenix.LiveView.Channel.call_mount_handle_params/2
(phoenix_live_view) lib/phoenix_live_view/channel.ex:443: Phoenix.LiveView.Channel.verified_mount/9
(stdlib) gen_server.erl:637: :gen_server.try_dispatch/4
(stdlib) gen_server.erl:711: :gen_server.handle_msg/6
(stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message: {:mount, Phoenix.LiveView.Channel}
defmodule DialyzerTest do | |
def call(map) when is_map(map) do | |
with :ok <- validate_1(map[:value_1]), | |
:ok <- validate_2(map[:value_2]) do | |
:ok | |
else | |
{:error, reason} -> | |
# lib/dialyzer_test.ex:10:exact_eq | |
# The test :bad_value_2 == :bad_value_1 can never evaluate to 'true'. | |
if !map[:required] && reason == :bad_value_1 do |
(UndefinedFunctionError) function MyApp.FooController.init/1 is undefined or private
The problem is that your test module is named the same as your controller. Instead, it should have Test
appended to the end of the module name.
Oh noes! Are you getting an error reported by dialyzer that is related to a mix.exs dependency, and you want to modify the dependency to try to change the behavior?
With a regular dependency, let's say you modify a file inside of deps/foo/*
. Run the following:
mix deps.compile foo
mix dialyzer.build && mix dialyzer
With a dependency specified with the file: ...
option, you only need:
#!/bin/sh -e | |
# Run this script as root | |
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y locales | |
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ | |
dpkg-reconfigure --frontend=noninteractive locales && \ | |
update-locale LANG=en_US.UTF-8 | |
ENV LANG en_US.UTF-8 |