diff --git a/.github/workflows/cli-test.yaml b/.github/workflows/cli-test.yaml index f7879a76d..67512db08 100644 --- a/.github/workflows/cli-test.yaml +++ b/.github/workflows/cli-test.yaml @@ -47,13 +47,6 @@ jobs: run: make build - name: Run Tests run: make test-coverage - - name: Upload Coverage Report - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos - files: all.coverprofile - flags: unittests - fail_ci_if_error: true other-os-build: strategy: matrix: diff --git a/pkg/project/batch.go b/pkg/project/batch.go index 72733c9ea..227f82a93 100644 --- a/pkg/project/batch.go +++ b/pkg/project/batch.go @@ -107,7 +107,7 @@ func (s *Batch) Run(stop <-chan bool, updates chan<- ServiceRunUpdate, env map[s go func() { err := cmd.Start() if err != nil { - errChan <- err + errChan <- fmt.Errorf("error starting service %s: %w", s.Name, err) } else { updates <- ServiceRunUpdate{ ServiceName: s.Name, @@ -118,7 +118,17 @@ func (s *Batch) Run(stop <-chan bool, updates chan<- ServiceRunUpdate, env map[s } err = cmd.Wait() - errChan <- err + if err != nil { + // provide runtime errors as a run update rather than as a fatal error + updates <- ServiceRunUpdate{ + ServiceName: s.Name, + Label: "nitric", + Status: ServiceRunStatus_Error, + Err: err, + } + } + + errChan <- nil }() go func(cmd *exec.Cmd) { diff --git a/pkg/project/project.go b/pkg/project/project.go index f394ba037..ff7e84891 100644 --- a/pkg/project/project.go +++ b/pkg/project/project.go @@ -421,7 +421,7 @@ func (p *Project) RunServicesWithCommand(localCloud *cloud.LocalCloud, stop <-ch group.Go(func() error { port, err := localCloud.AddService(svc.GetFilePath()) if err != nil { - return err + return fmt.Errorf("unable to add service %s: %w", svc.GetFilePath(), err) } envVariables := map[string]string{ @@ -434,7 +434,12 @@ func (p *Project) RunServicesWithCommand(localCloud *cloud.LocalCloud, stop <-ch envVariables[key] = value } - return svc.Run(stopChannels[idx], updates, envVariables) + err = svc.Run(stopChannels[idx], updates, envVariables) + if err != nil { + return fmt.Errorf("%s: %w", svc.GetFilePath(), err) + } + + return nil }) } @@ -456,7 +461,7 @@ func (p *Project) RunBatchesWithCommand(localCloud *cloud.LocalCloud, stop <-cha group.Go(func() error { port, err := localCloud.AddBatch(svc.GetFilePath()) if err != nil { - return err + return fmt.Errorf("unable to add batch %s: %w", svc.GetFilePath(), err) } envVariables := map[string]string{ @@ -469,7 +474,12 @@ func (p *Project) RunBatchesWithCommand(localCloud *cloud.LocalCloud, stop <-cha envVariables[key] = value } - return svc.Run(stopChannels[idx], updates, envVariables) + err = svc.Run(stopChannels[idx], updates, envVariables) + if err != nil { + return fmt.Errorf("%s: %w", svc.GetFilePath(), err) + } + + return nil }) } diff --git a/pkg/project/service.go b/pkg/project/service.go index 0585ed0a3..04346ea12 100644 --- a/pkg/project/service.go +++ b/pkg/project/service.go @@ -278,7 +278,7 @@ func (s *Service) Run(stop <-chan bool, updates chan<- ServiceRunUpdate, env map go func() { err := cmd.Start() if err != nil { - errChan <- err + errChan <- fmt.Errorf("error starting service %s: %w", s.Name, err) } else { updates <- ServiceRunUpdate{ ServiceName: s.Name, @@ -289,7 +289,17 @@ func (s *Service) Run(stop <-chan bool, updates chan<- ServiceRunUpdate, env map } err = cmd.Wait() - errChan <- err + if err != nil { + // provide runtime errors as a run update rather than as a fatal error + updates <- ServiceRunUpdate{ + ServiceName: s.Name, + Label: "nitric", + Status: ServiceRunStatus_Error, + Err: err, + } + } + + errChan <- nil }() go func(cmd *exec.Cmd) {