This commit is contained in:
Jason Song 2023-04-20 16:41:46 +08:00
parent cb14d38e50
commit 4757bf54b8
No known key found for this signature in database
GPG key ID: 8402EEEE4511A8B5

View file

@ -160,6 +160,10 @@ func (r *Reporter) Logf(format string, a ...interface{}) {
r.stateMu.Lock()
defer r.stateMu.Unlock()
r.logf(format, a...)
}
func (r *Reporter) logf(format string, a ...interface{}) {
if !r.duringSteps() {
r.logRows = append(r.logRows, &runnerv1.LogRow{
Time: timestamppb.Now(),
@ -174,7 +178,7 @@ func (r *Reporter) SetOutputs(outputs map[string]string) {
for k, v := range outputs {
if len(k) > 255 {
r.Logf("ignore output because the key is too long: %q", k)
r.logf("ignore output because the key is too long: %q", k)
continue
}
if _, ok := r.outputs.Load(k); ok {
@ -293,7 +297,7 @@ func (r *Reporter) ReportState() error {
}
return true
})
if len(noSent) >= 0 {
if len(noSent) > 0 {
return fmt.Errorf("there are still outputs that have not been sent: %v", noSent)
}