sandeshsoni

sandeshsoni

Can I test a project from outside the project?

Suppose I have a legacy rails or node-js or java project.
I will write a separate new project for tests. I will check all the tests pass.
Then I write a new elixir project and just change endpoint of test.
If all tests pass, I can finally switch.

years ago I have already done it before for a client… writing test in node-js and app was in Rails. It was possible because everything was through REST APIs.

Are there any advancements where I can be sitting in an Elixir project and test validations of Rails app? or test a completely another Elixir project?

It might be difficult to explain.
But think of directory structure like this.

  • A Backend app (API / GraphQL) build using Rails or Elixir
  • A test app built using Elixir
  • A frontend end that connects through REST or GraphQL
  • A Mobile app.

As of now I am thinking to build a GraphQL app and another project outside will test this GraphQL project without access to internals. Open to suggestions on how to keep test project Independent and outside main project.

Most Liked

ityonemo

ityonemo

This might not be the best solution but the trivial solution is

test "integration" do
  assert {_, 0} = System.cmd("mix", ["test"], cd: "/path/to/other/project")
end

Replace with test command for other languages as you see fit. Nicely, the elixir VM will be running and active while you run this test.

Don’t forget to increase the test timeout if the slow languages take more than 60s to test everything, especially in CI

Where Next?

Popular in Questions Top

shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
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
Tee
can someone please explain to me how Enum.reduce works with maps
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
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
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
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New

Other popular topics Top

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
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
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
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
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
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New

We're in Beta

About us Mission Statement