emacstheviking

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 :frowning:

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

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… :expressionless:

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.

Where Next?

Popular in Questions Top

mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New

Other popular topics Top

senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

We're in Beta

About us Mission Statement