znt/module/ci/test/model/synccompilestatus.php

36 lines
1.2 KiB
PHP
Executable file
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env php
<?php
/**
title=测试 ciModel->syncCompileStatus();
timeout=0
cid=15593
- 同步jenkins构建结果属性status @created
- 同步gitlab构建结果属性status @failed
- 5次请求没有拿到结果构建失败属性status @failure
- 同步jenkins构建结果有合并请求ID属性status @created
- 5次请求没有拿到结果通知MR失败属性status @failure
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
zenData('pipeline')->gen(3);
zenData('job')->loadYaml('job')->gen(10);
zenData('compile')->loadYaml('compile')->gen(10);
su('admin');
libxml_use_internal_errors(true);
$ci = new ciModelTest();
r($ci->syncCompileStatusTest(1)) && p('status') && e('created'); // 同步jenkins构建结果
r($ci->syncCompileStatusTest(2)) && p('status') && e('failed'); // 同步gitlab构建结果
r($ci->syncCompileStatusTest(6)) && p('status') && e('failure'); // 5次请求没有拿到结果构建失败
r($ci->syncCompileStatusTest(1, 1)) && p('status') && e('created'); // 同步jenkins构建结果有合并请求ID
r($ci->syncCompileStatusTest(6, 1)) && p('status') && e('failure'); // 5次请求没有拿到结果通知MR失败