Report stores a slice of Property structs rather than a map, to mimic JUnit properties, which have a deterministic ordering and allow multipler properties with the same name.

This commit is contained in:
greg-dennis
2022-08-23 10:41:42 -04:00
parent 35c4d8a827
commit 15d215e49d
3 changed files with 25 additions and 7 deletions

View File

@ -144,8 +144,8 @@ func CreateFromReport(report gtr.Report, hostname string) Testsuites {
suite.SetTimestamp(pkg.Timestamp)
}
for k, v := range pkg.Properties {
suite.AddProperty(k, v)
for _, p := range pkg.Properties {
suite.AddProperty(p.Name, p.Value)
}
if len(pkg.Output) > 0 {

View File

@ -19,7 +19,7 @@ func TestCreateFromReport(t *testing.T) {
Duration: 1 * time.Second,
Coverage: 0.9,
Output: []string{"output"},
Properties: map[string]string{"go.version": "go1.18"},
Properties: []gtr.Property{{Name: "go.version", Value: "go1.18"}},
Tests: []gtr.Test{
{
Name: "TestPass",