小编cid*_*ack的帖子

如何将作业放在Jenkins的Throttle Concurrent Builds插件的类别中

我已经下载了Jenkins的TCB插件.我有几个运行测试的构建.这些构建必须单独运行,因为它们访问类似的文件,如果运行多个测试构建,则会导致测试失败.我一直试图找到将构建放入"类别"的地方,因此我可以将整个测试类别降低到1/1.我认为这可能是詹金斯观点,但那并没有完成这项工作.如何在一个类别中添加作业?

这个标签讨论了我想要的解决方案:Jenkins:为这个组分组作业并限制构建处理器.唯一的问题是它没有说明如何将它们添加到类别中.

concurrency plugins build jenkins

23
推荐指数
1
解决办法
1万
查看次数

推送时Git无法解析引用

我和Git有问题.由于未知原因,我的主分支已经被破坏了.我有一个本地提交,我想推高,但当我推,我得到这个:

git push origin master
error: unable to resolve reference refs/remotes/origin/master: No such file or directory
error: cannot lock the ref 'refs/remotes/origin/master'.
Everything up-to-date
Run Code Online (Sandbox Code Playgroud)

我已经在其他主板上看到了这个问题,但通常指的是拉动而不是推动.尽管如此,我已经尝试过他们的解决方案,但无济于事:

  1. 试图修改我目前的提交和推动
  2. 清理我的git存储库 git gc --prune=now
  3. 试着 rm .git/refs/removes/origin/master

没有人解决我的问题.有什么想法或想法吗?

git github

17
推荐指数
2
解决办法
4万
查看次数

如何在Travis CI中部署nuget包?

我有一个运行Travis CI的nuget包.这是我的yml:

language: csharp
solution: TreasureGen.sln
install:
  - nuget restore TreasureGen.sln
  - nuget install NUnit.Runners -OutputDirectory testrunner
script:
  - xbuild TreasureGen.sln /p:TargetFrameworkVersion="v4.5" /p:Configuration=Stress
  - mono ./testrunner/NUnit.ConsoleRunner.*/tools/nunit3-console.exe ./TreasureGen.Tests.Unit/bin/Stress/TreasureGen.Tests.Unit.dll
  - mono ./testrunner/NUnit.ConsoleRunner.*/tools/nunit3-console.exe ./TreasureGen.Tests.Integration.IoC/bin/Stress/TreasureGen.Tests.Integration.IoC.dll
  - mono ./testrunner/NUnit.ConsoleRunner.*/tools/nunit3-console.exe ./TreasureGen.Tests.Integration.Tables/bin/Stress/TreasureGen.Tests.Integration.Tables.dll
  - mono ./testrunner/NUnit.ConsoleRunner.*/tools/nunit3-console.exe ./TreasureGen.Tests.Integration.Stress/bin/Stress/TreasureGen.Tests.Integration.Stress.dll
Run Code Online (Sandbox Code Playgroud)

理想情况下,当它在主分支上运行时,如果成功,它将根据需要部署nuget包.解决方案中已有Nuget项目,其中包含每个包的文件Package.nuspecNuGet.config文件.我试过让它自己部署并且没有取得多大成功 - 通常我遇到了身份验证方面的问题,但并不是唯一的问题.我想知道是否有人在Travis中部署了这样的nuget包以及他们是如何做到的.

deployment nuget travis-ci

9
推荐指数
1
解决办法
2311
查看次数

iFrame无法正确显示重音字符

我有一个HTML页面:

<html>
	<head>
		Web page
	</head>
	<body>
		<p>This sentence has multibyte characters:? ??? ??? ??? ??, ?? ??? ??? ? ? ??, ? ??? ??? ?? ? ??? ??? ??, ??? ??? ??? ?? ?, ? ??? ??? ??
        </p>
	    <p>á, é, í, ó, ú, ü, ñ, ¿, ¡</p>
	</body>
</html>
Run Code Online (Sandbox Code Playgroud)

独立时,此页面可正确显示.但是,我有一个网站试图在iFrame中显示此页面.在那里,重音字符显示为带有问号的黑色钻石.我已经尝试添加指定UTF-8编码的元标记(文件保存为),但这不会修复具有iFrame的页面.实际上,当您将该标记添加到HTML页面时,它也会自行打破该页面.我在这里错过了什么?

html iframe utf-8

5
推荐指数
1
解决办法
2951
查看次数

如何让量角器等待触发的承诺解决?

所以我有一个网站,点击一个按钮,它发送到一个角度服务,它提出一个承诺,解决它,获取一些数据,并在页面上显示该数据.我想要一个角度测试,找到按钮,点击它,并验证我得到了数据.但是,测试总是在按钮结算之前完成.我尝试了browser.sleep(),但这只是暂停了承诺从未解决的事情.关于量角器的许多其他与承诺相关的问题没有帮助,因为承诺没有在测试中设置,而是由页面本身设置.

这是我的测试:

it('should roll a d2', function () {
    element(by.id('d2Button')).click();

    //whatever has to be here for the waiting to occur

    expect(element(by.binding('rolls.d2')).getText()).not.toEqual('0');
});
Run Code Online (Sandbox Code Playgroud)

这是HTML:

<button id="d2Button" type="button" class="btn btn-success" ng-click="rollD2()">Roll</button>
<span><b>{{rolls.d2 | number}}</b></span>
Run Code Online (Sandbox Code Playgroud)

以下是点击时调用的角度代码的简短摘要:

$scope.rollD2 = function () {
    diceService.getD2Roll($scope.quantities.d2).then(function (data) {
        $scope.rolls.d2 = data.roll;
    });
};
Run Code Online (Sandbox Code Playgroud)

这是服务电话:

function getD2Roll(quantity) {
    var url = "Dice/D2/" + quantity;
    return getPromise(url);
}

function getPromise(url) {
    var deferred = $q.defer();
    $http.get(url).success(deferred.resolve).error(deferred.reject);
    return deferred.promise;
}
Run Code Online (Sandbox Code Playgroud)

如何让测试正确等待?

javascript angularjs protractor angular-promise

4
推荐指数
1
解决办法
2497
查看次数

DotNetCore构建失败,因为缺少Microsoft.DotNet.Props

我正在使用Microsoft.NETCore.App版本1.1.0构建一个dotnetcore项目.我曾尝试更新到1.1.1,但我们的项目使用的是NUnit,1.1.1尚未完全支持.所以,我不得不回滚.但是,作为更新的一部分,我必须安装1.1.1的.Net Core应用程序.回滚后,我重新安装了1.1.0,构建时仍然出现以下错误:

Error   MSB4019 The imported project "C:\Program Files\dotnet\sdk\1.0.1\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Run Code Online (Sandbox Code Playgroud)

我在文件目录中查找了我安装的所有sdk版本,但没有一个版本具有该目录.这一直有效,直到我今天早上尝试更新.重新安装旧版本的.Net Core后,我不确定为什么它仍然失败.这对我来说是一个阻碍,因为它阻止我构建和完成API的功能.任何帮助深表感谢.

更新:显而易见的答案是将项目移至VS2017,但不幸的是,目前这不是一个选项,因为我们的项目使用NUnit进行测试,VS2017和dotnetcore尚未完全支持.

nunit visual-studio-2015 .net-core

4
推荐指数
1
解决办法
2368
查看次数

Travis CI无法运行NUnit 3控制台运行程序

我使用Travis CI设置了远程构建.这是我的配置文件:

language: csharp
solution: DungeonGen.sln
install:
  - nuget restore DungeonGen.sln
  - nuget install NUnit.Runners -OutputDirectory testrunner
script:
  - xbuild DungeonGen.sln /p:TargetFrameworkVersion="v4.5.1" /p:Configuration=Stress
  - mono ./testrunner/NUnit.Console.*/tools/nunit3-console.exe ./Tests/Unit/Common/bin/Stress/DungeonGen.Tests.Unit.Common.dll
  - mono ./testrunner/NUnit.Console.*/tools/nunit3-console.exe ./Tests/Unit/Generators/bin/Stress/DungeonGen.Tests.Unit.Generators.dll
  - mono ./testrunner/NUnit.Console.*/tools/nunit3-console.exe ./Tests/Unit/Selectors/bin/Stress/DungeonGen.Tests.Unit.Selectors.dll
  - mono ./testrunner/NUnit.Console.*/tools/nunit3-console.exe ./Tests/Unit/Mappers/bin/Stress/DungeonGen.Tests.Unit.Mappers.dll
  - mono ./testrunner/NUnit.Console.*/tools/nunit3-console.exe ./Tests/Unit/Tables/bin/Stress/DungeonGen.Tests.Unit.Tables.dll
  - mono ./testrunner/NUnit.Console.*/tools/nunit3-console.exe ./Tests/Integration/Bootstrap/bin/Stress/DungeonGen.Tests.Integration.Bootstrap.dll
  - mono ./testrunner/NUnit.Console.*/tools/nunit3-console.exe ./Tests/Integration/Tables/bin/Stress/DungeonGen.Tests.Integration.Tables.dll
  - mono ./testrunner/NUnit.Console.*/tools/nunit3-console.exe ./Tests/Integration/Stress/bin/Stress/DungeonGen.Tests.Integration.Stress.dll
Run Code Online (Sandbox Code Playgroud)

但是,当它运行时,我得到以下异常:

$ mono ./testrunner/NUnit.Console.*/tools/nunit3-console.exe ./Tests/Unit/Common/bin/Stress/DungeonGen.Tests.Unit.Common.dll
Cannot open assembly './testrunner/NUnit.Console.*/tools/nunit3-console.exe': No such file or directory.
The command "mono ./testrunner/NUnit.Console.*/tools/nunit3-console.exe ./Tests/Unit/Common/bin/Stress/DungeonGen.Tests.Unit.Common.dll" exited with 2.
Run Code Online (Sandbox Code Playgroud)

对于我尝试加载测试的每个DLL,都会重复此异常.根据Travis CI的文档 …

nunit-console travis-ci nunit-3.0

3
推荐指数
1
解决办法
911
查看次数