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

feat: allow containers to connect to host machine/dockest inside container support #91

Merged

Conversation

n1ru4l
Copy link
Collaborator

@n1ru4l n1ru4l commented Oct 2, 2019

Closes #79


Currently, the jest helpers are available via dockest/dist/test-helper, ideally that would be dockest/test-helper. This would require an additional build step.

The network name should be randomly generated (as the creation fails in case there already is a network with the given name). The alternative would be to reuse the existing network.

More information can be retrieved from #79

@erikengervall Let me know how you think bout this. 😊

…it is executed inside a container or not.

This is a prerequisite for using dockest inside docker containers. see erikengervall#79
Detect whether dockest is run inside a docker container. Create network and link all runner containers to the dockest container.
Revert option of using a function for setting the host. Automatically set the host to the service name in dockest inside docker container mode.
Example that showcases dockest in docker. Works inside docker container and outside docker container.
… inside docker" and "dockest on docker host" environments.
@n1ru4l n1ru4l force-pushed the feat-host-based-on-container-id branch from 6d1f0a0 to 53a908d Compare October 2, 2019 05:54
@n1ru4l
Copy link
Collaborator Author

n1ru4l commented Oct 2, 2019

@erikengervall Any idea why the build fails? everything seems to exit with 0 🤔The build does not fail on github actions or when run locally 😕

@erikengervall
Copy link
Owner

@erikengervall Any idea why the build fails? everything seems to exit with 0 🤔The build does not fail on github actions or when run locally 😕

No idea why this would fail, especially since everything exits successfully. Hm, could there be some lingering resources that causes issues for Travis?

@erikengervall
Copy link
Owner

erikengervall commented Oct 2, 2019

Found the issue by looking at the most recent GitHub Actions which points out the error much more clearly and actually aborts the tests prematurely:
https://github.com/n1ru4l/dockest/actions
https://github.com/n1ru4l/dockest/runs/244330013

For Travis it can be found at https://travis-ci.com/erikengervall/dockest/builds/130039439#L318. I wonder why it doesn't exit prematurely 😕

The cause anyhow seem to be related to linting around import isDocker from 'is-docker'. Either resolve the issue or feel free to eslint-ignore that particular line for that particular rule.

src/index.ts Outdated Show resolved Hide resolved
Co-Authored-By: Erik Engervall <erik.engervall@gmail.com>
@erikengervall erikengervall merged commit b0daed5 into erikengervall:master Oct 2, 2019
@n1ru4l n1ru4l deleted the feat-host-based-on-container-id branch October 2, 2019 16:46
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

Successfully merging this pull request may close these issues.

allow containers to connect to the host machine
2 participants