mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 23:03:01 +08:00
TestData: Introduce schema types (#62130)
* schematize data query * add the stuff you dingus * feat(testdatasource): add scenario to generated types * use generated testdata query in frontend * update code owners * Add path exception for testdata datasource * use specific numeric data types * fix test * fix e2e smoketest * add test data query type * use test data query type * fix betterer * Fix typo * move to experimental Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com> Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com> Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com> Co-authored-by: sam boyer <sdboyer@grafana.com> Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
This commit is contained in:
@ -51,6 +51,11 @@ func (j *pgoJenny) Generate(decl *pfs.PluginDecl) (*codejen.File, error) {
|
||||
}
|
||||
|
||||
pluginfolder := filepath.Base(decl.PluginPath)
|
||||
// hardcoded exception for testdata datasource, ONLY because "testdata" is basically a
|
||||
// language-reserved keyword for Go
|
||||
if pluginfolder == "testdata" {
|
||||
pluginfolder = "testdatasource"
|
||||
}
|
||||
filename := fmt.Sprintf("types_%s_gen.go", slotname)
|
||||
return codejen.NewFile(filepath.Join(j.root, pluginfolder, "kinds", slotname, filename), byt, j), nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user