goals in cobertura plugin for maven 2 independent of each other? - maven-plugin

in the cobertura plugin for maven 2 , are all the goals exclusive of each other ? as in .. what i want is that there should be a check as well as there should be report generation , when i use the cobertura goal in my build , check is not done .. when i use the check goal , reports are not generated , i had to use both goals to get what i desire , but then it runs the tests as many times .. this is what i am doing
org.codehaus.mojo
cobertura-maven-plugin
93
88
html
verify
cobertura
check
or is it that i am doing something wrong ?

You have to configure the cobertura plugin in both areas. In the build area to do checkings and in the reporting area as well to get reports like the docs says.
Whay not calling mvn site or mvn package ? If you configured it correct it will run as part of the phases.

Related

Turborepo with 2 react apps and CircleCI CI/CD only run for changed app

I'm using Turborepo for my monorepo project, i have 2 react apps. How can i configure Turborepo and CircleCI (repos are on Github) so if i make changes to one project that pipeline is not going to run for second project?
I know turbo is using hash algo to check if there is any changes to a project and then rebuild it.
I have tried looking here https://turborepo.org/docs/ci/circleci but does not explain the behavior of this.
Steps would be:
Make code change to Project 1
Commit changes of monorepo to Github
Github detects a commit and triggers CircleCI to run CI/CD
So this part is what I'm not sure, if it triggers CI/CD it will trigger for the both projects right? And if so how can i prevent only for the one i have made changes?
I've been working on such a solution for days now. There are two core-concepts in turborepo to achieve this:
Filtering workspaces
Caching Buildoutputs and store the cache in the cloud (not what you're looking for)
So, you can filter your monorepo for a specific project, e.g:
pnpm turbo run build --filter='my-project...[HEAD^1]' --dry=json
-> This will look if the task build is needed to run for the project "my-project", comparing the current source with "HEAD^1". The option dry=json helps to just look if there would be a need to run "build" or not for "my-project".
You could filter a whole lot more, check the docs.
Now, what i have built on top of this:
A new job on the github workflow looks with the help of this filter command if a deployment of my graphql-server is needed and he will set the output of this decision as an artifact, to provide this information for later jobs (https://github.com/actions/upload-artifact)
My actual docker-build and deploy-to-fly-io jobs that run afterwards, will download this artifact and set a CONTINUE environment variable, depending if it should build + deploy or not.
Every job coming after that is having an if: ${{ env.CONTINUE == 'true' }} to skip them if no build/deploy is needed.
It could be much simpler if you can run your build/deploy job directly with the turbo cli, because then you can just combine your filter and the execution of the build - but that was not possible in my case.
If you need to "skip" jobs that are coming later in your workflow, it's harder thant it should, as github is not supporting "abortion" of jobs.
For all the other commands like lint, typecheck and test -> just add an appropriate filter option to them and you will achieve that they only run on your "affected" workspaces/projects in your PR.
Ressources:
https://dev.to/ngconf/deploying-nx-affected-apps-from-github-actions-54n4
How can I get the previous commit before a push or merge in GitHub Action workflow?
https://github.com/orgs/community/discussions/26313

Results for deleted / renamed tests still appear in Allure reports using Jenkins Allure plugin

I am using the Jenkins Allure plugin to generate reports for PyTest runs.
I've noticed that if I delete a failing test from my repository, or rename a failing test, the Allure reports generated by Jenkins continue to show failures for the old tests, even though they no longer exist and did not run in the most recent job.
How do I ensure that Allure reports only contain results for tests that actually ran in the latest job?
You should generate the results in allure-results directory in your root project.
Every time you run your job, those new allure results files will be generated in the Jenkins workspace. You should clean your workspace before the build starts to ensure that you are taking the last execution:
Frank Escobar's answer is correct.
I want to add that if you're using a pipeline the option in his screenshot is not available.
In that case, use the Jenkins Clear Workspace plugin https://jenkins.io/doc/pipeline/steps/ws-cleanup/ and create a pipeline step to clear your workspace before starting the test run.

How can one import the whole webDriver project in an executable form so that anybody else can run the suite by just a click.?

I am relatively new to Selenium WebDriver and a self learner. I have created a webDriver project which consists of different packages and have made use of Page Factory concepts extensively. I use TestNg framework to run the suite to generate my report. So my test cases are also following the TestNG framework concepts.
Now my team wants to use my script to be run at every build to test the sanity. The build team just wants to run my whole script by just a click. It can be shell script command or .exe or jar. Build team uses linux m/c and they dont have Ecplise , TestNg installed in their machine. Their intention is whenever build is given they want to run my script by just a click or a command in Command Prompt.( it has to be that simple for them) and a report should be generated in some location in hdfs
My script runs on FF version 32 and Selenium webDriver 2.44.0
Would really appreciate if someone could give me a solution that actually works for my requirement.
I found a similar query from someone but i am not sure if the answer still suits.
How to make Java executable Jar file of WebDriver project
Could somebody please give me a solution. Or the solution mentioned in the above link stil is the best?
Regards
There are few ways to do it:
Use CI tool (Jenkins): You can set up your project in Jenkins and it will allow you to run the project in single click. Jenkins also provides you an option to run the tests periodically so you can configure it in such a way that it will always get executed after certain time period.Jenkins is also capable to trigger the execution if there is any changes in source code of tests. I'd suggest to use this tool. https://jenkins-ci.org/
Use .bat or .sh file: I am not sure if you are using any build tool like ANT or Maven, if you are using any one of them then you can write a .bat or .sh file to run the tests. ANT
If you are not using any build tool then start using, it will help to run the tests in simplest way.For me to run entire suite, I just type below command in terminal from root directory of project
ant run -Dsuite=all
If you are more concerned about system configuration for e.g. the system which will be used by build team does not have a specific version of browser or specific required library. Then I'd suggest to keep all essentials like browser installation files, libraries in your project directory. This is not a good practice but yes it will help others to run the tests smoothly.
I would suggest just exporting a jar file for your project. All the libraries will be packaged together in the jar files(including TestNG) and you can simply double click on the jar file to start your tests.
External resources (if any), will have to be available for the jar file though. So, you can provide the jar file and the external resources together. The external resources might include your test data (if any) or Portable Firefox(if you are using the portable version).
Steps:
Right click on Project -> Export -> Runnable jar file
Give a name and file path for the jar file
Select option - Extract required libraries into generated JAR
And Finish
Troubleshooting:
Check the java version for the machines that you will be running your jar file on. Programs compiled with java 7 will mostly not run if the machine has java 6. Either compile with java 6 or update the jre on the target machines.
If the jar file does not launch, try using Jarfix.

Maven 3 plugin that only runs on parent

I created a maven plugin (plugin api 3.0.4 + plugin annotations 3.2) that should only run on the parent (for multi module projects). Is there a way to do that in the Mojo instead of telling the user to run it with "-N" (non recursive) Option?
#aggregator true
within comments didn't work
thx in advance

Jenkins plugin for xunit to generate Jbehave reports

I am running Jbehave tests and wanted to view the Jbehave reports on Jenkins. I have installed xunit plugin on Jenkins as mentioned in http://jbehave.org/reference/stable/hudson-plugin.html . When I configure xunit test reports under the Post-build Actions of Jenkins job, I do not see the option for JBehave to add the report. xunit plugin installed is v 1.61. Can anyone tell me if I m doing something wrong or missing anything here?
Ok so to see your jbehave tests in jenkins you need install on jenkins
xUnit jenkins plugin
Then install JBehave Hudson Plugin
2.2 Read about it here
http://jbehave.org/reference/stable/hudson-plugin.html
2.3 Download hpi file (I use:
jbehave-jenkins-plugin-3.7.4.hpi Sat Nov 24 04:38:22 CST 2012 90030
) from:
https://nexus.codehaus.org/content/repositories/releases/org/jbehave/jbehave-jenkins-plugin/3.7.4/
2.4 Go to your jenkins to pluginManager/advanced and in sectionUpload Plugin ad downloaded file and upload it
2.5 It should become visible in pluginManager/available section - so just check and install it.
Now navigate to your build to xUnit Post-build Actions and enjoy jbehave options
3.1 Add directory where plugin should look for xml report like **/jbehave/*.xml
3.2 If your jbehave is configured properly you should get all reports located in your workspace
If you need more help like configuring html view of jbehave reports, setting maven etc. make new question or update this one
Cheers
You may not have to use xunit plugin to see the test reports.
There are other options available.
Make sure you have generate the required outputs (org.jbehave.core.reporters.XmlOutput). Then just publish the Junit test result.
Make sure you have generate the required outputs (HTML). Include
<dependency>
<groupId>org.jbehave.site</groupId>
<artifactId>jbehave-site-resources</artifactId>
<version>3.1.1</version>
<type>zip</type>
</dependency>
And you can publish as one of the HTML reports.

Resources