dotnetcore-buildpack icon indicating copy to clipboard operation
dotnetcore-buildpack copied to clipboard

Add Heroku Testpack API support

Open jbowtie opened this issue 7 years ago • 7 comments

This adds initial Testpack API support.

I have made a TAP logger for Heroku's preferred output format but it's not required for actual compliance so will defer that to a future pull request.

jbowtie avatar Mar 05 '19 09:03 jbowtie

Hi @jbowtie,

Thank you for your contribution💪

We need to think about how to avoid duplication between compile, test and test-compile

jincod avatar Mar 06 '19 12:03 jincod

I've been looking at how other buildpacks do it and it looks like the typical approach is to have test-compile explicitly set some environment variables and then delegate to compile -- that eliminates the bulk of the duplication.

The test script needs a bit more thought because as currently written it fails to locate the dotnet executable; I need a better understanding of what the environment looks like when it gets invoked.

jbowtie avatar Mar 06 '19 21:03 jbowtie

This should be much clearer with less duplication.

jbowtie avatar Mar 07 '19 23:03 jbowtie

I've been testing this in our Gitlab CI pipeline which runs within the herokuish project. Our project uses the coverlet package for collecting test coverage.

This PR caused the buildpack to correctly build and run the tests. 👍 However, coverlet was unable to properly collect the test coverage - there's something about being built in one directory and then running the tests in a different directory that it doesn't like. I'm not a .NET developer so I was unable to diagnose it further than that.

I was able to make it work properly by moving the dotnet build command from test-compile -> test, like so:

dotnet build $TEST_PROJECT_FILE --configuration Debug
dotnet test -v q --no-build

I'm not sure if I'm doing something wrong or if the setup in this PR isn't generic enough.

stormsilver avatar May 21 '19 21:05 stormsilver

@jbowtie What is needed before this can be merged? Are you able to reproduce @stormsilver 's regarding collecting test coverage?

We've been needing testpack support for quite some time. Is there anything I can do to help get this merged?

@jincod

prat0088 avatar Dec 12 '19 15:12 prat0088

Hi there,

I've merged branch @jbowtie and done some modifications. I decided don't change main compile because it is very stable now and I duplicated compile logic to test-compile.

Also we don't need specify test-project-file. dotnet build and dotnet test should be enough.

Could you check please https://github.com/jincod/dotnetcore-buildpack#jbowtie-add-testpack-api?

jincod avatar Dec 12 '19 18:12 jincod

Hi there,

Could someone help with that https://github.com/jincod/dotnetcore-buildpack/issues/98#issuecomment-577249131?

jincod avatar Jan 23 '20 06:01 jincod