sfrances

sfrances

PropCheck interfering with escript

I have an application which has PropCheck tests. I am now trying to build a command line for this program. However, when I try to run the built escript, I get the following:

16:50:39.136 [info]  Application propcheck exited: exited in: PropCheck.App.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (UndefinedFunctionError) function Mix.Project.config/0 is undefined (module Mix.Project is not available)
            Mix.Project.config()
            (propcheck 1.4.0) lib/mix.ex:11: PropCheck.Mix.counter_example_file/0
            (propcheck 1.4.0) lib/app.ex:51: PropCheck.App.counter_example_file/0
            (propcheck 1.4.0) lib/app.ex:34: PropCheck.App.populate_application_env/0
            (propcheck 1.4.0) lib/app.ex:12: PropCheck.App.start/2
            (kernel 8.0.2) application_master.erl:293: :application_master.start_it_old/4

16:50:39.150 [info]  Application libgraph exited: :stopped

16:50:39.150 [info]  Application proper exited: :stopped

16:50:39.151 [info]  Application iex exited: :stopped
ERROR! Could not start application propcheck: exited in: PropCheck.App.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (UndefinedFunctionError) function Mix.Project.config/0 is undefined (module Mix.Project is not available)
            Mix.Project.config()
            (propcheck 1.4.0) lib/mix.ex:11: PropCheck.Mix.counter_example_file/0
            (propcheck 1.4.0) lib/app.ex:51: PropCheck.App.counter_example_file/0
            (propcheck 1.4.0) lib/app.ex:34: PropCheck.App.populate_application_env/0
            (propcheck 1.4.0) lib/app.ex:12: PropCheck.App.start/2
            (kernel 8.0.2) application_master.erl:293: :application_master.start_it_old/4

Googling around, I tried adding runtime: false to propcheck’s options in my mix.exs. Now the CLI works fine, but mix test won’t work.

== Compilation error in file test/analytic_tableaux_props_test.exs ==
** (exit) exited in: GenServer.call(PropCheck.CounterStrike, {:counter_example, {AnalyticTableauxPropsTest, :"property_a simple formula proves itself", []}}, 5000)
    ** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started
    (elixir 1.12.2) lib/gen_server.ex:1014: GenServer.call/3
    (propcheck 1.4.0) lib/properties.ex:151: PropCheck.Properties.tag_property/1
    test/analytic_tableaux_props_test.exs:5: (module)
    (stdlib 3.15.2) erl_eval.erl:685: :erl_eval.do_apply/6
    (elixir 1.12.2) lib/kernel/parallel_compiler.ex:428: Kernel.ParallelCompiler.require_file/2
    (elixir 1.12.2) lib/kernel/parallel_compiler.ex:321: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/7

Any help very much appreciated.

Marked As Solved

dimitarvp

dimitarvp

Shooting in the dark here, did you try specifying only: [:dev, :test] in mix.exs? IMO you can delete the runtime: false option.

Also Liked

sfrances

sfrances

Found a solution: if I just put only: [:test] that works. Thanks again.

dimitarvp

dimitarvp

Oh yeah, my mistake. I was thinking about dialyzer and not a testing library. only: [:test] is indeed the right thing to do.

Where Next?

Popular in Questions Top

yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
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
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
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
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3268 119930 1237
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
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
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
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
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 27727 240
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
273 38985 115
New

We're in Beta

About us Mission Statement