Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Log Message when running within Docker context #149

Open
SlaterCodes opened this issue Oct 10, 2023 · 1 comment
Open

Error Log Message when running within Docker context #149

SlaterCodes opened this issue Oct 10, 2023 · 1 comment

Comments

@SlaterCodes
Copy link

I am running integration tests within a docker compose file (windows OS running linux containers) - integration tests are hitting API endpoints and connecting to a postgres instance running within the context for a fully contained integration test run.

The tests are running, and passing or failing as I would expect them to. I do find this warning happening within the logs a bit worrying and hoping they don't cause issues down the line as the test suite grows more complex. So not a blocking issue but wondering if my config complexity grows it may eventually emerge as an issue.

Section of docker compose:

  integrationtest:
    profiles:
      - test
    image: mcr.microsoft.com/dotnet/sdk:7.0
    depends_on:
      - postgresql
    environment:
      - ASPNETCORE_ENVIRONMENT=Docker
    volumes:
      - .:/src
    command: [ "dotnet", "test", "/src" ]
services-integrationtest-1  | [red]Invalid usage[/][yellow]Unknown argument or flag for value --ENVIRONMENT=Docker[/]
services-integrationtest-1  | run - Start and run this .Net application
services-integrationtest-1  | └── Start and run this .Net application
services-integrationtest-1  |     └── dotnet run -- run
services-integrationtest-1  |         ├── [-c, --check]
services-integrationtest-1  |         ├── [-e, --environment <environment>]
services-integrationtest-1  |         ├── [-v, --verbose]
services-integrationtest-1  |         ├── [-l, --log-level
services-integrationtest-1  |         │   Trace|Debug|Information|Warning|Error|Critical|None]
services-integrationtest-1  |         └── [--config:<prop> <value>]

I am creating the host like below:

public async Task InitializeAsync()
        {
            // Start the web host immediately
            OaktonEnvironment.AutoStartHost = true;

            // Get a Host of the Integration App under test
            Host = await AlbaHost.For<T>();
}

in this case is the Program.cs file of whichever service I am testing ( I have 3-4 microservices using this shared helper ). Dotnet7.

The error message is repeated for every scenario I make an API request with the AlbaHost such as opts.Get.Url($"/api/v1/myApi") in a scenario.

@SlaterCodes SlaterCodes changed the title Error when running within Docker context Error Log Message when running within Docker context Oct 10, 2023
@jeremydmiller
Copy link
Member

That is annoying, and I get that occasionally too. It's from the WebApplicationFactory passing in arguments that don't fit Oakton's signature here and there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants