diff --git a/commands/lighthouse/lighthouse b/commands/lighthouse/lighthouse index 8b2426c..9f22bc9 100644 --- a/commands/lighthouse/lighthouse +++ b/commands/lighthouse/lighthouse @@ -6,6 +6,6 @@ ## Usage: lighthouse ## Example: "ddev lighthouse" ## ExecRaw: true -lhci autorun || true +lhci autorun --collect.outputDir=~/export || true sh -c 'tar -cf - *.json *.html' | tar -xvf - -C reports/lighthouse/ ls -l reports/lighthouse/ \ No newline at end of file diff --git a/commands/lighthouse/lighthouse-hc b/commands/lighthouse/lighthouse-hc new file mode 100644 index 0000000..33bbe46 --- /dev/null +++ b/commands/lighthouse/lighthouse-hc @@ -0,0 +1,9 @@ +#!/bin/bash + +#ddev-generated + +## Description: Run lighthouse healthcheck +## Usage: lighthouse-hc +## Example: "ddev lighthouse-hc" +## ExecRaw: true +lhci healthcheck \ No newline at end of file diff --git a/docker-compose.lighthouse.yaml b/docker-compose.lighthouse.yaml index dece82e..a258c58 100644 --- a/docker-compose.lighthouse.yaml +++ b/docker-compose.lighthouse.yaml @@ -12,7 +12,6 @@ services: labels: com.ddev.site-name: ${DDEV_SITENAME} com.ddev.approot: $DDEV_APPROOT - user: 'lhci' entrypoint: [ "docker-entrypoint.sh" ] environment: DDEV_HOSTNAME: $DDEV_HOSTNAME diff --git a/lighthouse/lighthouserc.js.example b/lighthouse/lighthouserc.js.example index a09303c..d08e761 100644 --- a/lighthouse/lighthouserc.js.example +++ b/lighthouse/lighthouserc.js.example @@ -1,9 +1,10 @@ +#ddev-generated // https://github.com/GoogleChrome/lighthouse-ci/blob/main/docs/configuration.md module.exports = { ci: { collect: { url: [ - 'http://web/en' + 'http://web/' ], numberOfRuns: 2, settings: { @@ -21,7 +22,7 @@ module.exports = { }, assert: { assertions: { - "categories:performance": ["error", {"minScore": 0.88}], + "categories:performance": ["error", {"minScore": 0.9}], "categories:accessibility": ["error", {"minScore": 0.9}], "categories:best-practices": ["error", {"minScore": 0.9}], "categories.seo": ["error", {"minScore": 0.9}], diff --git a/tests/test.bats b/tests/test.bats index 1270da9..3f3aef1 100644 --- a/tests/test.bats +++ b/tests/test.bats @@ -12,7 +12,7 @@ setup() { } health_checks() { - output=$(ddev exec -s lighthouse lhci healthcheck) + output=$(ddev lighthouse-hc) # Check if the output contains "Healthcheck passed!" [[ $output == *"Healthcheck passed"* ]] }