Feature/docker kuntoon (#11)
CI Main / Load example-gitea-env.conf to pipeline env (push) Successful in 25s
CI Main / Check existing artifact (push) Successful in 22s
unit-tests Link to Bats reports
CI Main / Bats tests (push) Successful in 1m47s
acc-tests Link to Cucumber reports
CI Main / Cucumber tests (push) Successful in 1m4s
ci-docker-build-push Docker build & push 0.2.0 OK
CI Main / Build & Push Docker (push) Successful in 35s
CI Main / Report Summary (push) Successful in 4s
CI Main / Load example-gitea-env.conf to pipeline env (push) Successful in 25s
CI Main / Check existing artifact (push) Successful in 22s
unit-tests Link to Bats reports
CI Main / Bats tests (push) Successful in 1m47s
acc-tests Link to Cucumber reports
CI Main / Cucumber tests (push) Successful in 1m4s
ci-docker-build-push Docker build & push 0.2.0 OK
CI Main / Build & Push Docker (push) Successful in 35s
CI Main / Report Summary (push) Successful in 4s
Co-authored-by: moilanik <niko.moilanen@tietoevry.com> Reviewed-on: #11
This commit is contained in:
@@ -6,10 +6,15 @@ const PROJECT_ROOT = path.resolve(__dirname, '..', '..', '..');
|
||||
const MOCK_SCRIPT = path.join(PROJECT_ROOT, 'tests', 'helpers', 'mock-api.sh');
|
||||
|
||||
Before({ tags: '@mock' }, function () {
|
||||
execSync(`bash -c 'source "${MOCK_SCRIPT}" && mock_start'`, {
|
||||
const out = execSync(`bash -c 'source "${MOCK_SCRIPT}" && mock_start && sleep 0.3 && curl -s -o /dev/null -w "%{http_code}" --max-time 3 http://localhost:18080/api/v1/repos/health/check'`, {
|
||||
cwd: PROJECT_ROOT,
|
||||
stdio: 'ignore',
|
||||
encoding: 'utf-8',
|
||||
stdio: ['pipe', 'pipe', 'pipe'],
|
||||
});
|
||||
const trimmed = out.trim();
|
||||
if (!trimmed.startsWith('2') && !trimmed.startsWith('4')) {
|
||||
throw new Error(`Mock server failed to start (HTTP ${trimmed})`);
|
||||
}
|
||||
});
|
||||
|
||||
After({ tags: '@mock' }, function () {
|
||||
|
||||
Reference in New Issue
Block a user