how do I override configuration for integration tests using DistributedApplicationFactory? #8851
Unanswered
chalcolith
asked this question in
Q&A
Replies: 1 comment 13 replies
-
Can't you just set the configuration directly after creating the DistributedApplicationTestingBuilderv via the Configuration property? |
Beta Was this translation helpful? Give feedback.
13 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to override a parameter for integration tests via
DistributedApplicationFactory.OnBuilderCreating()
. However, trying to override the parameter via eitherhostOptions.Args
orhostOptions.Configuration
never works. (For some reason overriding a connection string viaArgs
works, but notConfiguration
.)I have the following Aspire app host code:
Then I have an implementation of
DistributedApplicationFactory
for use with integration tests, where I try to override the parameter in various unsuccessful ways:The parameter is never changed in my web application builder:
I have also tried the equivalent in constructing a
DistributedApplicationTestingBuilder
, with the same results.What am I doing wrong? How can I override a parameter for my integration tests?
Beta Was this translation helpful? Give feedback.
All reactions