c# - 在本地运行单元测试时缺少文件
问题描述
首先请记住,我只是发现“事物”在 DevOps 世界中是如何工作的,而且我的知识非常有限——尤其是在脚本(PS 和 C#)方面。
所以我必须弄清楚如何为应用程序设置一些 Javascript 单元测试——特别是让“测试结果分析器”小部件在 Jenkins 网站上启动和运行。
我目前正在从另一个 Jenkins 管道(def)回收代码,并使用项目的 makefile.include 中已经存在的“运行单元测试”阶段(根据项目的主要开发人员告诉我的内容)它从来没有工作过 - 从来没有测试 - 尝试让测试运行。
我认为最好的方法(不破坏主应用程序上的任何东西)是通过 cygwin 在本地进行测试。我已将项目映射为 Perforce 中的工作区,并尝试从 makefile.include 运行命令
$ make runRoutingPlannerCSTests
它正在工作大约一半,在它提示我一些丢失的文件错误之后,我无法在我的本地项目文件夹的任何地方找到这些错误。
CSC : error CS0006: Metadata file 'D:\src\project\ServicePlanning\BackendAPI\Comtec.Portal.OSPBackend.ApiModel\bin\Release\Comtec.Portnd [D:\src\project\ServicePlanning\Frontend_RoutingPlanner\Comtec.ServicePlanning.Frontend.RoutingPlanner.Tests\Comtec.ServicePlanning
CSC : error CS0006: Metadata file 'D:\src\project\ServicePlanning\Frontend_RoutingPlanner\Comtec.ServicePlanning.Frontend.RoutingPlannngPlanner.dll' could not be found [D:\src\project\ServicePlanning\Frontend_RoutingPlanner\Comtec.ServicePlanning.Frontend.RoutingPlanntingPlanner.Tests.csproj]
CSC : error CS0006: Metadata file 'D:\src\project\ServicePlanning\Frontend_RoutingPlanner\Comtec.ServicePlanning.Frontend.RoutingPlannFrontend.RoutingPlanner.Model.dll' could not be found [D:\src\project\ServicePlanning\Frontend_RoutingPlanner\Comtec.ServicePlanning.Flanning.Frontend.RoutingPlanner.Tests.csproj]
Makefile.include:121: recipe for target `buildRoutingPlannerCSTests' failed
make: *** [buildRoutingPlannerCSTests] Error 1
并且
$ make runTests
运行 Specrunner.html 后卡在某处
######################################################
# run unit tests
######################################################
runTests: runRoutingPlannerJasmineTests runRoutingPlannerCSTests
runRoutingPlannerJasmineTests:
$(RoutingPlanner_TESTS_UTILITIES_DIR)/bin/phantomjs.exe $(RoutingPlanner_TESTS_DIR)/Scripts/jasmine.js $(RoutingPlanner_TESTS_DIR)/jsTests/SpecRunner.html
buildRoutingPlannerCSTests:
$(MSBUILD) `cygpath -a -w $(RoutingPlanner_TESTS_DIR)/Comtec.ServicePlanning.Frontend.RoutingPlanner.Tests.csproj` $(MSBUILD_OPTIONS) /t:Build /property:Configuration=$(VS_CONFIG) /fileloggerparameters:LogFile=`cygpath -a -w $(RoutingPlanner_TESTS_DIR)/Comtec.ServicePlanning.Tests-Build-$(VS_CONFIG).log`
runRoutingPlannerCSTests: buildRoutingPlannerCSTests
@rm -f '$(shell cygpath -aw '$(RoutingPlanner_TESTS_DIR)/bin/$(VS_CONFIG)/Comtec.ServicePlanning.Frontend.RoutingPlanner.Tests.trx')'
$(DOTNET_UNIT_MSTEST) /nologo '/testcontainer:$(shell cygpath -aw '$(RoutingPlanner_TESTS_DIR)/bin/$(VS_CONFIG)/Comtec.ServicePlanning.Frontend.RoutingPlanner.Tests.dll')' '/resultsfile:$(shell cygpath -aw '$(RoutingPlanner_TESTS_DIR)/bin/$(VS_CONFIG)/Comtec.ServicePlanning.Frontend.RoutingPlanner.Tests.trx')'
此部分在脚本的请求部分有一个附加部分,其中添加了路径。
RoutingPlanner_FRONTEND_API_DIR ?= $(RoutingPlanner_FRONTEND_DIR)/Comtec.ServicePlanning.Frontend.RoutingPlanner
RoutingPlanner_TESTS_DIR = $(RoutingPlanner_FRONTEND_DIR)/Comtec.ServicePlanning.Frontend.RoutingPlanner.Tests
RoutingPlanner_TESTS_UTILITIES_DIR = $(RoutingPlanner_TESTS_DIR)/Utilities/phantomjs-2.0.0-windows
RoutingPlanner_UTILITIES_DIR = $(PREPARESETUPDIR)/RoutingPlannerPortalUtilities
老实说,我什至不确定我是否走在正确的道路上,因为我在互联网上找到的步骤与我在项目中找到的以及我认为应该做的不同。
例如:https ://wiki.jenkins.io/display/JENKINS/Test+Results+Analyzer+Plugin
主要是我认为这可能是一个简单的“错误路径”问题,但由于我的脚本技能接近于零,我不确定要修改什么以及在哪里修改。
我不指望手头的解决方案,但我真的很想了解问题是什么或实际完成这项工作的正确方法。
先感谢您。
解决方案
推荐阅读
- java - 是否可以在 Keycloak 注册页面中添加自定义 GET 参数
- flutter - 如何使来自 sqflite 列的逗号分隔值的颤动下拉
- c# - 错误:未找到应用程序依赖项清单中指定的程序集包:Newtonsoft.Json 部署.Net core 2.2 时
- python-3.x - 使用熊猫数据框的 Python IDLE
- pandas - 如何使用 where 填充满足特定条件的 NA
- python - 多线程一个 numpy nditerator
- java - 无法识别的选项:-n 错误:无法创建 Java 虚拟机。错误:发生了致命异常。程序将会退出。在java中
- css - 我们应该如何在微服务中保持视觉样式和模板是最新的
- node.js - MongoDB获得餐厅剩余席位
- javascript - 如何获取网页元素中文本的矩形(不是元素本身的矩形)?