Fix output 6
This commit is contained in:
parent
bae5a55db1
commit
c11b1939c2
|
@ -6,15 +6,10 @@ import (
|
|||
"database/sql"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"sync"
|
||||
)
|
||||
|
||||
func isGitHubActions() bool {
|
||||
return os.Getenv("GITHUB_ACTION") != ""
|
||||
}
|
||||
|
||||
// Test represents a single test.
|
||||
type Test struct {
|
||||
Name string
|
||||
|
@ -138,18 +133,18 @@ func (test *Test) Migrate(config Config, primary, replica *sql.DB) (err error) {
|
|||
}
|
||||
|
||||
var wg sync.WaitGroup
|
||||
stop := make(chan bool)
|
||||
stopStdout := make(chan bool)
|
||||
go func() {
|
||||
defer wg.Done()
|
||||
//if isGitHubActions() {
|
||||
fmt.Printf("::group::%s stdout\n", test.Name)
|
||||
//}
|
||||
if isGitHubActions() {
|
||||
fmt.Printf("::group::%s stdout\n", test.Name)
|
||||
}
|
||||
for {
|
||||
select {
|
||||
case <-stop:
|
||||
//if isGitHubActions() {
|
||||
fmt.Println("::endgroup::")
|
||||
//}
|
||||
case <-stopStdout:
|
||||
if isGitHubActions() {
|
||||
fmt.Println("::endgroup::")
|
||||
}
|
||||
return
|
||||
default:
|
||||
scanner := bufio.NewScanner(&stdout)
|
||||
|
@ -162,7 +157,7 @@ func (test *Test) Migrate(config Config, primary, replica *sql.DB) (err error) {
|
|||
wg.Add(1)
|
||||
|
||||
err = cmd.Wait()
|
||||
stop <- true
|
||||
stopStdout <- true
|
||||
wg.Wait()
|
||||
|
||||
if err != nil {
|
||||
|
|
|
@ -85,6 +85,10 @@ func isExpectedFailureOutput(output io.Reader, expectedFailure string) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
func isGitHubActions() bool {
|
||||
return os.Getenv("GITHUB_ACTION") != ""
|
||||
}
|
||||
|
||||
func pingAndGetGTIDExecuted(db *sql.DB, timeout time.Duration) (*mysql.UUIDSet, error) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||
defer cancel()
|
||||
|
|
Loading…
Reference in New Issue
Block a user