We would like to gradually improve our code quality in foundry code repositories. As a start we would like to run pylint in every CI run, but do not fail the run, just get a pylint score in the logs.
How can we configure the 'com.palantir.conda.pylint'-plugin to return exit code 0 and not fail and to show us the pylint output in each CI run?
Related
I am writing tests using junit to run in TeamCity pipeline. For logging I am using org.apache.log4j.Logger.info(), but I cannot find the log in TeamCity build log. It works without any problem in console.
Do I have to use something else for TeamCity?
I'm having an odd issue with the awsebcli package when running it on Gitlab's pipeline CI system.
When I run eb deploy locally, the command succeeds (or fails) much as expected. When I run it as part of the CD scripts I've written, it runs successfully (i.e. returns an exit code of 0) but doesn't actually trigger the deployment. No errors are returned - in fact there's no text output from the command at all.
Can anyone suggest what could be going wrong here?
I am setting up Jenkins 1.452 with the Promote Build plugin to promote builds. I have a very simple 2 step Promotion path right now.
Compile and Install (creates Jar)
UAT Deploy (Pushes Jar to my application server)
I have this broken into 2 jobs, and both run successfully on their own - however when I try to setup the promotion process I the following error:
Legacy code started this job. No cause information is available
Building in workspace /Users/theatre/.jenkins/jobs/ActiveCQ API (Compile)/workspace
Promoting ActiveCQ API (Compile) #38
scheduling build for ActiveCQ API (UAT Deploy)
Recording fingerprints
ERROR: Build artifacts are supposed to be fingerprinted, but build artifact archiving is not configured[8mha:AAAAWB+LCAAAAAAAAABb85aBtbiIQSmjNKU4P08vOT+vOD8nVc8DzHWtSE4tKMnMz/PLL0ldFVf2c+b/lb5MDAwVRQxSaBqcITRIIQMEMIIUFgAAckCEiWAAAAA=[0mbuild hudson.tasks.Fingerprinter#217aa061 FAILURE
Archiving artifacts
build hudson.tasks.ArtifactArchiver#79b75172 FAILURE
Finished: FAILURE
I am attached screen caps of the config for the (Compile) job.
I have Fingerprinting and Archiving setup, and I can even see the list of artifacts w their fingerprints listed in the console.
Compile build screenshot
UAT Build Showing Archived Artifact w fingerprint
UAT Build Job Config
Some recommendations I would suggest:
Do NOT archive and fingerprint in a promotion process. A promotion process is really a separate job and a separate build. Instead, you should archive and fingerprint the files in the Compile job's Post-build Actions. The compile job has to be the origin of the fingerprint for the promotion process to work robustly.
In the Deploy job, somehow get the same file that was fingerprinted in the Compile job and also fingerprint it in the Deploy job.
I can't see how the Deploy job is getting the jar file. I would recommend using the Copy Artifact plugin that uses parameters - specifically a build number or perhaps the upstream-build - to retrieve the same file.
I have a bunch of Maven projects building in Hudson with Sonar sitting in the side-lines. Sonar gives me Sonar stats, FindBugs stats, and code-coverage.
I've noticed that regardless of if I use Sonar or if I use EMMA via Maven directly, the entire build cycle runs twice. This includes init (which in my case, reinitializes the database -- expensive) and unit tests (a few hundred -- also expensive).
How can I prevent this? I did a lot of reading, and it seems like this is due to the design of code-coverage plugins -- to keep uninstrumented classes separated from instrumented ones.
I've tried configurations like:
Maven runs: deploy, EMMA
Maven runs: deploy; deploy to Sonar on completion
The sonar documentation recommends running the sonar plugin in 2 stages:-
mvn clean install -Dtest=false -DfailIfNoTests=false
mvn sonar:sonar
The tests are bypassed in the first phase and run implicitly in the second stage.
A one line alternative is to run the following command:-
mvn clean install sonar:sonar -Dmaven.test.failure.ignore=true
but this will run the tests twice - as you have found.
To add to #Strawberry's answer, you could reuse the unit test reports instead of running them again. Refer to the section Reuse existing unit test reports in the sonar documentation
Once this is done, you can configure the following in Hudson
clean deploy sonar:sonar
My NAnt builds run fine locally on a developer machine, and locally on the command line of the Hudson server, but they will not run in my configured Hudson project.
The console output when I run a Build via the Hudson web UI is similar to the following :
Started by user anonymous [workspace]
$ sh -xe
C:\WINDOWS\TEMP\hudson8104357939096562606.sh
C:\WINDOWS\TEMP\hudson8104357939096562606.sh:
fork failed: no error [1] Archiving
artifacts Finished: SUCCESS
I have another project configured properly that runs fine so I know the NAnt plugin is setup properly in Hudson, and that NAnt is on the system path.
Can anyone suggest possible causes as to why this build won't run?
The problematic build may be configured to Execute a Shell script, rather than Execute a Windows Batch file.
Copy the command from the existing build step (the Execute Shell Script) and remove the step. Then add a new step to Execute a windows Batch File and paste the command.
Trigger the build and observe the results.
(I asked and answered this since it took me quite a while to figure out how I had mis-configured this particular build. Hopefully it'll save time or give ideas to other people trouble-shooting automation..)