emacstheviking
CommonTest help
Apologies for this but…
can anybody point me where to go to get some help with commontest under rebar3 …I have no hair left. I have read the official documentation until it now just looks like colored pixels on my monitor I can absorb no more. I’ve tried google groups, the trap_exit site looks dead ( years since I looked). I don’t know where to turn ![]()
I have never used ct before today… TBH either I am so dumb I don’t get it or it’s way too hard to get working, I’ve read the epgsql code again and again. I want a test suite to be able to drop and recreate a test database.
All I want is for my “application under test” to be able to “application:get_env/2” to work… it’s driving me freaking nuts. I had a bowel cancer op in March, I may well have to quite software engineering as this level of stress isn’t good for me I’m sure.
Thanks
Sean
Marked As Solved
emacstheviking
I woke early with my head full of stuff… anyway, I think I have solved my problem by the simple addition of application:ensure_all_started, making my new working init_per_suite like so:
application:ensure_all_started(scofblog),
{ok, Dbms} = application:get_env(scofblog, dbms),
{ok, C} =
epgsql:connect(
?prop(server, Dbms),
?prop(username, Dbms),
?prop(password, Dbms),
#{database=> "scofblog_test"}
),
[{conn, C}].
I found some code written by a work buddy from my current job, we use Erlang for talking to and from RabbitMQ and also to provide a common library that the Elixir applications use to “get on the bus”…lucky for me there was a -single- SUITE test that had that line in it, kind of obvious once you see it but not yesterday!
So, Robert, thanks for the nudges… a tad gutted I didn’t solve it myself but hell, at least I am moving forwards again, thanks again to everybody that helped a sometimes overly woud-up aging hacker… ![]()
I am still looking for a “solid” and “reliable” way to drop/recreate a test database, currently I create it manually and just truncate the tables to save some time…
Sean Charles.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #javascript
- #podcasts
- #code-sync
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








