{"id":16570985,"url":"https://github.com/opalmer/gerrittest","last_synced_at":"2026-05-19T10:33:42.066Z","repository":{"id":57525937,"uuid":"70410811","full_name":"opalmer/gerrittest","owner":"opalmer","description":"Dockerized Gerrit and also contains library functions for interacting with the test instance.","archived":false,"fork":false,"pushed_at":"2017-10-21T17:04:16.000Z","size":1792,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-16T02:46:53.745Z","etag":null,"topics":["developer-tools","docker","gerrit","gerrit-testing","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opalmer.png","metadata":{"files":{"readme":"README.md","changelog":"change.go","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-09T15:06:31.000Z","updated_at":"2024-05-20T06:03:04.000Z","dependencies_parsed_at":"2022-09-26T18:11:04.899Z","dependency_job_id":null,"html_url":"https://github.com/opalmer/gerrittest","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opalmer%2Fgerrittest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opalmer%2Fgerrittest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opalmer%2Fgerrittest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opalmer%2Fgerrittest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opalmer","download_url":"https://codeload.github.com/opalmer/gerrittest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242039718,"owners_count":20061928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["developer-tools","docker","gerrit","gerrit-testing","go","golang"],"created_at":"2024-10-11T21:20:46.052Z","updated_at":"2026-05-19T10:33:42.016Z","avatar_url":"https://github.com/opalmer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gerrit Testing With Docker\n\n[![Build Status](https://travis-ci.org/opalmer/gerrittest.svg?branch=master)](https://travis-ci.org/opalmer/gerrittest)\n[![codecov](https://codecov.io/gh/opalmer/gerrittest/branch/master/graph/badge.svg)](https://codecov.io/gh/opalmer/gerrittest)\n[![Go Report Card](https://goreportcard.com/badge/github.com/opalmer/gerrittest)](https://goreportcard.com/report/github.com/opalmer/gerrittest)\n[![GoDoc](https://godoc.org/github.com/opalmer/gerrittest?status.svg)](https://godoc.org/github.com/opalmer/gerrittest)\n\nThis project is meant to assist in testing Gerrit. It provides a docker\ncontainer to run Gerrit and a Makefile with some useful helpers. Documentation \nis available via godoc: https://godoc.org/github.com/opalmer/gerrittest\n\n## Setup\n\n* Install docker\n* `go install github.com/opalmer/gerrittest/cmd`\n\n## Command Line Usage\n### Start and Stop\n\n```\n$ go get github.com/opalmer/gerrittest\n$ cd ~/go/src/github.com/opalmer/gerrittest\n$ make dep build\n$ ./gerrittest start --json /tmp/gerrit.json\n$ cat /tmp/gerrit.json\n{\n  \"config\": {\n    \"image\": \"opalmer/gerrittest:2.14.3\",\n    \"port_ssh\": 0,\n    \"port_http\": 0,\n    \"timeout\": 300000000000,\n    \"git\": {\n      \"core.sshCommand\": \"ssh -i /tmp/gerrittest-id_rsa-706055562 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no\",\n      \"user.email\": \"admin@localhost\",\n      \"user.name\": \"admin\"\n    },\n    \"ssh_keys\": [\n      {\n        \"path\": \"/tmp/gerrittest-id_rsa-706055562\",\n        \"generated\": true,\n        \"default\": true\n      }\n    ],\n    \"username\": \"admin\",\n    \"password\": \"oD7BNb6YE21+7ZGEXefJtFk3HY85wKYrfiZg13H6Mg\",\n    \"skip_setup\": false,\n    \"cleanup_container\": true\n  },\n  \"container\": {\n    \"http\": {\n      \"Private\": 8080,\n      \"port\": 33511,\n      \"address\": \"localhost\",\n      \"protocol\": \"tcp\"\n    },\n    \"ssh\": {\n      \"Private\": 29418,\n      \"port\": 32791,\n      \"address\": \"127.0.0.1\",\n      \"protocol\": \"tcp\"\n    },\n    \"image\": \"opalmer/gerrittest:2.14.3\",\n    \"id\": \"6ef42639c9a40aa3a5e793b8d7fe33005e585ae1ce636671e1bb2d15fc8b1173\"\n  },\n  \"http\": {\n    \"Private\": 8080,\n    \"port\": 33511,\n    \"address\": \"localhost\",\n    \"protocol\": \"tcp\"\n  },\n  \"ssh\": {\n    \"Private\": 29418,\n    \"port\": 32791,\n    \"address\": \"127.0.0.1\",\n    \"protocol\": \"tcp\"\n  }\n}\n$ ./gerrittest stop --json /tmp/gerrit.json\n```\n\n### Retrieving the SSH Command\n\n```\n$ ./gerrittest get-ssh-command --json /tmp/gerrit.json\nssh -i /tmp/gerrittest-id_rsa-706055562 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 32791 admin@127.0.0.1\n```\n\n### Combining gerrittest, bash and curl\n\n```bash\n\n$ JSON=\"/tmp/services.json\"\n$ PREFIX=\")]}'\"\n$ gerrittest start --json \"$JSON\"\n$ USERNAME=\"$(jq -r \".username\" \"$JSON\")\"\n$ PASSWORD=\"$(jq -r \".password\" \"$JSON\")\"\n$ URL=\"http://$(jq -r \".http.address\" \"$JSON\"):$(jq -r \".http.port\" \"$JSON\")\"\n$ RAW_RESPONSE=\"$(curl -u $USERNAME:$PASSWORD $URL/a/accounts/self --fail --silent)\"\n$ RESPONSE=$(echo \"$RAW_RESPONSE\" | sed -e \"s/^$PREFIX//\")\n$ echo \"$RESPONSE\" | jq ._account_id\n1000000\n```\n\n## Code Examples\n\nVisit godoc.org to see code examples:\n\nhttps://godoc.org/github.com/opalmer/gerrittest#pkg-examples\n\n## Testing\n\nThe gerrittest project can be tested locally. To build the container and\nthe gerrittest command run:\n\n```\n$ make check\n```\n\nYou can also skip some of the slower tests:\n\n```\n$ go test -v -short github.com/opalmer/gerrittest\n```\n\nIf you're having trouble with a specific test you can enable debug \nlogging and run that test specifically:\n\n```\n$ go test -gerrittest.log-level=debug -check.vv -check.f RepoTest.* github.com/opalmer/gerrittest\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopalmer%2Fgerrittest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopalmer%2Fgerrittest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopalmer%2Fgerrittest/lists"}