Skip to content

Commit

Permalink
(#3489) Explicitly set repository optimizations
Browse files Browse the repository at this point in the history
The WireMock.Net Server is setup to reply to requests made when _NOT_
using repository optimizations, so let's make sure that we are using
that configuration explicitly.  It was found that when running all the
integration tests together, this value could be set to true elsewhere,
which then causes tests here to fail. This is far from ideal, and the
Configuration should have been reset when starting this scenario
but for now, let's explicitly set to false, as this is what we know the
WireMock.Net server will respond with.
  • Loading branch information
gep13 committed Aug 26, 2024
1 parent 71811a2 commit dd1de8f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/chocolatey.tests.integration/scenarios/UpgradeScenarios.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4982,6 +4982,16 @@ public override void Context()
// Set configuration to prevent re-use of cached HTTP Requests
Configuration.CacheExpirationInMinutes = -1;

// The WireMock.Net Server is setup to reply to requests made when _NOT_
// using repository optimizations, so let's make sure that we are using
// that configuration explicitly. It was found that when running all
// the integration tests together, this value could be set to true
// elsewhere, which then causes tests here to fail. This is far from ideal,
// and the Configuration should have been reset when starting this scenario
// but for now, let's explicitly set to false, as this is what we know
// the WireMock.Net server will respond with.
Configuration.Features.UsePackageRepositoryOptimizations = false;

_wireMockServer.Given(
Request.Create().WithPath("/api/v2/").UsingGet()
)
Expand Down

0 comments on commit dd1de8f

Please sign in to comment.