Code Monkey home page Code Monkey logo

vscode-elixir-test-explorer's Introduction

Elixir Test Adapter

Requirements

Elixir version >= v1.11 (Line and file information was added in v1.11, so this extension won't work with earlier versions)

Features

Shows Elixir tests in a sidebar. Scans all your elixir projects in your workspace.

NOTE: It also works with a multi-workspace environment.

Settings

This extension contributes the following settings:

  • elixirTestExplorer.enable: enable/disable this extension

Elixir Test Explorer

Changelog

See Changelog here

Issues

Submit the issues if you find any bug or have any suggestion.

Contribution

Fork the repo and submit pull requests.

vscode-elixir-test-explorer's People

Contributors

adamzapasnik avatar bengro avatar dependabot[bot] avatar michal-turzynski avatar micheletogni avatar mward-sudo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

vscode-elixir-test-explorer's Issues

Handle umbrella projects

Get them from apps folder and create ExUnit instance for each separately?

For now projectDir can be used as a quick half-fix.

ETA Next Friday/Weekend ๐Ÿ˜“

Adapter fails if there are warnings

Hey! Thanks for making this, we desperately need this in the elixir world!

I'm having an issue which I think is unintended. Whenever there are any warnings in my code, it doesn't find any tests. It returns a error on the discovery part of the testing:

Command failed: mix test --trace --seed=0 --only="" 
warning: variable "owner" is unused (if the variable is not meant to be used, prefix it with an underscore)
  test/myapp/my_test.exs:37: MyApp.MyTest."test anything"/1

The --only option was given to "mix test" but no test was executed

The testing pane doesn't show any tests at this point, just ExUnit:Error when I remove the warning it works.

Feature request: filtering results by their state

I have a couple of projects with 1000+ tests and it's a little bit hard to scroll to where it's breaking. In IntelliJ they have this nice feature to filter tests by state, so basically i can set it "only show failed" to only see the relevant things failing.

This would make a great addition imho.

also, thanks for this great plugin! :)

--only : Missing argument of type keep

Hi @adamzapasnik, first of all - huge thanks for the extension ๐Ÿ˜Š

I am experiencing the following problem when the extension loads test cases:

image

Output:

** (Mix) Could not invoke task "test": 1 error found!
--only : Missing argument of type keep

Also, when I execute the following command mix test --trace --seed=0 --only="", I get exactly same result.

The following command works just fine though:
mix test --trace --seed=0 --only="___" ( "_" could be replaced with something else that wouldn't match any tests, e.g. ! or *)
Result of the above command:

Finished in 0.2 seconds (0.2s async, 0.00s sync)
51 tests, 0 failures, 51 excluded

My versions:

Erlang/OTP 24 [erts-12.1.5] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit]
Elixir 1.13.4 (compiled with Erlang/OTP 22)

Any ideas what might be wrong here?

Option to automatically run tests on file save

It would be really nice to be able to automatically run all of the tests every time a file is saved. This saves a few keystrokes with each change and keeps you up to date on test status.

Failing tests are green

This is a killer extension! Thanks for developing it.

I noticed that the plugin renders failing tests are passing.

Observation:
A test is green, I change assertions to make it fail, I rerun the tests using the plugin, the tests remain green.
When I run the same test with the command line, the test indeed fails.

https://recordit.co/pDfdaNeE2f

If the test name has new line, Test Explorer failed to the initialization

If you set test name like in test file:

test """
       Some
newline
test
       """,

image

will cause the following error.

Error: TypeError: Cannot read properties of null (reading '0')

The result of mix test --trace --seed=0 --only="" looks like following:

SomeTest [test/some_test.exs]
  * test Some
newline
test [L#40]

So the extension failed to parse the test trace log.

could not compile dependency :connection

Hello, the plugin seems to not work on my umbrella project. The command mix test --trace --seed=0 --only="" works on my terminal but I got an error on visual studio.

It works find with a regular new phoenix project.

Do you have an idea of what's wrong ?

Best regards

Command failed: mix test --trace --seed=0 --only=""
could not compile dependency :connection, "mix compile" failed. You can recompile this dependency with "mix deps.compile connection", update it with "mix deps.update connection" or clean it with "mix deps.clean connection"
** (CaseClauseError) no case clause matching: {:repaired, #Reference<0.1377449741.605028358.52651>, {:recovered, 636}, {:badbytes, 0}}
    (stdlib 3.15.1) ets.erl:808: :ets.tab2file/3
    (mix 1.12.1) lib/mix/compilers/application_tracer.ex:193: Mix.Compilers.ApplicationTracer.write_manifest/2
    (mix 1.12.1) lib/mix/compilers/application_tracer.ex:14: Mix.Compilers.ApplicationTracer.init/1
    (mix 1.12.1) lib/mix/compilers/elixir.ex:81: Mix.Compilers.Elixir.compile/6
    (mix 1.12.1) lib/mix/task.ex:394: anonymous fn/3 in Mix.Task.run_task/3
    (mix 1.12.1) lib/mix/tasks/compile.all.ex:90: Mix.Tasks.Compile.All.run_compiler/2
    (mix 1.12.1) lib/mix/tasks/compile.all.ex:70: Mix.Tasks.Compile.All.compile/4
    (mix 1.12.1) lib/mix/tasks/compile.all.ex:57: Mix.Tasks.Compile.All.with_logger_app/2

Elixir 1.14.0 support

Since upgrading to Elixir 1.14.0 from 1.13.4 the Elixir Test Explorer extension is failing (displaying ExUnitTest: Error in the UI) and is logging the following error:

Error: TypeError: Cannot read property '0' of null

This may be related to Issue #7

Versions:

Erlang 25.0.4
Elixir 1.14.0-otp-25

Output from mix test --trace --seed=0 --only=""

Excluding tags: [:test, :pending]
Including tags: [:""]


CaptainsLogTest [test/captains_log_test.exs]
  * test random_planet_class it always returns one of the letters: D, H, J, K, L, M, N, R, T, Y (excluded) [L#6]
  * test random_planet_class it will eventually return each of the letters at least once (excluded) [L#15]
  * test random_ship_registry_number start with "NCC-" (excluded) [L#33]
  * test random_ship_registry_number ends with a random integer between 1000 and 9999 (excluded) [L#38]
  * test random_stardate is a float (excluded) [L#57]
  * test random_stardate is equal to or greater than 41_000.0 (excluded) [L#62]
  * test random_stardate is less than 42_000.0 (excluded) [L#69]
  * test random_stardate consecutive calls return floats with different fractional parts (excluded) [L#76]
  * test random_stardate returns floats with fractional parts with more than one decimal place (excluded) [L#87]
  * test format_stardate returns a string (excluded) [L#100]
  * test format_stardate formats floats (excluded) [L#105]
  * test format_stardate rounds floats to one decimal place (excluded) [L#110]
  * test format_stardate does not accept integers (excluded) [L#115]
All tests have been excluded.

Finished in 0.05 seconds (0.00s async, 0.05s sync)
13 tests, 0 failures, 13 excluded

Randomized with seed 0
The --only option was given to "mix test" but no test was executed

For comparison, using Elixir 1.13.4-otp25, which works correctly:

Excluding tags: [:test, :pending]
Including tags: [:""]


CaptainsLogTest [test/captains_log_test.exs]
  * test random_planet_class it always returns one of the letters: D, H, J, K, L, M, N, R, T, Y (excluded) [L#6]
  * test random_planet_class it will eventually return each of the letters at least once (excluded) [L#15]
  * test random_ship_registry_number start with "NCC-" (excluded) [L#33]
  * test random_ship_registry_number ends with a random integer between 1000 and 9999 (excluded) [L#38]
  * test random_stardate is a float (excluded) [L#57]
  * test random_stardate is equal to or greater than 41_000.0 (excluded) [L#62]
  * test random_stardate is less than 42_000.0 (excluded) [L#69]
  * test random_stardate consecutive calls return floats with different fractional parts (excluded) [L#76]
  * test random_stardate returns floats with fractional parts with more than one decimal place (excluded) [L#87]
  * test format_stardate returns a string (excluded) [L#100]
  * test format_stardate formats floats (excluded) [L#105]
  * test format_stardate rounds floats to one decimal place (excluded) [L#110]
  * test format_stardate does not accept integers (excluded) [L#115]


Finished in 0.05 seconds (0.00s async, 0.05s sync)
13 tests, 0 failures, 13 excluded

Randomized with seed 0
The --only option was given to "mix test" but no test was executed

The only difference being that 1.14.0 includes the following line directly below the list of tests:

All tests have been excluded.

Configure Test Command?

Is it possible to configure the test command? E.g. I need to execute the test command within the context of something else like nix-shell ; mix test?

Error: TypeError: Cannot read property '0' of null

Hey folks,
All I see in the test explorer is this:
image

and the "output" when I click on that is this: Error: TypeError: Cannot read property '0' of null

let me know what kind of config I can give you to help debug - I don't even know where to start other than the output.

mix test works just fine in the terminal ๐Ÿคท๐Ÿฝ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.