fsprojects-archive / zzarchive-VisualFSharpPowerTools

[ARCHIVED] Power commands for F# in Visual Studio
http://fsprojects.github.io/VisualFSharpPowerTools/
Apache License 2.0
310 stars 77 forks source link

split gotodefinition tests in input/expected files #1452

Closed smoothdeveloper closed 7 years ago

smoothdeveloper commented 7 years ago

refactor gotodefinition tests (37 refactored over 57, 20 remaining needs another pass of extraction or manual extraction)

1444

dungpa commented 7 years ago

Looks much better (than current master).

Conceptually the expected files should be signature files (*.fsi).

IMO a folder for each test is a bit overkill. We can have a flat structure with three files for each test:

<test_case>.input.fs <test_case>.expected.fsi <test_case>.settings.json

It's your choice though.

smoothdeveloper commented 7 years ago

The folder (I agree the nesting is abit annoying) simplifies the iteration in the implementation. I'd rather keep it as is for now but can change if someone else also prefer a flat layout.

I should be looking at printing a proper diff at some point also.

cloudRoutine commented 7 years ago

I agree with @dungpa, it would be nicer without all the sub-directories

For the iteration just group by substring before the first . then use a recursive loop to pattern match by the file extension and put the paths into a record which you use to provide the params to your test function. Easy peasy :wink:

smoothdeveloper commented 7 years ago

I'm still considering maintenance pain, and it feels that adding a new test is easier by copying a directory than manually naming three files.

Would it make sense to keep the directories in this regard?

cloudRoutine commented 7 years ago

take a list of all the test names and write a lil script to generate the files, you'll be done in a min or two. Having them all in the same directory make sit easier to include them in the fsproject as non compile files so they can be reviewed/searched in VS

smoothdeveloper commented 7 years ago

We can make a csproj and a wildcard for content files so the proj files never changes, it works with subfolders too.

smoothdeveloper commented 7 years ago

And it takes more than a minute or two to pull out the correct script here :smile: sorry!

cloudRoutine commented 7 years ago

don't add the csproj, it's not worth it

smoothdeveloper commented 7 years ago

@dungpa / @cloudRoutine I'll take the idea of no subfolders for later refactorings in other areas, I'd like to focus on more interesting stuff after layground work :smile:

@vasily-kirichenko I just changed the items you mentioned.

cloudRoutine commented 7 years ago

@smoothdeveloper why is /tests/data/gotodef/generic-sample still left in?

Have you tried running all of the directory based tests in parallel?

smoothdeveloper commented 7 years ago

@cloudRoutine the generic-sample folder contains the sample json file (used for JsonProvider).

I haven't tried to make the test run in parallel.