How to build a ci / cd pipeline with hybris commerce? - continuous-integration

I am developing a pipeline for hybris.
I have doubts in the execution of the tests.
I'm following this tutorial:
https://clutcher.github.io/post/hybris/improve_hybris_test_run/
However, I have several extensions in customizing hybris.
Do I have to configure the buildcallbacks.xml file for each extension?
Is there any way to run the ant ci for all extensions?

For a first version I would use the following ant tasks:
integrationtests
performancetests
manualtests
bugprooftests
localizationtest
typecodetest
alltests
allwebtests
Make sure to mark your tests with the #IntegrationTest or #UnitTest annotation so that the ant task will find them.
You can filter the tests by:
extensions using the parameter -Dtestclasses.extensions=myextension
packages using the parameter -Dtestclasses.packages=my.package
excluded packages using the parameter -Dtestclasses.packages.excluded
For more information consider:
https://help.sap.com/viewer/d0224eca81e249cb821f2cdf45a82ace/2005/en-US/f7f454a4f5254944a366db9bdf129be6.html

Related

Disable Integration test case using gradle command in springboot

I am using POSTGRES SQL as DB for my springboot application .Sonarqube integration test cases fail as SonarQube is unable to connect to DB.How can i disable my integration test cases using gradlew command during Jenkins build ?
Below is link where i have shown my code in detail SonarQube does not calculate code coverage
You would likely have to have some kind of naming convention for the tests you wish to exclude. Then, you can readily exclude them using something like the following:
In your build.gradle file, add:
test {
if (project.hasProperty('excludeTests')) {
exclude project.property('excludeTests')
}
}
From the command line:
gradle test -PexcludeTests=**/Integration*

How to configure YML file when used TestNG & in that used more than one classes?

I created a Maven project I used TestNG. Here in programming I used two classes one base class and another derived class and call all methods. Now I want to convert it to JMX so I used the Taurus tool and for conversion used a proxy recorder. Now I want to configure yml file. Here I used two classes then How is it configured?
and Here I used TestNG so which external files/paths need to be added?
You can use Maven dependency plugin to download all the transitive dependencies:
mvn dependency:copy-dependencies
it will download all the .jar files required to run your project.
Once done you can use additional-classpath directive to "tell" Taurus where the .jar files live:
scenarios:
testng-file:
script: yourTest.java
additional-classpath:
- dependency1.jar
- dependency2.jar
- etc.
If you have already performed the conversion you can existing .jmx script either by directly providing it as a parameter for bzt
bzt your-test-script.jmx
or if you want to use Taurus YAML file
execution:
- scenario: simple
scenarios:
simple:
script: your-test-script.jmx
More information: Navigating your First Steps Using Taurus

Makefile to gradle conversion for golang application

I have a go lang application which exposes a rest API and logs the information to DB. I am trying to convert the make file to gradle build. Is there any default way similar to maven2gradle plugin or the gradle build file should be written manually? I checked the syntactical differences between gradle and make file but still not clear about passing run time arguments to gradle that is similar to
run:build
./hello -conf=/apps/content/properties/prop.json -v=0 -logDest="FILE" -log_dir="/var/log/logdir"
hello is my executable and others are the runtime arguments. This is my first attempt in migrating make to gradle and I couldnt find any clear documentation. Please help.
As far as I have checked, there is no direct plugin that could do this task. As a workaround, the build execution could be written as seperate tasks in gradle and ordered accordingly. Tasks here would contain setting Go path, installing dependencies and building the application and would be run as command line process in Gradle. Gradle provides support to run command line processes as described in gradle documentation. Hope it helps.

Gradle Tooling : How to set environment variable

I have a custom plugin and I am writing tests to test it. For this I'm using gradle tooling api (I found that to be the recommended way to test).
One of the test requires me to run a task by setting some environment variable. How do I test this. I do not see ProjectConnection providing a way to set environment variable.
If I have to manually test I would have to do this :
setenv LRG_REPOS foo
gradle verify_lrg -PlrgName=abc
where verify_lrg is task added by my custom plugin.
Currently to solve this, I am running using ProcessBuilder, but would like to know if there is any gradle tooling way (because all other tests are using gradle tooling api)
It will be possible to configure environment variables via gradle tooling api since 3.5 version, see details at https://github.com/gradle/gradle/pull/1029
https://github.com/gradle/gradle/blob/446468213543e32a0ce1bce0bbedabcfe925c572/subprojects/tooling-api/src/main/java/org/gradle/tooling/LongRunningOperation.java#L190

How to run more than one test but not all the tests in GEB using Gradle?

I am running gradle to run the tests from Windows command line. What I do to run a single test is:
gradlew.bat chromeTest -DchromeTest.single=test1Spec
or for all the tests:
gradlew.bat chromeTest
If I try to run only two test classes like this:
gradlew.bat chromeTest -DchromeTest=test1Spec,test2Spec--info
then gradle starts to run all the tests.
What I need: is to run only 2 or 3 Groovy classes. To be specific, neither one nor all. Any help would be really beneficial! Sorry, for reposting this question again.
-DtestTaskName supports wildcards such as Test*Spec or foo.bar.*Spec, but is limited to a single pattern. If you need support for multiple patterns, you'll have to implement your own command line parameter (which in the simplest case means reading a system property) and use that to configure Test#include or Test#getFilter. (See Test in the Gradle Build Language Reference for details.)
Gradle 1.10 introduced --tests as a replacement for -DtestTaskName, but again, only one pattern is supported.

Resources