generated from mauroservienti/code-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from mauroservienti/move-docker-compose-to-eac…
…h-test-execution Make so that each test is isolated with its own dedicated docker-compose
- Loading branch information
Showing
7 changed files
with
85 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System; | ||
using System.Net.Http; | ||
using System.Threading.Tasks; | ||
using static SimpleExec.Command; | ||
|
||
namespace MySystem.AcceptanceTests | ||
{ | ||
public static class DockerCompose | ||
{ | ||
public static async Task Up() | ||
{ | ||
Run("docker-compose", "up -d", workingDirectory: AppDomain.CurrentDomain.BaseDirectory); | ||
Run("docker", "ps -a"); | ||
|
||
static async Task<bool> statusChecker() | ||
{ | ||
try | ||
{ | ||
using var client = new HttpClient(); | ||
var response = await client.GetAsync("http://localhost:15672/"); | ||
return response.IsSuccessStatusCode; | ||
} | ||
catch | ||
{ | ||
return false; | ||
} | ||
} | ||
while (!await statusChecker()) | ||
{ | ||
await Task.Delay(500); | ||
} | ||
} | ||
|
||
public static void Down() | ||
{ | ||
Run("docker-compose", "down", workingDirectory: AppDomain.CurrentDomain.BaseDirectory); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters