Creating a testcontainer for Jenkins Update Center

31 views
Skip to first unread message

Oleg Nenashev

unread,
Oct 20, 2021, 10:05:04 AM10/20/21
to Jenkins Developers
Hi all,

I am currently working on improving plugin management flows in Plugin Installation Manager, Custom WAR Packager and Jenkinsfile Runner. All repositories depend on Jenkins update centers and download sites in some configurations. Currently we run some integration tests against production update centers, and some use Mocked versions. Both these options are not ideal, because they either rely on external environment or use a simplified model.

I would like to introduce new integration tests that provision the Jenkins Update Center in a container for a test, with necessary caching between tests to improve performance. https://www.testcontainers.org/ provides such feature, and I would like to use this library instead of our in-house Docker Fixtures.

A few questions:
  • Would anyone else be interesting in creating such a TestContainer? It might be useful for some integration tests in the Jenkins core and plugins, e.g. multi-site-update-center plugin
  • Would we be fine w.r.t building a Dockerized version of the Update Center as a part of the https://github.com/jenkins-infra/update-center2 deployment flow? It would allow to ship update center images for each release/deployment, and it could help users who want to deploy local update centers but do not want to maintain everything on their own
    • If not, I would like to ask for a permission to create a new repository within jenkinsci
And a few more strategic questions:
  • What would everyone say about introducing dependency on testcontainers into Jenkins Test Harness directly? It is already used in multiple plugins, and it seems to be a better way for new development than our Docker Fixtures
  • Should we go ahead and deprecate Docker Fixtures in favor of Testcontainers?
Best regards,
Oleg Nenashev

Jesse Glick

unread,
Oct 21, 2021, 12:43:04 PM10/21/21
to Jenkins Dev
On Wed, Oct 20, 2021 at 10:05 AM Oleg Nenashev <o.v.ne...@gmail.com> wrote:
  • What would everyone say about introducing dependency on testcontainers into Jenkins Test Harness directly?
Why would you need that when you can already add such a test dep yourself?
  • Should we go ahead and deprecate Docker Fixtures in favor of Testcontainers?
It already basically is, if not formally: https://github.com/jenkinsci/docker-fixtures#overview If you feel like actually filing PRs to replace existing usages, go ahead. 

Oleg Nenashev

unread,
Oct 22, 2021, 9:53:55 AM10/22/21
to Jenkins Developers
W.r.t Docker Fixtures, a while ago I tried hacking a wrapper so that it uses testcontainers under the hood. Hit the timebox but I can look for this PR.
Anyway, just replacing integrations in plugins would be nice.

> Why would you need that when you can already add such a test dep yourself?

In the current form there are a few upper-bounds warning which may make experience for developers not that great.
Anyway, we indeed need clear benefits for including test-containers, e.g. a number of Jenkins implementations (e.g. SSH Agent or Update Center or maybe even Jenkins core for realistic tests)

Jesse Glick

unread,
Oct 22, 2021, 2:42:58 PM10/22/21
to Jenkins Dev
On Fri, Oct 22, 2021 at 9:53 AM Oleg Nenashev <o.v.ne...@gmail.com> wrote:
W.r.t Docker Fixtures, a while ago I tried hacking a wrapper so that it uses testcontainers under the hood.

Seems risky. Probably suffices to just incrementally rewrite the relatively modest number of existing uses.

Why would you need that when you can already add such a test dep yourself?

In the current form there are a few upper-bounds warning

Feel free to file a patch for `plugin-pom` to pin a known-working version, with an IT demonstrating that it can be used.

we indeed need clear benefits for including test-containers, e.g. a number of Jenkins implementations (e.g. SSH Agent

Perhaps. `jenkins/inbound-agent` is awkward to use with Docker because of networking. I am not aware of plugins successfully using Testcontainers for agents yet.
 
maybe even Jenkins core for realistic tests

Reply all
Reply to author
Forward
0 new messages