Tag: 团队城市

改善CI构建时间(.NET)

我们正在使用TeamCity作为CI服务器开发应用程序框架+“插件”。 项目细节 4 Visual Studio解决方案 ~70个项目(增加) 目前使用TeamCity运行2个构建:CI和FULL构建。 CI – 在每次提交时触发。 全部 – 每晚跑步。 我想提高两个版本的性能(尤其是CI版本,因为它需要尽快提供输出)。 关于可以有效和轻松改进的内容,是否有任何指导方针? 构建过程只是构建一个.sln文件并运行一些unit testing。 考虑的方向: MSBuild并行化 覆盖CopyFilesToLocal 不确定这些是否适用/将导致性能提升。 我正在寻找更多方法来改善构建时间(大约需要3-4分钟)。

如何在unit testing中获取运行时的unit testing方法名称?

如何从单元内测试中获取unit testing名称? 我在BaseTestFixture类中有以下方法: public string GetCallerMethodName() { var stackTrace = new StackTrace(); StackFrame stackFrame = stackTrace.GetFrame(1); MethodBase methodBase = stackFrame.GetMethod(); return methodBase.Name; } 我的Test Fixture类inheritance自基类: [TestFixture] public class WhenRegisteringUser : BaseTestFixture { } 我有以下系统测试: [Test] public void ShouldRegisterThenVerifyEmailThenSignInSuccessfully_WithValidUsersAndSites() { string testMethodName = this.GetCallerMethodName(); // } 当我从Visual Studio中运行它时,它会按预期返回我的测试方法名称。 当这由TeamCity运行时,而是返回_InvokeMethodFast() ,这似乎是TeamCity在运行时为自己使用而生成的方法。 那么如何在运行时获取测试方法名称?