s3-tests-parser/internal/s3/structure.go
Denis Kirillov e54a9c9e6c [#2] Support verbose flag and include
Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
2024-11-08 11:23:06 +03:00

32 lines
669 B
Go

package s3
import (
_ "embed"
"encoding/json"
"fmt"
)
//go:embed resources/tests-struct.json
var testStructData []byte
type TestsStructure struct {
Groups []Group `json:"groups"`
}
type Group struct {
Name string `json:"name"`
Tag string `json:"tag"`
Skip bool `json:"skip"`
Comment string `json:"comment"`
Tests []string `json:"tests"`
Include []string `json:"include"`
}
func ParseTestsStruct() (TestsStructure, error) {
var testStruct TestsStructure
if err := json.Unmarshal(testStructData, &testStruct); err != nil {
return TestsStructure{}, fmt.Errorf("failed to parse tests struct: %w", err)
}
return testStruct, nil
}