Scuemata: Add test to validate devenv resources (#35810)

* Add test for devenv resources

* Refactor validation tests for grokkability

* Devenv dashboards error-tracking script

* Refactor to use cueerrors.Details()

* Further test refinement

* Close major elements of dashboard schema

* Centralize dashboard validation tests

General dashboard validation testing belongs in the load package.

* Better names for error context on glue CUE code

* Fixup validate-resource

Do only one of base or dist, and fix copied docs.

* Skip the devenv test

* Remove test for validateResources

* Fix shellcheck

* Backend linter

Co-authored-by: sam boyer <sdboyer@grafana.com>
This commit is contained in:
Dimitris Sotirakis
2021-07-16 03:08:03 +03:00
committed by GitHub
parent 8de218d5f1
commit 2e0dc835cf
10 changed files with 115 additions and 109 deletions

View File

@ -142,13 +142,18 @@ var cueCommands = []*cli.Command{
},
{
Name: "validate-resource",
Usage: "validate *.cue files in the project",
Usage: "validate resource files (e.g. dashboard JSON) against schema",
Action: runPluginCommand(cmd.validateResources),
Flags: []cli.Flag{
&cli.StringFlag{
Name: "dashboard",
Usage: "dashboard JSON file to validate",
},
&cli.BoolFlag{
Name: "base-only",
Usage: "validate using only base schema, not dist (includes plugin schema)",
Value: false,
},
},
},
}