opendevstack / ods-quickstarters

Contains project quickstarters (boilerplates) for Nginx, Go, Java (Spring Boot), Python (Flask), Rust (Axum), Scala (Play), TypeScript (Express), Angular, Ionic, Jupyter, RShiny - all including CI/CD integration & Jenkins build agents
Apache License 2.0
27 stars 39 forks source link

MRO / Quality Release tracking issues for quickstarters #175

Closed clemensutschig closed 4 years ago

clemensutschig commented 4 years ago
  1. Each quickstarter (except airflow, r.shiny, jupyther, docker plain and release manager) has Sonarqube enabled (that implies working sonar-project.properties)
https://github.com/opendevstack/ods-jenkins-shared-library/blob/master/vars/stageScanForSonarqube.groovy

and output is verified in SQ & jenkins log (e.g. Node.js currently fails with)

INFO: Load project repositories
INFO: Load project repositories (done) | time=6ms
ERROR: You are using version of TypeScript 2.9.2 which is not supported; supported versions >=3.2.1
ERROR: If it's not possible to upgrade version of TypeScript used by the project, consider installing supported TypeScript version just for the time of analysis
ERROR: Failure during analysis, Node.js command to start eslint-bridge was: 
  1. Each quickstarter (except airflow, r.shiny, jupyther, docker plain and release manager) dumps the xUnit results into the right folder for shared lib to pick it up and stash it for the mro
https://github.com/opendevstack/ods-jenkins-shared-library/blob/master/src/org/ods/OdsPipeline.groovy#L164
  1. Each quickstarter (except airflow, r.shiny, jupyther, , docker plain and release manager) calls junit to notify jenkins of the xUnit results
      junit 'build/test-results/test/*.xml'
  1. Other related issues:
    • related to #165
    • related to #166
    • related to #167
clemensutschig commented 4 years ago

@metmajer fyi.

gerardcl commented 4 years ago

hi! airflow now also has sonarqube (#174), I will provide jUnit fix also solved OOM Killed issue in ds-rshiny ⚙️ -> #177

missing: fe-react seems suffering also and OOM Killed error but at provisioning stage. proposal: enable the pod with more memory (right now default resources are undefined <- not enough)

clemensutschig commented 4 years ago

There is one general topic we have to talk about. Junit. We could do this centrally in the Shared lib.. where we collect results... or in every quickstarters build Phase.. thoughts??

this could just go here (@renedupont ) https://github.com/opendevstack/ods-jenkins-shared-library/blob/master/src/org/ods/OdsPipeline.groovy#L193

with allowEmptyResults = true

@metmajer - fyi.

metmajer commented 4 years ago

Preferably in a single location, so there’s one less thing to care about :-)

FYI @stitakis

metmajer commented 4 years ago

@stitakis Here is the link to the junit plugin: https://jenkins.io/doc/pipeline/steps/junit/. You can use the allowEmptyResults attribute safely inside the ODS shared lib. MRO addresses missing test results if they are needed but not provided.

clemensutschig commented 4 years ago

the only challenge I see is to have twice junit results (because mro runs out of a different path) .. I need to play with this a little ... I remember seeing this ...

metmajer commented 4 years ago

@clemensutschig we have once used the Junit Plugin in the MRO - not anymore

clemensutschig commented 4 years ago

@metmajer - u sure?

https://github.com/opendevstack/ods-mro-jenkins-shared-library/blob/master/src/org/ods/usecase/JUnitTestReportsUseCase.groovy#L51

https://github.com/opendevstack/ods-mro-jenkins-shared-library/blob/master/src/org/ods/util/PipelineSteps.groovy#L35

:)

I think it's ok - we just have to play with it :) just to see if there are no side effects.. (and please leave as is :))

stitakis commented 4 years ago

@clemensutschig @metmajer @renedupont to quickly test Clemens proposal of adding junit to odsPipeline, I've added following code to odsPipeline.stashTestResults(...) in line 176:

junit ('build/test-results/test/*.xml', allowEmptyResults : true)

It failed because junit is not a know method in the class. Here the error:

hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: org.ods.OdsPipeline.junit() is applicable for argument types: (java.util.LinkedHashMap, java.lang.String) values: [[allowEmptyResults:true], build/test-results/test/*.xml]
Possible solutions: wait(), find(), any(), dump(), print(java.lang.Object), print(java.io.PrintWriter)

Have you imported junit to odsPipeline before? Do you know the import line?

metmajer commented 4 years ago

@stitakis try doing it as follows:

junit (testResults: 'build/test-results/test/*.xml', allowEmptyResults : true)
clemensutschig commented 4 years ago

script.junit .. done

stitakis commented 4 years ago

@metmajer @clemensutschig @renedupont worked

script.junit (testResults: 'build/test-results/test/*.xml', allowEmptyResults : true)

In my test junit was called many time in the build script. Last time is in the odsPipeline as above. It seemed to not corrupt the displayed results in Jenkins

stitakis commented 4 years ago

This PR #178 above fixed 2 issues: it adds sonarqube to flask qs it adds junit and copy test reports to standard test-report folder

stitakis commented 4 years ago

Currently 2 known issues in QS:

renedupont commented 4 years ago

added this script.junit etc. line to the shared lib like this: script.junit (testResults: "${testLocation}/**/*.xml", allowEmptyResults : true) see https://github.com/opendevstack/ods-jenkins-shared-library/pull/210/files#diff-9b926a359deb3f339e040516225f076eR188

Not sure if this completes this issue, if yes, please close.