Chore: Add betterer test to track conversion of enzyme tests (#45055)

* Add betterer test for number of enzyme tests

* emit metric for number of enzyme tests

* update frontend metrics script

* Merge...

* Switch order of betterer/lint

* Update version of betterer

* kick levitate

* Update lockfile
This commit is contained in:
Ashley Harrison
2022-02-09 12:41:39 +00:00
committed by GitHub
parent 80352396ca
commit d3d7411e36
5 changed files with 813 additions and 23 deletions

View File

@ -8,6 +8,7 @@ CONTROLLERS="$(grep -r -oP 'class .*Ctrl' public/app/ | wc -l)"
STORIES_COUNT="$(find ./packages/grafana-ui/src/components -name "*.story.tsx" | wc -l)"
MDX_COUNT="$(find ./packages/grafana-ui/src/components -name "*.mdx" | wc -l)"
LEGACY_FORMS="$(grep -r -oP 'LegacyForms;' public/app | wc -l)"
ENZYME_TEST_COUNT="$(grep -l -R --include="*.test.*" "from 'enzyme'" public packages | wc -l)"
STRICT_LINT_RESULTS="$(yarn run eslint --rule '@typescript-eslint/no-explicit-any: ["error"]' --format unix --ext .ts,.tsx ./public || true)"
STRICT_LINT_EXPLICIT_ANY="$(echo "${STRICT_LINT_RESULTS}" | grep -o "no-explicit-any" | wc -l)"
@ -35,6 +36,7 @@ echo -e "Low vulnerabilities: $LOW_VULNERABILITIES"
echo -e "Med vulnerabilities: $MED_VULNERABILITIES"
echo -e "High vulnerabilities: $HIGH_VULNERABILITIES"
echo -e "Critical vulnerabilities: $CRITICAL_VULNERABILITIES"
echo -e "Number of enzyme tests: $ENZYME_TEST_COUNT"
echo "Metrics: {
\"grafana.ci-code.strictErrors\": \"${ERROR_COUNT}\",
@ -47,4 +49,5 @@ echo "Metrics: {
\"grafana.ci-code.strictLint.noExplicitAny\": \"${STRICT_LINT_EXPLICIT_ANY}\",
\"grafana.ci-code.bundleFolderSize\": \"${TOTAL_BUNDLE}\",
\"grafana.ci-code.dependencies.outdated\": \"${OUTDATED_DEPENDENCIES}\"
\"grafana.ci-code.enzymeTests\": \"${ENZYME_TEST_COUNT}\"
}"