Enable classic mode in IIS tests#1462
Conversation
9e709fa to
d449e4e
Compare
49bd1a6 to
7f37aea
Compare
| lock (this) | ||
| { | ||
| if (_iisExpress == null) | ||
| if (_iisExpress.Process == null) |
There was a problem hiding this comment.
Does this allow the two sets of tests to run at the same time? I'd expect only one invocation of this to happen so only either an app pool in Integrated Mode is started or an app pool in Classic Mode is started
There was a problem hiding this comment.
The configuration file is copied to a temporary name, so it shouldn't cause any issue with multiple concurrent executions (at least, no more issues than it did before)
There was a problem hiding this comment.
I'm just surprised that we can execute this multiple times. It looks like if I call TryStartIis(helper, false) followed by TryStartIis(helper, true) then we'd only start IIS Express once in Integrated Mode so we wouldn't be testing Classic Mode
There was a problem hiding this comment.
Yeah but we don't 😛 You have for example public class AspNetWebApi2WithFeatureFlagCallTargetIntegrated and public class AspNetWebApi2WithFeatureFlagCallTargetClassic. They're separate classes, so they don't share the instance of IisFixture
There was a problem hiding this comment.
EDIT: Kevin was too quick for me ☝️
The aspnet tests use an IClassFixture<>. That means the IISFixture is only reused for within-class tests (i.e. theories). As we change mode in different classes, this should work as far as I can tell.
That said, if possible (I'm not sure it is), it might be nice to add a check in the web application itself to assert it's running in the correct mode?
There was a problem hiding this comment.
Ah thanks, my understanding of the class fixtures wasn't accurate. Thanks for clarifying!
|
|
||
| _iisFixture = iisFixture; | ||
| _iisFixture.TryStartIis(this); | ||
| _iisFixture.TryStartIis(this, classicMode: false); |
There was a problem hiding this comment.
We don't want to run this test in classic mode as well?
There was a problem hiding this comment.
This test uses OWIN, so it crashes in classic mode :(
Extend the test matrix to run the IIS test in classic and integrated modes. We can't configure that from the IIS Express command line, so I switched to a templated applicationHost.config file.
I tested first on 1.26.2 to confirm the tests were crashing: https://dev.azure.com/datadoghq/dd-trace-dotnet/_build/results?buildId=64259&view=results