You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: githubpost_test.go
    path of file: ./repos/cockroach/pkg/cmd/bazci/githubpost
    
    the code of the file until where you have to start completion: // Copyright 2016 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0, included in the file
// licenses/APL.txt.

package githubpost

import (
	"context"
	"encoding/xml"
	"os"
	"strings"
	"testing"

	bazelutil "github.com/cockroachdb/cockroach/pkg/build/util"
	"github.com/cockroachdb/cockroach/pkg/cmd/internal/issues"
	"github.com/cockroachdb/cockroach/pkg/testutils/datapathutils"
	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
)

type issue struct {
	testName   string
	title      string
	message    string
	expRepro   string
	mention    []string
	labels     []string
	hasProject bool
}

func init() {
	fileLineForTesting = map[packageAndTest]fileAndLine{
		{
			packageName: "github.com/cockroachdb/cockroach/pkg/util/stop",
			testName:    "TestStopperWithCancelConcurrent",
		}: {
			filename: "pkg/util/stop/stopper_test.go",
			linenum:  "375",
		},
		{
			packageName: "github.com/cockroachdb/cockroach/pkg/kv/kvserver",
			testName:    "TestReplicateQueueRebalance",
		}: {
			filename: "pkg/kv/kvserver/replicate_queue_test.go",
			linenum:  "56",
		},
		{
			packageName: "github.com/cockroachdb/cockroach/pkg/kv/kvserver",
			testName:    "TestGossipHandlesReplacedNode",
		}: {
			filename: "pkg/kv/kvserver/gossip_test.go",
			linenum:  "142",
		},
		{
    
func TestListFailuresFromTestXML(t *testing.T) {
	testCases := []struct {
		fileName  string
		expPkg    string
		expIssues []issue
		formatter Formatter
	}{
		{
			fileName: "basic.xml",
			expPkg:   "github.com/cockroachdb/cockroach/pkg/util/json",
			expIssues: []issue{{
				testName: "TestJSONErrors",
				title:    "util/json: TestJSONErrors failed",
				message: `=== RUN   TestJSONErrors
--- FAIL: TestJSONErrors (0.00s)
=== RUN   TestJSONErrors/frues
    json_test.go:278: expected error message to be 'trailing characters after JSON document', but was 'unable to decode JSON: invalid character 'r' in literal false (expecting 'a')'
    --- FAIL: TestJSONErrors/frues (0.00s)`,
				mention: []string{"@cockroachdb/unowned"},
			}},
			formatter: DefaultFormatter,
		},
	}

	for _, c := range testCases {
		t.Run(c.fileName, func(t *testing.T) {
			content, err := os.ReadFile(datapathutils.TestDataPath(t, c.fileName))
			if err != nil {
				t.Fatal(err)
			}
			var testXml bazelutil.TestSuites
			if err := xml.Unmarshal(content, &testXml); err != nil {
				t.Fatal(err)
			}
			curIssue := 0

			f := func(ctx context.Context, f Failure) error {
				if t.Failed() {
					return nil
				}
				if curIssue >= len(c.expIssues) {
					t.Errorf("unexpected issue filed. title: %s", f.title)
				}
				if exp := c.expPkg; exp != f.packageName {
					t.Errorf("expected package %s, but got %s", exp, f.packageName)
				}
				if exp := c.expIssues[curIssue].testName; exp != f.testName {
					t.Errorf("expected test name %s, but got %s", exp, f.testName)
				}
				if exp := c.expIssues[curIssue].title; exp != f.title {
					t.Errorf("expected title %s, but got %s", exp, f.title)
				}
				if exp := c.expIssues[curIssue].message; !strings.Contains(f.testMessage, exp) {
					t.Errorf("expected message containing %s, but got:\n%s", exp, f.testMessage)
				}
				curIssue++
				return nil
			}
			if err := listFailuresFromTestXML(context.Background(), testXml, f); err != nil {
				t.Fatal(err)
			}
			if curIssue != len(c.expIssues) {
				t.Fatalf("expected %d issues, got: %d", len(c.expIssues), curIssue)
			}
		})
	}
}