Noe Watch is a web app used for long-term tracking of failing tests in a CI/CD environment.
Noe Watch is built on top of:
- NodeJS Javascript runtime
- MongoDB backend database
- Handlebars templating engine
- Sassy CSS
- Red Hat's Patternfly CSS framework
It is intended to run on Red Hat's Kubernetes distribution (Openshift), but can be run separately as well, provided you supply a MongoDB connection URL.
There are three endpoints avaiable for usage:
- GET /readinessProbe: Returns 200 OK. This is to check whether the NodeJS server is working, regardless of the database connection
- GET /: If there is a successful DB connection, this renders the number of failures for each platform.
- POST /api/post/parsexml: Use this endpoint for uploading the results of your tests.
Noe Watch expects a JUnit XML to be uploaded as a payload in a POST request. For example:
curl -i -H "Content-Type: text/xml" -X POST -d @result.xml localhost:3000/api/post/parsexml?platform=solaris\&project=jws
Where:
- result.xml is a JUnit report
- localhost:3000 is a hostname and port of your application
- platform is a query parameter specifying for which platform are you uploading the results
- project is a query parameter specifying for which project you are uploading the results.
The platform query parameter is required. There are three possible platform parameters:
- Windows
- Solaris
- RHEL
The project query parameter is required. If the project does not exist, it is created and appears with the first write of results in the / endpoint.
You may tweak the plaforms in the constants.js file.
To run Noe Watch, you need:
npm
node
Alternatively, those can be replaced by:
oc
if you deploy on OpenShift. Note that you can get a free OpenShift account.
Check that you have them installed by issuing:
$ npm -v
6.4.1
$ node -v
v10.12.0
# Alternatively:
$ oc version
oc v3.9.0
kubernetes v1.9.1+cbc5b49
features: Basic-Auth GSSAPI Kerberos SPNEGO
...
To run Noe Watch locally:
- Install dependencies:
npm install
- Compile SCSS into CSS:
npm run build-scss
- Run Noe:
npm start
This will execute dev setup, where NodeJS is automatically restarted after each change to the
js files. To automatically compile SCSS into CSS, execute npm run watch-scss
in a separate window.
If you're executing Noe Watch locally, you are responsible for starting a MongoDB database. We recommend using Red Hat's MongoDB container, because that is used in OpenShift during deploy.
To view which environment properties you have to supply, see the constants.js file.
An OpenShift template has been provided in the openshift/noe-watch.json file. As such, the deployment of Noe Watch on OpenShift is simplified. To do so:
- Ensure you're logged in:
oc whoami
should return a username. - Create a new project:
oc new project noe-watch
- Upload the template:
oc create -f openshift/noe-watch.js
At this point, you can either:
- Log into the web console and search for Noe Watch (see documentation)
- Deploy the app from the command line:
$ oc new-app noe-watch-template \
-e STORAGE_CLASS_NAME=nfs4 \
-e APPLICATION_HOSTNAME=noe-watch.hostname.com
Be aware of the following:
MongoDB has difficulties with NFSv3 storage. As a consequence, in our OpenShift template, we provide the STORAGE_CLASS_NAME parameter for your Persistent Volume configuration. If you do not use NFSv3, and do not want to specify storage class name, you can safely delete the following from the OpenShift template:
// Do not forget to delete the comma before this property
"storageClassName": "${STORAGE_CLASS_NAME}"