Page MenuHomeElementl

Demonstrate using the fixtures in a test suite
ClosedPublic

Authored by jordansanders on Jul 2 2021, 8:12 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 26 2022, 7:46 PM
Unknown Object (File)
Dec 25 2022, 5:44 AM
Unknown Object (File)
Dec 20 2022, 7:26 PM
Unknown Object (File)
Dec 20 2022, 7:46 AM
Unknown Object (File)
Dec 16 2022, 8:42 AM
Unknown Object (File)
Dec 15 2022, 6:03 AM
Unknown Object (File)
Dec 14 2022, 9:42 PM
Unknown Object (File)
Dec 14 2022, 1:37 PM
Subscribers
None

Details

Summary

This shows both how to activate the fixtures (by adding them to the
pytest_plugins variable) and how to use them to write a real test.

If we like this approach, I'll eventually cut over our other uses
of docker-compose which will simplify our .buildkite/ files quite a
bit.

I had to modify the docker compose fixtures to conditionally switch
between "docker-compose" when no context is passed and "docker compose"
when a context is passed - I assume this is a rough edge of the new
docker compose cli? On Docker for Mac, both work with or without a
context. But on Buildkite, the new "docker compose" only works for
certain contexts (like ECS local-simulation) but not for others (like
the default context).

Test Plan

unit

Diff Detail

Repository
R1 dagster
Branch
jordan-docker-compose-fixtures
Lint
Lint Passed
Unit
No Test Coverage

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Jul 2 2021, 8:34 PM
Harbormaster failed remote builds in B33124: Diff 40825!
Harbormaster returned this revision to the author for changes because remote builds failed.Jul 2 2021, 9:07 PM
Harbormaster failed remote builds in B33140: Diff 40845!

This change subsumes D8689. Docker is introducing a new compose CLI that makes compose a command on the normal Docker CLI. This has already been rolled out to Docker for Mac so you can use docker-compose and docker compose interhangeably.

But on Buildkite, I can only get it to work on certain contexts. docker --context foo compose works if foo is an ECS context. It fails because compose isn't a valid command if foo is a default context. The context switching logic isn't particularly sophisticated - it just assumes if you're giving it a context, you're giving it for good reason and it uses the newer syntax. If we do want to support switching non-ECS contexts, we'll need to make this more robust. Hopefully, as the new docker compose CLI continues to mature, Linux and Mac will behave identically where both docker-compose and docker compose can be used interhangeably.

Harbormaster returned this revision to the author for changes because remote builds failed.Jul 6 2021, 1:44 PM
Harbormaster failed remote builds in B33207: Diff 40933!
jordansanders edited the summary of this revision. (Show Details)

Fixup diff description

This revision is now accepted and ready to land.Jul 6 2021, 7:19 PM