github.com/caos/orbos@v1.5.14-0.20221103111702-e6cd0cea7ad4/cmd/chore/e2e/run/github.go (about)

     1  package main
     2  
     3  /*
     4  import "github.com/caos/orbos/cmd/chore/e2e/shared"
     5  
     6  func github(branch, token, testcase string, test func(orbconfig string) error) func(orbconfig string) error {
     7  
     8  	send := func(status string) {
     9  		if err := shared.Emit(shared.Event{
    10  			EventType: "webhook-e2e-" + testcase,
    11  			ClientPayload: map[string]string{
    12  				"status": "running",
    13  			},
    14  			Branch: branch,
    15  		}, token, "caos", "orbos"); err != nil {
    16  			panic(err)
    17  		}
    18  	}
    19  
    20  	return func(orbconfig string) error {
    21  		send("running")
    22  
    23  		result := "failure"
    24  		err := test(orbconfig)
    25  		if err == nil {
    26  			result = "success"
    27  		}
    28  		send(result)
    29  		return err
    30  	}
    31  
    32  }
    33  */