YoloDev / YoloDev.Expecto.TestSdk

31 stars 18 forks source link

Jump to source not working #107

Open EspenBrun opened 2 years ago

EspenBrun commented 2 years ago

Hello,

I noticed that "Jump to source" from the test explorer does not work. Is it possible to fix this? Or if it is already supported, add the steps needed to the readme.

Either way, thanks for creating this! So good to have be able to run Expecto tests in Rider.

Alxandr commented 2 years ago

I think it's theoretically possible. I looked into it many years ago but deemed it not worth the effort. If someone wants to fix it, feel free to create a PR though.

EspenBrun commented 2 years ago

Ok, thanks for the reply.

Numpsy commented 9 months ago

Hi,

I'm not sure if this is exactly the same situation or just similar, but -

If I have this test code

[<Tests>]
let tests =
  testList "samples" [
    testCase "universe exists (╭ರᴥ•́)" <| fun _ ->
      let subject = true
      Expect.isTrue subject "I compute, therefore I am."

    testTask "I am (should fail)" {
      "╰〳 ಠ 益 ಠೃ 〵╯" |> Expect.equal true false
    }
  ]

Then both tests appear in the Visual Studio 2022 test explorer, but the testCase has source information and the right click go to test menu works: image

but the testTask says No source available and go to test doesn't work: image

Based on the previous comments I'm not sure how much this is expected to work though?

Alxandr commented 9 months ago

Based on the previous comments I'm not sure how much this is expected to work though?

I do not either 😅. I'm actually more surprised that you get source information for the test case. That being said, just to let you know the state of this repo, I've not used F# nor Expecto in years (beyond maintaining this repo). So while I do spend some effort keeping this repo up to date with dependencies, and try to fix bugs that show up, don't expect new features to show up without somebody contributing them. In this case, I don't even know what a testTask is.

That being said, given that you have a use-case where you have one node with source information, and one without, it should be possible to debug your way to what's different between the two.

Numpsy commented 9 months ago

I don't even know what a testTask is

It's for testing Task based async code (though there isn;t any async in the minimal example).

I'll have a go at debugging it.

Numpsy commented 8 months ago

Ok, I tried debugging just the Expecto side, and it looks like the Expecto getLocation function, as called from

https://github.com/YoloDev/YoloDev.Expecto.TestSdk/blob/626777d62cfd2a1f147c838b9cfd431cb65aa1b0/src/YoloDev.Expecto.TestSdk/discovery.fs#L14

doesn't seem to be returning anything useful for either test tasks or test theories, the if the adaptor is depending on that then maybe the issue is in Expecto rather than here.

Alxandr commented 8 months ago

That's very possible. I've not looked at how this is handled in years, so I don't have much recollection of it. Don't expect me to fix this, though if you want to work on it, I'm more than happy to look at PRs and similar.