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

check for docker availability #2110

Closed
mvysny opened this issue Nov 28, 2019 · 5 comments · Fixed by #2605
Closed

check for docker availability #2110

mvysny opened this issue Nov 28, 2019 · 5 comments · Fixed by #2605

Comments

@mvysny
Copy link
Contributor

mvysny commented Nov 28, 2019

It would be good to have a way to check whether Docker is actually available or not, as a simple static boolean function, e.g. public static boolean DockerClient.isDockerAvailable(). That would allow us to use JUnit/TestNG-specific ways to skip tests which require docker containers.

@mvysny mvysny closed this as completed Nov 28, 2019
@mvysny mvysny reopened this Jan 23, 2020
@mvysny
Copy link
Contributor Author

mvysny commented Jan 23, 2020

There is a similar feature request here: #343 . However, this feature request is much simpler.

@stale
Copy link

stale bot commented Apr 23, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this is a mistake, please reply to this comment to keep it open. If there isn't one already, a PR to fix or at least reproduce the problem in a test case will always help us get back on track to tackle this.

@mvysny
Copy link
Contributor Author

mvysny commented Apr 23, 2020

The PR #2605 can be used as follows: DockerClientFactory.instance().isDockerAvailable().

@stale stale bot removed the stale label Apr 23, 2020
@harryarora26
Copy link

In java one can use the following:

try {
	DockerClientFactory.instance().client();
} catch (Exception e) {
      	Assert.fail(e.getMessage());
}

jglick added a commit to jglick/saml-plugin that referenced this issue Mar 8, 2021
kuisathaverat pushed a commit to jenkinsci/saml-plugin that referenced this issue Mar 12, 2021
* Sketch of LiveTest

* Got an incremental deployment

* testcontainers/testcontainers-java#2110 (comment)

* A bit more debug info printed

* JTH bump

* Was missing the urn:oasis:names:tc:SAML:2.0:bindings: prefix on binding

* Updating comment to reflect current stumper

* Apparently including lots of XML in SamlSecurityRealm.toString() causes Jetty to silently refuse to serve 302s, maybe due to Stapler-Trace headers or something?

* Forgot to update current failure

* Fixed WebClient mistakes; now failing with the same error as ATH!

* Need to go back to redirecting after logging in

* Fixed a CCE also observed in ATH

* jenkinsci/jenkins-test-harness#281 released

* authenticationOKFromURL

* authenticationOKPostBinding

* authenticationFail

* Formatting tweaks
@jkosternl
Copy link

For others searching for a similar solution, this works in the current version of TestContainers:
@Testcontainers(disabledWithoutDocker = true)
The unit tests are skipped without errors.

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 a pull request may close this issue.

3 participants