简体   繁体   English

CI/CD Junit 测试:我应该先构建 package 还是先运行测试?

[英]CI/CD Junit tests: should I build the package first or I can run the test firsts?

Regarding a pipeline of CI/CD when you want to run all the junit tests from the pipeline you should build first the code and then run the tests or you can first run the tests and if they pass run the build?关于 CI/CD 的管道,当您想从管道运行所有 junit 测试时,您应该首先构建代码然后运行测试,或者您可以先运行测试,如果它们通过运行构建?

Steps:脚步:

  • Code代码
  • Push
  • Test?测试?
  • Build?建造?
  • Deploy部署

Is this the order?这是命令吗?

Consider a classic environment with Maven where you run mvnw test to run the tests.考虑一个带有 Maven 的经典环境,您可以在其中运行mvnw test来运行测试。

I am asking this because for example in this video , there is first the build step and then the test step我问这个是因为例如在这个视频中,首先是构建步骤,然后是测试步骤

I answer myself: to run tests for compiled languages (Java, C++, etc) you need to build first.我回答自己:要运行编译语言(Java、C++ 等)的测试,您需要先构建。

For interpreted languages that doens't need compilation you can simply run tests对于不需要编译的解释语言,您可以简单地运行测试

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何通过右键单击eclipse上的包并选择“Run as JUnit test”,在包中及下面(递归地)运行所有junit测试 - How can I run all junit tests in a package and below (recursively) by right clicking the package on eclipse and selecting “Run as JUnit test” 我可以通过不同的参数将JUnit测试用例作为“多个测试”运行吗? - Can I run a JUnit test Case as “multiple tests” by different parameters? 为什么我不能从Package Explorer运行所有Java JUnit测试? - Scala插件问题 - Why can't I run all Java JUnit Tests from Package Explorer? - Scala Plugin Issue 我可以在Junit测试中运行PMD分析吗? - Can I run PMD analysis in a Junit test? 如何在我的Ant构建脚本中运行JUnit测试,同时从生成的jar中省略测试类? - How do I run JUnit tests during my Ant build script while omitting test classes from my resulting jar? 我应该用junit测试toString()吗? - Should I test toString() with junit? 在Maven Build期间,Junit测试可以正常运行,但是如果我手动运行JUnit测试,为什么它们会失败? - During Maven Build Junit Tests runs fine, but why they fails, if I runs JUnit test manually? 如何仅在构建后运行junit测试? - How do I run a junit test only after the build? 为什么可以在不显式设置类路径的情况下运行JUnit测试? - Why can I run JUnit tests without explicitly setting the classpath? 我可以同时运行@TestFactory产生的Junit动态测试吗? - Can i run Junit dynamic tests produced by @TestFactory concurrently?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM