Skip to content

Commit

Permalink
enh(CI): Integrate Lighthouse CI (centreon#10399)
Browse files Browse the repository at this point in the history
* Install lighthouse packages

* Add lighthouse ci configuration

* Ignore lighthouse CI output

* Add jotai and use branch on centreon-frontend

* Integrate jotai to graph values follow up

* Migrate annotation to jotai

* Fix eslint warning

* Remove unused hook

* Refactor annotation atoms

* Migrate graph options to jotai

* Fix tests

* Remove graph options context

* Move panel width storage to jotai

* Remove file

* Migrate details cards storage to jotai

* Fix eslint errors

* Migrate details and time period to jotai

* Update dep

* Migrate listing related shared data to jotai

* Fix tests

* Fix auto refresh

* Fix graph endpoint update

* Fix eslint error

* Migrate actions to jotai

* fix eslint warning

* Fix import path

* Migrate filters to jotai

* Remove Resource Context

* Remove memoization on panel Header

* Improve performance for details tiles

* Allow to update tiles on refresh

* Integrate Lighthouse CI to Jenkinsfile

* Fix lighthouse CI sh

* Archive artifacts

* Fix script execution and archive artifacts

* Enable Lighthouse CI only for frontend build

* Use develop branch

* Use publish HTML function from Jenkins pipeline

* Fix reportDir

* Fix path with env vars

* Improve interfaces and properties name

* Migrate usr context to jotai

* Fix tests

* Update to dev branch

* Fix test

* Fix timezone

* Improve Lighthouse CI configuration

* Add script to open lhci report

* Fix packages

* Fix packages

* Fix tests

* Checkout file

* Fix merge
  • Loading branch information
Thebarda committed Dec 10, 2021
1 parent 5594d50 commit 54bb023
Show file tree
Hide file tree
Showing 6 changed files with 5,212 additions and 2,390 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,7 @@ www/widgets
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
ehthumbs_vista.db

.lighthouseci
manifest.json
19 changes: 18 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ try {
}
}

stage('API // E2E') {
stage('API // E2E // Lighthouse CI') {
parallel 'API Tests': {
if (hasBackendChanges) {
def parallelSteps = [:]
Expand Down Expand Up @@ -394,6 +394,23 @@ try {
}
}
parallel parallelSteps
},
'Lighthouse CI': {
if (hasFrontendChanges) {
node {
checkoutCentreonBuild();
unstash 'tar-sources'
sh "./centreon-build/jobs/web/${serie}/mon-web-lighthouse-ci.sh centos7"
publishHTML([
allowMissing: false,
keepAll: true,
reportDir: "$PROJECT-$VERSION/.lighthouseci",
reportFiles: 'lighthouseci-index.html',
reportName: 'Centreon Web Performances',
reportTitles: ''
])
}
}
}
}

Expand Down
30 changes: 30 additions & 0 deletions lighthouserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const baseUrl = 'http://localhost:4000/';

module.exports = {
baseUrl,
ci: {
assert: {
preset: 'lighthouse:no-pwa',
},
collect: {
isSinglePageApplication: true,
numberOfRuns: 1,
puppeteerScript: './puppeteer-script.js',
settings: {
configPath:
'./node_modules/lighthouse/lighthouse-core/config/lr-desktop-config.js',
onlyCategories: [
'performance',
'accessibility',
'best-practices',
'seo',
],
},
url: `${baseUrl}centreon/monitoring/resources`,
},
upload: {
reportFilenamePattern: '.lighthouseci/lighthouseci-index.%%EXTENSION%%',
target: 'filesystem',
},
},
};
Loading

0 comments on commit 54bb023

Please sign in to comment.