Dexter
I would like to run tests which are written in different files by calling mix test.
For example test1.exs, test2.exs, …
The ExUnit.start options are [trace: true, seed: 0 , exclude: :skipped] because the test must run in a given order.
It would be nice to include these files by some options or by calling them out of ProjectnameTest. Then I would be able to exclude tests by excluding a complete file.
Now I’m running them by calling them in a script with mix run test1.exs …
But this is not what we want because be would like this configuration in elixir centrally.
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
Using Phoenix.LiveView.TagEngine as an EEx.Engine is deprecated!
To compile HEEx, use Phoenix.LiveView.TagEngine.compile/2 instead.
Sta...
New
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app?
Looking for hints regarding:
Addi...
New
Hi all, I wanted to ask how the community is dealing with post-release steps.
Today we have Ecto migrations, which make sure that the db...
New
I am using Oban and occasionally, shortly after a deployment, a handful of jobs can fail because of dependency on other parts of the syst...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
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
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #phoenix_html
- #iex
- #graphql
- #genstage
- #ai
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #performance










First 10 of 11 Posts
benwilson512
You can do:
and it will run all tests in that path. Is that not working for you?
Dexter
No because the file are executed in random order. The option seed: 0 disables the random order only inside the file.
We are running integration tests for a system for which we have written a simulator to communicate with. Therefore we have dependencies like StartUp test has to run first.
I guess at the end of day we will have hundreds of tests where some of them will have strict dependencies. It will be very messy to write all tests in one single file.
Also we would like to sort the tests into categories to be able to activate or deactivate a special type of test.
I know you can do that also with @tag :skipped but this is also not very elegant in our case.
radar
Do you have some example code that we could look at? Talking about it using just words is not as good as using words+code. I really think it’ll help our understanding of this issue.
Dexter
I don’t get your point.
It has nothing to do with my code because the test are running if I put them in one file with the option seed: 0 and async: false. I “just” want to be able to run them in a given order.
The test should run for example in the following order.
radar
You’re asking us to give you the solution for Y but you may need the X solution. I don’t think I have enough info on your problem to know for certain. This is why I asked for code.
If something seems hard to do then it can be because how you’re attempting it isn’t the right way.
Dexter
We are not testing elixir code.
We have written a simulator in elixir which is communicating via serial interface with a device. The code of this divece is c++ -code.
The simulator simulates a motor control.
Now I would like to test this device via the serial interface.
If that device sends a message an event is triggered and we are checking if this was the right event.
It can not be compared to elixir unit tests.
Till now we have just some dummy tests. First we have to solve the above-mentioned problem.
bitboxer
If you are not writing tests for your elixir code, why then do you try to use
mix testfor it instead of an elixir script that you would callserial port tester´or something like that?benwilson512
Agreeing with @bitboxer here, it sounds like you are using the wrong tool for the job.
mix testis for testing against Elixir code. As a rule it is very bad practice to have order dependent tests because such tests are extremely brittle as they rely on quite a lot of invisible implicit state.Dexter
I fully agree that tests should run independently. But in our cases we have start up test which have to run first.
Nevertheless thank you for the discussion.
I’ve to learn the ropes of scripting in elixir.
alfert
You can also write a regular Elixir application, where the application start function orchestrates the test execution. And if helpful, you can use the supervision structure to achieve more reliability.