* Adjust svn unit test check rule.

This commit is contained in:
caoyanyi
2023-12-22 16:15:45 +08:00
parent 39e1612904
commit 0e11a44ea7
5 changed files with 27 additions and 14 deletions
+9 -1
View File
@@ -11,6 +11,12 @@ declare(strict_types=1);
*/
class svnModel extends model
{
public function __construct(string $moduleName = '', string $methodName = '')
{
parent::__construct($moduleName, $methodName);
putenv('LC_ALL=C');
}
/**
* The svn binary client.
*
@@ -263,7 +269,9 @@ class svnModel extends model
{
$cmd = $repo->client . ' --version --quiet';
$version = `$cmd`;
if(version_compare((string)$version, '1.6.0', '>'))
if(!$version) return false;
if(version_compare($version, '1.6.0', '>'))
{
$this->client .= ' --trust-server-cert';
}
+6 -6
View File
@@ -21,17 +21,17 @@ global $tester;
$svn = $tester->loadModel('svn');
$repo = new stdclass();
$repo->client = '/usr/bin/svn';
$repo->client = 'svn';
$repo->path = 'https://https-test';
$svn->setClient($repo);
r($svn->client) && p() && e('/usr/bin/svn --non-interactive --trust-server-cert'); // 测试https开头没有用户名密码的svn地址
r($svn->client) && p() && e('svn --non-interactive --trust-server-cert'); // 测试https开头没有用户名密码的svn地址
$repo->path = 'http://https-test';
$svn->setClient($repo);
r($svn->client) && p() && e('/usr/bin/svn --non-interactive'); // 测试http开头没有用户名密码的svn地址
r($svn->client) && p() && e('svn --non-interactive'); // 测试http开头没有用户名密码的svn地址
$repo->path = 'svn://https-test';
$repo->account = 'test';
$repo->path = 'svn://https-test';
$repo->account = 'test';
$repo->password = 'test';
$svn->setClient($repo);
r($svn->client) && p() && e('/usr/bin/svn --non-interactive --trust-server-cert --username test --password test --no-auth-cache'); // 测试svn开头有用户名密码的svn地址
r($svn->client) && p() && e('svn --non-interactive --trust-server-cert --username test --password test --no-auth-cache'); // 测试svn开头有用户名密码的svn地址
+2 -2
View File
@@ -9,7 +9,7 @@ cid=1
- 查询SVN仓库信息
- 属性repoRoot @https://svn.qc.oop.cc/svn/unittest
- 属性client @/usr/bin/svn --non-interactive --trust-server-cert --username admin --password KXdOi8zgTcUqEFX2Hx8B --no-auth-cache
- 属性client @svn --non-interactive --trust-server-cert --username admin --password KXdOi8zgTcUqEFX2Hx8B --no-auth-cache
*/
@@ -24,4 +24,4 @@ $svn->setRepos();
$repo = $svn->repos[1];
$svn->setRepo($repo);
r($svn) && p('repoRoot,client') && e('https://svn.qc.oop.cc/svn/unittest,/usr/bin/svn --non-interactive --trust-server-cert --username admin --password KXdOi8zgTcUqEFX2Hx8B --no-auth-cache'); // 查询SVN仓库信息
r($svn) && p('repoRoot,client') && e('https://svn.qc.oop.cc/svn/unittest,svn --non-interactive --trust-server-cert --username admin --password KXdOi8zgTcUqEFX2Hx8B --no-auth-cache'); // 查询SVN仓库信息
+9 -4
View File
@@ -76,17 +76,22 @@ class svnTest
$noLink = new stdclass();
$noLink->revision = 2;
$noLink->committer = 'test';
$noLink->author = 'test';
$noLink->date = '2023-01-01 00:00:00';
$noLink->time = '2023-01-01 00:00:00';
$noLink->msg = 'test';
$noLink->comment = 'test';
$noLink->change = array();
$linked = new stdclass();
$linked->revision = 3;
$linked->revision = 3;
$linked->committer = 'test';
$linked->time = '2023-01-02 00:00:00';
$linked->msg = '* Code for task #1.';
$linked->comment = '* Code for task #1.';
$linked->author = 'test';
$linked->date = '2023-01-02 00:00:00';
$linked->time = '2023-01-02 00:00:00';
$linked->msg = '* Code for task #1.';
$linked->comment = '* Code for task #1.';
$linked->change = array();
if(strpos($param, 'linked') !== false) $logs[] = $linked;
if(strpos($param, 'nolink') !== false) $logs[] = $noLink;