{"action":"created","comment":{"url":"https://api.github.com/repos/feedzai/cosy-test/pulls/comments/173320936","pull_request_review_id":102494502,"id":173320936,"diff_hunk":"@@ -1,5 +1,163 @@\n # cosy-test\n [![Build Status](https://travis-ci.org/feedzai/cosy-test.svg?branch=master)](https://travis-ci.org/feedzai/cosy-test)\n [![codecov](https://codecov.io/gh/feedzai/cosy-test/branch/master/graph/badge.svg)](https://codecov.io/gh/feedzai/cosy-test)\n+[![Maven metadata URI](https://img.shields.io/maven-metadata/v/http/central.maven.org/maven2/com/feedzai/cosy-test_2.12/maven-metadata.xml.svg)](https://mvnrepository.com/artifact/com.feedzai/cosy-test)\n \n-Bringing up Docker Compose environments for system, integration and performance testing, with support for ScalaTest and Gatling.\n+Bringing up Docker Compose environments for system, integration and performance testing, with support for [ScalaTest](http://www.scalatest.org/),\n+[JUnit 4](https://junit.org/junit4/) and [Gatling](https://gatling.io/).\n+\n+## Why do I need this?\n+\n+Imagine you need to test a complex system that requires having a lot of components working and simulating a realistic scenario.\n+Probably, you would just use a docker-compose file to start your environment and then do your tests.\n+That seems easy... But:\n+\n+* How would you know that the environment is already up and running for testing?\n+* What if you need to test a lot of those environments concurrently?\n+* Would you be capable of managing all the container mapped ports without conflicts?\n+\n+That is where `cosy-test` can make your life easier.\n+\n+## What is cosy-test and how it helps you?\n+\n+It is a simple framework that allows integration with `ScalaTest`, `JUnit 4` and `Gatling` testing frameworks.\n+With `cosy-test` it is possible to simply use docker compose files and define environment variables in order to\n+start docker environments, run tests and bring environments down without pains and restrictions.\n+\n+Main features:\n+\n+* Brings the environments up before the tests and tears them down afterwards.\n+* Start tests just after all health checks are passing.\n+* Can be configured to dump container logs for debugging purposes.\n+* Containers can be kept running on failure, success or both.\n+* Control your system through environment variables.\n+* Ports exposed by containers are mapped to the host machine and are made available to the tests. This approach is\n+  especially handy on MacOS (as opposed to reaching the containers by their IP addresses).\n+\n+## Requirements\n+\n+In order for `cosy-test` to work, it is necessary to have Docker and Docker Compose installed. There are no version restrictions,\n+however we recommend using:\n+\n+- Docker >= 18.02.0 (_older versions have problems during containers start up and/or tear down_)\n+- Docker Compose >= 1.17.1\n+\n+## Usage\n+\n+SBT\n+\n+    libraryDependencies += \"com.feedzai\" %% \"cosy-test\" % \"0.0.3\"\n+\n+Maven\n+\n+    <dependency>\n+        <groupId>com.feedzai</groupId>\n+        <artifactId>cosy-test_2.12</artifactId>\n+        <version>0.0.3</version>\n+    </dependency>\n+\n+## Example — ScalaTest\n+\n+``` scala\n+class IntegrationSpec extends FlatSpec with DockerComposeTestSuite with MustMatchers {\n+\n+  def dockerSetup = Some(\n+    DockerComposeSetup(\n+      \"scalatest\",  // Setup name\n+      Seq(Paths.get(\"src\", \"test\", \"resources\", \"docker-compose-scalatest.yml\")), // Docker compose files\n+      Paths.get(\"\").toAbsolutePath, // Docker compose working directory\n+      Map.empty // Environment variables. Example: Map(\"CONTAINER_EXPOSED_PORT\" -> \"80\")\n+    )\n+  )\n+\n+  behavior of \"Scala Test\"\n+\n+  it must \"Retrieve all services\" in {\n+    val expectedServices = Set(\"container1\", \"container2\", \"container3\")\n+    dockerSetup.foreach { setup =>\n+      setup.getServices().toSet mustEqual expectedServices\n+    }\n+  }\n+}\n+```\n+\n+\n+## Example — JUnit 4\n+\n+``` java\n+public class IntegrationSpec {\n+\n+    private static final DockerComposeJavaSetup dockerSetup;\n+\n+    static {\n+        dockerSetup = new DockerComposeJavaSetup(\n+            \"junittest\", // Setup name\n+            Collections.singletonList(Paths.get(\"src\", \"test\", \"resources\", \"docker-compose-junit.yml\")), // Docker compose files\n+            Paths.get(\"\").toAbsolutePath(), // Docker compose working directory\n+            new HashMap<>() // Environment variables. Example: Map(\"CONTAINER_EXPOSED_PORT\" -> \"80\")","path":"README.md","position":98,"original_position":98,"commit_id":"f77b1f9e49880410da5af89153b3a9f31c01b70b","original_commit_id":"f77b1f9e49880410da5af89153b3a9f31c01b70b","user":{"login":"Timunas","id":18316742,"avatar_url":"https://avatars1.githubusercontent.com/u/18316742?v=4","gravatar_id":"","url":"https://api.github.com/users/Timunas","html_url":"https://github.com/Timunas","followers_url":"https://api.github.com/users/Timunas/followers","following_url":"https://api.github.com/users/Timunas/following{/other_user}","gists_url":"https://api.github.com/users/Timunas/gists{/gist_id}","starred_url":"https://api.github.com/users/Timunas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Timunas/subscriptions","organizations_url":"https://api.github.com/users/Timunas/orgs","repos_url":"https://api.github.com/users/Timunas/repos","events_url":"https://api.github.com/users/Timunas/events{/privacy}","received_events_url":"https://api.github.com/users/Timunas/received_events","type":"User","site_admin":false},"body":"facepalm","created_at":"2018-03-08T23:06:02Z","updated_at":"2018-03-08T23:06:02Z","html_url":"https://github.com/feedzai/cosy-test/pull/5#discussion_r173320936","pull_request_url":"https://api.github.com/repos/feedzai/cosy-test/pulls/5","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/feedzai/cosy-test/pulls/comments/173320936"},"html":{"href":"https://github.com/feedzai/cosy-test/pull/5#discussion_r173320936"},"pull_request":{"href":"https://api.github.com/repos/feedzai/cosy-test/pulls/5"}},"in_reply_to_id":173278997},"pull_request":{"url":"https://api.github.com/repos/feedzai/cosy-test/pulls/5","id":171071305,"html_url":"https://github.com/feedzai/cosy-test/pull/5","diff_url":"https://github.com/feedzai/cosy-test/pull/5.diff","patch_url":"https://github.com/feedzai/cosy-test/pull/5.patch","issue_url":"https://api.github.com/repos/feedzai/cosy-test/issues/5","number":5,"state":"open","locked":false,"title":"Add new sections to README","user":{"login":"Timunas","id":18316742,"avatar_url":"https://avatars1.githubusercontent.com/u/18316742?v=4","gravatar_id":"","url":"https://api.github.com/users/Timunas","html_url":"https://github.com/Timunas","followers_url":"https://api.github.com/users/Timunas/followers","following_url":"https://api.github.com/users/Timunas/following{/other_user}","gists_url":"https://api.github.com/users/Timunas/gists{/gist_id}","starred_url":"https://api.github.com/users/Timunas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Timunas/subscriptions","organizations_url":"https://api.github.com/users/Timunas/orgs","repos_url":"https://api.github.com/users/Timunas/repos","events_url":"https://api.github.com/users/Timunas/events{/privacy}","received_events_url":"https://api.github.com/users/Timunas/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-02-23T17:24:41Z","updated_at":"2018-03-08T23:06:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c16069f5d401e2a359f8848a9056e612e32ec3cf","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/feedzai/cosy-test/pulls/5/commits","review_comments_url":"https://api.github.com/repos/feedzai/cosy-test/pulls/5/comments","review_comment_url":"https://api.github.com/repos/feedzai/cosy-test/pulls/comments{/number}","comments_url":"https://api.github.com/repos/feedzai/cosy-test/issues/5/comments","statuses_url":"https://api.github.com/repos/feedzai/cosy-test/statuses/f77b1f9e49880410da5af89153b3a9f31c01b70b","head":{"label":"feedzai:update-readme","ref":"update-readme","sha":"f77b1f9e49880410da5af89153b3a9f31c01b70b","user":{"login":"feedzai","id":782095,"avatar_url":"https://avatars3.githubusercontent.com/u/782095?v=4","gravatar_id":"","url":"https://api.github.com/users/feedzai","html_url":"https://github.com/feedzai","followers_url":"https://api.github.com/users/feedzai/followers","following_url":"https://api.github.com/users/feedzai/following{/other_user}","gists_url":"https://api.github.com/users/feedzai/gists{/gist_id}","starred_url":"https://api.github.com/users/feedzai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feedzai/subscriptions","organizations_url":"https://api.github.com/users/feedzai/orgs","repos_url":"https://api.github.com/users/feedzai/repos","events_url":"https://api.github.com/users/feedzai/events{/privacy}","received_events_url":"https://api.github.com/users/feedzai/received_events","type":"Organization","site_admin":false},"repo":{"id":109962776,"name":"cosy-test","full_name":"feedzai/cosy-test","owner":{"login":"feedzai","id":782095,"avatar_url":"https://avatars3.githubusercontent.com/u/782095?v=4","gravatar_id":"","url":"https://api.github.com/users/feedzai","html_url":"https://github.com/feedzai","followers_url":"https://api.github.com/users/feedzai/followers","following_url":"https://api.github.com/users/feedzai/following{/other_user}","gists_url":"https://api.github.com/users/feedzai/gists{/gist_id}","starred_url":"https://api.github.com/users/feedzai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feedzai/subscriptions","organizations_url":"https://api.github.com/users/feedzai/orgs","repos_url":"https://api.github.com/users/feedzai/repos","events_url":"https://api.github.com/users/feedzai/events{/privacy}","received_events_url":"https://api.github.com/users/feedzai/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/feedzai/cosy-test","description":"Bringing up Docker Compose environments for system, integration and performance testing, with support for ScalaTest and Gatling","fork":false,"url":"https://api.github.com/repos/feedzai/cosy-test","forks_url":"https://api.github.com/repos/feedzai/cosy-test/forks","keys_url":"https://api.github.com/repos/feedzai/cosy-test/keys{/key_id}","collaborators_url":"https://api.github.com/repos/feedzai/cosy-test/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/feedzai/cosy-test/teams","hooks_url":"https://api.github.com/repos/feedzai/cosy-test/hooks","issue_events_url":"https://api.github.com/repos/feedzai/cosy-test/issues/events{/number}","events_url":"https://api.github.com/repos/feedzai/cosy-test/events","assignees_url":"https://api.github.com/repos/feedzai/cosy-test/assignees{/user}","branches_url":"https://api.github.com/repos/feedzai/cosy-test/branches{/branch}","tags_url":"https://api.github.com/repos/feedzai/cosy-test/tags","blobs_url":"https://api.github.com/repos/feedzai/cosy-test/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/feedzai/cosy-test/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/feedzai/cosy-test/git/refs{/sha}","trees_url":"https://api.github.com/repos/feedzai/cosy-test/git/trees{/sha}","statuses_url":"https://api.github.com/repos/feedzai/cosy-test/statuses/{sha}","languages_url":"https://api.github.com/repos/feedzai/cosy-test/languages","stargazers_url":"https://api.github.com/repos/feedzai/cosy-test/stargazers","contributors_url":"https://api.github.com/repos/feedzai/cosy-test/contributors","subscribers_url":"https://api.github.com/repos/feedzai/cosy-test/subscribers","subscription_url":"https://api.github.com/repos/feedzai/cosy-test/subscription","commits_url":"https://api.github.com/repos/feedzai/cosy-test/commits{/sha}","git_commits_url":"https://api.github.com/repos/feedzai/cosy-test/git/commits{/sha}","comments_url":"https://api.github.com/repos/feedzai/cosy-test/comments{/number}","issue_comment_url":"https://api.github.com/repos/feedzai/cosy-test/issues/comments{/number}","contents_url":"https://api.github.com/repos/feedzai/cosy-test/contents/{+path}","compare_url":"https://api.github.com/repos/feedzai/cosy-test/compare/{base}...{head}","merges_url":"https://api.github.com/repos/feedzai/cosy-test/merges","archive_url":"https://api.github.com/repos/feedzai/cosy-test/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/feedzai/cosy-test/downloads","issues_url":"https://api.github.com/repos/feedzai/cosy-test/issues{/number}","pulls_url":"https://api.github.com/repos/feedzai/cosy-test/pulls{/number}","milestones_url":"https://api.github.com/repos/feedzai/cosy-test/milestones{/number}","notifications_url":"https://api.github.com/repos/feedzai/cosy-test/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/feedzai/cosy-test/labels{/name}","releases_url":"https://api.github.com/repos/feedzai/cosy-test/releases{/id}","deployments_url":"https://api.github.com/repos/feedzai/cosy-test/deployments","created_at":"2017-11-08T10:42:57Z","updated_at":"2018-03-06T17:54:11Z","pushed_at":"2018-03-08T22:44:46Z","git_url":"git://github.com/feedzai/cosy-test.git","ssh_url":"git@github.com:feedzai/cosy-test.git","clone_url":"https://github.com/feedzai/cosy-test.git","svn_url":"https://github.com/feedzai/cosy-test","homepage":"","size":68,"stargazers_count":3,"watchers_count":3,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":4,"watchers":3,"default_branch":"master"}},"base":{"label":"feedzai:master","ref":"master","sha":"3d952a3659a143b17cd7d427e55fcc6a063547cf","user":{"login":"feedzai","id":782095,"avatar_url":"https://avatars3.githubusercontent.com/u/782095?v=4","gravatar_id":"","url":"https://api.github.com/users/feedzai","html_url":"https://github.com/feedzai","followers_url":"https://api.github.com/users/feedzai/followers","following_url":"https://api.github.com/users/feedzai/following{/other_user}","gists_url":"https://api.github.com/users/feedzai/gists{/gist_id}","starred_url":"https://api.github.com/users/feedzai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feedzai/subscriptions","organizations_url":"https://api.github.com/users/feedzai/orgs","repos_url":"https://api.github.com/users/feedzai/repos","events_url":"https://api.github.com/users/feedzai/events{/privacy}","received_events_url":"https://api.github.com/users/feedzai/received_events","type":"Organization","site_admin":false},"repo":{"id":109962776,"name":"cosy-test","full_name":"feedzai/cosy-test","owner":{"login":"feedzai","id":782095,"avatar_url":"https://avatars3.githubusercontent.com/u/782095?v=4","gravatar_id":"","url":"https://api.github.com/users/feedzai","html_url":"https://github.com/feedzai","followers_url":"https://api.github.com/users/feedzai/followers","following_url":"https://api.github.com/users/feedzai/following{/other_user}","gists_url":"https://api.github.com/users/feedzai/gists{/gist_id}","starred_url":"https://api.github.com/users/feedzai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feedzai/subscriptions","organizations_url":"https://api.github.com/users/feedzai/orgs","repos_url":"https://api.github.com/users/feedzai/repos","events_url":"https://api.github.com/users/feedzai/events{/privacy}","received_events_url":"https://api.github.com/users/feedzai/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/feedzai/cosy-test","description":"Bringing up Docker Compose environments for system, integration and performance testing, with support for ScalaTest and Gatling","fork":false,"url":"https://api.github.com/repos/feedzai/cosy-test","forks_url":"https://api.github.com/repos/feedzai/cosy-test/forks","keys_url":"https://api.github.com/repos/feedzai/cosy-test/keys{/key_id}","collaborators_url":"https://api.github.com/repos/feedzai/cosy-test/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/feedzai/cosy-test/teams","hooks_url":"https://api.github.com/repos/feedzai/cosy-test/hooks","issue_events_url":"https://api.github.com/repos/feedzai/cosy-test/issues/events{/number}","events_url":"https://api.github.com/repos/feedzai/cosy-test/events","assignees_url":"https://api.github.com/repos/feedzai/cosy-test/assignees{/user}","branches_url":"https://api.github.com/repos/feedzai/cosy-test/branches{/branch}","tags_url":"https://api.github.com/repos/feedzai/cosy-test/tags","blobs_url":"https://api.github.com/repos/feedzai/cosy-test/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/feedzai/cosy-test/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/feedzai/cosy-test/git/refs{/sha}","trees_url":"https://api.github.com/repos/feedzai/cosy-test/git/trees{/sha}","statuses_url":"https://api.github.com/repos/feedzai/cosy-test/statuses/{sha}","languages_url":"https://api.github.com/repos/feedzai/cosy-test/languages","stargazers_url":"https://api.github.com/repos/feedzai/cosy-test/stargazers","contributors_url":"https://api.github.com/repos/feedzai/cosy-test/contributors","subscribers_url":"https://api.github.com/repos/feedzai/cosy-test/subscribers","subscription_url":"https://api.github.com/repos/feedzai/cosy-test/subscription","commits_url":"https://api.github.com/repos/feedzai/cosy-test/commits{/sha}","git_commits_url":"https://api.github.com/repos/feedzai/cosy-test/git/commits{/sha}","comments_url":"https://api.github.com/repos/feedzai/cosy-test/comments{/number}","issue_comment_url":"https://api.github.com/repos/feedzai/cosy-test/issues/comments{/number}","contents_url":"https://api.github.com/repos/feedzai/cosy-test/contents/{+path}","compare_url":"https://api.github.com/repos/feedzai/cosy-test/compare/{base}...{head}","merges_url":"https://api.github.com/repos/feedzai/cosy-test/merges","archive_url":"https://api.github.com/repos/feedzai/cosy-test/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/feedzai/cosy-test/downloads","issues_url":"https://api.github.com/repos/feedzai/cosy-test/issues{/number}","pulls_url":"https://api.github.com/repos/feedzai/cosy-test/pulls{/number}","milestones_url":"https://api.github.com/repos/feedzai/cosy-test/milestones{/number}","notifications_url":"https://api.github.com/repos/feedzai/cosy-test/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/feedzai/cosy-test/labels{/name}","releases_url":"https://api.github.com/repos/feedzai/cosy-test/releases{/id}","deployments_url":"https://api.github.com/repos/feedzai/cosy-test/deployments","created_at":"2017-11-08T10:42:57Z","updated_at":"2018-03-06T17:54:11Z","pushed_at":"2018-03-08T22:44:46Z","git_url":"git://github.com/feedzai/cosy-test.git","ssh_url":"git@github.com:feedzai/cosy-test.git","clone_url":"https://github.com/feedzai/cosy-test.git","svn_url":"https://github.com/feedzai/cosy-test","homepage":"","size":68,"stargazers_count":3,"watchers_count":3,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":4,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":1,"open_issues":4,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/feedzai/cosy-test/pulls/5"},"html":{"href":"https://github.com/feedzai/cosy-test/pull/5"},"issue":{"href":"https://api.github.com/repos/feedzai/cosy-test/issues/5"},"comments":{"href":"https://api.github.com/repos/feedzai/cosy-test/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/feedzai/cosy-test/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/feedzai/cosy-test/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/feedzai/cosy-test/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/feedzai/cosy-test/statuses/f77b1f9e49880410da5af89153b3a9f31c01b70b"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"Timunas"}}