Skip to content

Make behave tests to start containers with port-forward to run tests in non-Linux machines #51

@ricardozanini

Description

@ricardozanini

Describe the solution you'd like
As youn may know, host networking driver won't work on Windows or Mac:

The host networking driver only works on Linux hosts, and is not supported on Docker Desktop for Mac, Docker Desktop for Windows, or Docker EE for Windows Server.

Hence, behave tests requiring checks like check that page is served won't work since the client won't connect to the container.

A simple workaround we could implement is adding a --port-forwarding to the command line to make Cekit start the container in a random port by default (to avoid clashing when running in parallel).

Additional context
An implementation idea:

cekit --descriptor image.yaml test behave --port-forwarding :8080

Would forward a local random port to 8080.

cekit --descriptor image.yaml test behave --port-forwarding 9090:8080

Would forward the local 9090 port to 8080.

I can send a PR if you agree to implement this feature.

Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions