gradle test does not run Geb tests - grails

In Grails 3.1.4: If I use the Grails create-functional-test command and create a Geb test, when I use the Gradle test task it does not run the Geb test, it only runs the unit and integration tests, not the functional.
If I use the Grails test-app command it runs everything. I want to build with Gradle on my Bamboo 5.9.7 integration server.
How do I use Gradle to run all tests, unit, integration, and functional Geb tests?

The test task is only supposed to run the unit tests. You probably want to run integrationTest or iT for short.

In order to get grails3 gradle tests to mimic the way that grails test-app works in grails2 you might try using
gradlew --continue test iT
This will cause both unit and integration tests to run. Without the --continue option, if you have a failing unit test the integration tests will not execute.
Unfortunately I don't see how to add the "--continue" option to gradle commands when running from intellij.

Related

VueJS, run e2e tests using Cypress into a Jenkins pipeline using a docker image

I created a VueJs project with some unit tests (using Jest) and integration tests using Cypress.
I have also a Jenkins pipeline in order to build, test and deploy the application.
I Integrated, as test stage, the unit tests but I would like to integrate also Cypress in order to run the integration tests into a dedicated pipeline step.
Is is possible to have this without installing any additional Cypress Jenkins plugin?
I mean, Is it possible to use a docker image to run the tests using Cypress?
Can you point me to some examples?
You should be able to use this with Jenkins Docker capabilities. Also here is another example you can refer to.

Spinning up Karate test client in a docker container

I am setting up the integration test framework for a Java rest api in our project and we want to run integration test in the gitlab pipeline. Since these tests are running in the same project as the API, we are wondering couple of things:
We dont want to run Karate tests during the maven build process. We want to run them only at integration test stage after the application deployment stage is complete. How do we do that as the maven build process runs both the junit unit tests and karate tests.
Since the API requires authentication, we need to run the karate test in a docker container, since we can inject our credentials only in the container as we are using hashi-corp vault to store the credentials. How do we launch a container with Karate client.
There are ways to run only a subset using Maven. What I do is define a different JUnit test, and call that from the command-line. Read the docs for more: https://github.com/karatelabs/karate#command-line
As long as you can pass environment variables (which you certainly can in Docker) you are good. Refer: https://stackoverflow.com/a/52821230/143475

How do I run MSpec tests in parallel on TFS 2013?

I'm trying to get a bunch of MSpec tests to run on multiple cores in TFS 2013. It doesn't appear to do it out of the box. It can run MSpec, but only in sequence and it takes a over an hour.
I am following this guide, but in step 4 he says replace the Foreach Xaml element with ParallelForEach to get the tests to run in parallel. I downloaded the default build template in TFS 2013. It is a lot simpler, but it doesn't have this tag.
It has:
<mtba:RunAgileTestRunner
DisplayName="Run VS Test Runner"
Enabled="[Not AdvancedTestSettings.GetValue(Of Boolean("DisableTests", false)]"
TestSpecs="[AutomatedTests]"
ConfigurationsToTest="[ConfigurationsToBuild]" />
The default MSpec test runner cannot run tests in parallel. That's why you see the reimplementation of a parallel test runner.
I doubt that TFS is implementing an MSpec test runner from the framework source code (although that would be possible). That parallel test runner is using internal classes, like ISpecificationRunner, and running them in parallel.
Your only options, if you must stick with MSpec and TFS, are
Split your tests into multiple projects/assemblies and feed them to a TFS parallel task that shell-executes the default test runner
Use a TFS shell-execute task to run your tests through the parallel runner
I am assuming that if you want to run tests in parallel they are integration tests that take a long time to run.
If that is the cas then you should move all non Unit Tests out of the build and push them further down the pipeline.
http://nakedalm.com/execute-tests-release-management-visual-studio-2013/
You can use Release Management to deploy your application and run your integration tests. Here you can run a larger number of long running tests without locking your build servers.

running jRuby cucumber acceptance tests in a Grails environment

It's great to be able to run
grails test-app, test-app integration:, test-app unit:, etc.
My team has some jRuby Cucumber acceptance tests. How can we run these similarly with a grails-script?

Executing HTML testsuite using Jenkins

I have recorded some simple selenium tests by Selenium IDE. Now I want to run those tests in Jenkins.
Which plugin to Jenkins do I need to do that? And how to run the tests step by step?
My test suite is in HTML.
Can you provide detailed steps for it?
Why isn't enough to run the selenium tests from maven though jenkins? This is how we made it work. If your jenkins is running on unix environment you should bear in mind that additional configuration of the system are needed.

Resources