XUnit skipping all tests
Asked Answered
A

1

10

i have problem with xunit, its skipping all tests without any message or error, i'm using ubuntu 20.04 but on windows 10 i have the same problem

michael@michael-System-Product-Name:~/gradebook$ cd test
michael@michael-System-Product-Name:~/gradebook/test$ mkdir GradeBook.Test
michael@michael-System-Product-Name:~/gradebook/test$ cd GradeBook.Test
michael@michael-System-Product-Name:~/gradebook/test/GradeBook.Test$ sudo dotnet new xunit
[sudo] password for michael: 
Getting ready...
The template "xUnit Test Project" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on /home/michael/gradebook/test/GradeBook.Test/GradeBook.Test.csproj...
  Determining projects to restore...
  Restored /home/michael/gradebook/test/GradeBook.Test/GradeBook.Test.csproj (in 548 ms).
Restore succeeded.

michael@michael-System-Product-Name:~/gradebook/test/GradeBook.Test$ sudo dotnet test
  Determining projects to restore...
  All projects are up-to-date for restore.
  GradeBook.Test -> /home/michael/gradebook/test/GradeBook.Test/bin/Debug/net5.0/GradeBook.Test.dll
Test run for /home/michael/gradebook/test/GradeBook.Test/bin/Debug/net5.0/GradeBook.Test.dll (.NETCoreApp,Version=v5.0)
Microsoft (R) Test Execution Command Line Tool Version 16.8.3
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.

Passed!  - Failed:     0, Passed:     1, Skipped:     0, Total:     1, Duration: 1 ms - /home/michael/gradebook/test/GradeBook.Test/bin/Debug/net5.0/GradeBook.Test.dll (net5.0)
Aphesis answered 28/1, 2021 at 16:49 Comment(8)
That didn't skip any - it ran 1 test, which passed. (I question why you're using sudo to run dotnet new though.)Missie
@jonskeet anything that ive wrote in this test pass(skips) , even when condition are impossible to met, like 3 equals 5, im using sudo because nothing worked so far :(Aphesis
"Passes" and "skips" are not the same thing at all. Your output clearly shows that no tests are being skipped, and one test is passing - which is what I'd expect given that you've just created a new test project. You haven't shown a failing test, or indeed any sign of editing the tests at all. Please put some time into clarifying your question.Missie
@jonskeet oh... i was too hurry to post this thread, youre right, sorry for trouble, i've lots of problem with junit and thought this will be the sameAphesis
As simple as it is, I made exactly the same reading comprehension error. Luckily this was was the first google hit for "xunit skipping all tests". Thanks all.Colorific
Yes, this output is not clear at the end of a long day. They really should change it.Nihilism
OMG I'm back here again 18 months later and just caught myself reading back my own comment ^^.Colorific
Made the same reading misstake. ಥ_ಥNonbelligerent
M
48

Been there, done that. It's just an optical illusion :)

Passed!  - Failed:     0, Passed:     1, Skipped:     0, Total:     1, ...

Try to read that line again. It says Passed! And the passed number of tests were 1. The skipped number of tests were actually 0. It's just that our eyes read what's close together.

Mahican answered 8/9, 2021 at 12:39 Comment(5)
This is horrible, lolLutetium
UGH I fell for it...Dzerzhinsk
I feel like we need a counter on here. I fell in this hole too :DBobine
i hate my life;Chincapin
Well, there is that. This UI could use some improvements.Liquidate

© 2022 - 2024 — McMap. All rights reserved.