{"id":49225914,"url":"https://github.com/jaqx0r/itestcontainer","last_synced_at":"2026-06-03T06:00:44.856Z","repository":{"id":327650846,"uuid":"1110227146","full_name":"jaqx0r/itestcontainer","owner":"jaqx0r","description":"A runner shim for launching container images with bazel's `rules_itest`","archived":false,"fork":false,"pushed_at":"2026-06-01T18:42:02.000Z","size":203,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-01T20:26:35.737Z","etag":null,"topics":["bazel","container","integration-testing","itest"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaqx0r.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-04T22:22:07.000Z","updated_at":"2026-06-01T18:42:05.000Z","dependencies_parsed_at":"2026-03-23T23:00:28.614Z","dependency_job_id":null,"html_url":"https://github.com/jaqx0r/itestcontainer","commit_stats":null,"previous_names":["jaqx0r/itestcontainer"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/jaqx0r/itestcontainer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaqx0r%2Fitestcontainer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaqx0r%2Fitestcontainer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaqx0r%2Fitestcontainer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaqx0r%2Fitestcontainer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaqx0r","download_url":"https://codeload.github.com/jaqx0r/itestcontainer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaqx0r%2Fitestcontainer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33850627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bazel","container","integration-testing","itest"],"created_at":"2026-04-24T07:05:52.951Z","updated_at":"2026-06-03T06:00:44.838Z","avatar_url":"https://github.com/jaqx0r.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# itestcontainer\n\n`itestcontainer` is a runner shim invoked by [`rules_itest`](https://github.com/dzbarsky/rules_itest)'s [`itest_service`](https://github.com/dzbarsky/rules_itest/blob/master/docs/itest.md#itest_service) as an `exe` to launch a container image as the system under test.\n\nExample:\n\n```skylark\nload(\"@rules_img//img:image.bzl\", \"image_manifest\")\nload(\"@rules_img//img:load.bzl\", \"image_load\")\nload(\"@rules_itest//:itest.bzl\", \"itest_service\", \"itest_task\", \"named_port\")\n\nplatform(\n    name = \"host_docker_platform\",\n    constraint_values = [\"@platforms//os:linux\"],  # linux OS inside docker host\n    parents = [\"@platforms//host\"],  # use host CPU\n)\n\n# Construct a Postgresql for the container host\nimage_manifest(\n    name = \"pg_image\",\n    base = \"@postgresql\",\n    platform = \":host_docker_platform\",\n)\n\n# An executable target to load the image into the container host\nimage_load(\n    name = \"load_pg_image\",\n    image = \":pg_image\",\n    tag = \"pg_image:latest\",\n)\n\n# A task that invokes the previous executable target\nitest_task(\n    name = \"load_pg_image_task\",\n    testonly = True,\n    exe = \":load_pg_image\",\n)\n\n# The service under test, which depends on the load task to load the image, and then invokes `itestcontainer` to run the image with the provided options.\nitest_service(\n    name = \"sut\",\n    testonly = True,\n    args = [\n        # Name of the image to start\n        \"--name=pg_image:latest\",\n        # Environment variables to pass through to the container\n        \"--env=POSTGRES_USER,POSTGRES_PASSWORD,POSTGRES_DB\",\n        # Ports to expose from the container, using `rules_test`'s helper macro\n        \"--ports=\" + named_port(\"//:sut\", \"db\") + \":5432\",\n        # --labels\n        # --volume\n    ],\n    env = {\n        \"POSTGRES_USER\": \"postgres\",\n        \"POSTGRES_PASSWORD\": \"postgres\",\n        \"POSTGRES_DB\": \"postgres\",\n    },\n    exe = \"@com_github_jaqx0r_itestcontainer//:itestcontainer\",\n    named_ports = [\n        \"db\",\n    ],\n    deps = [\":load_pg_image_task\"],\n)\n\n```\n\nUse the Go Tools Pattern to include `itestcontainer` into your dependencies.\n\nSee [`test/tools.go`](test/tools.go) and the rest of the test directory for a full example.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaqx0r%2Fitestcontainer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaqx0r%2Fitestcontainer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaqx0r%2Fitestcontainer/lists"}