Skip to content

Commit 9276067

Browse files
Giorgi LeladzeGiorgi Leladze
authored andcommitted
setup test token before execution
1 parent 259ca02 commit 9276067

2 files changed

Lines changed: 16 additions & 11 deletions

File tree

internal/cli/commands/commands.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@ func NewCommands(cfg *config.Config) *Commands {
4949
func (c *Commands) Register(rootCmd *cobra.Command, flags *cli.Flags, cfg *config.Config) {
5050
// Run command
5151
runCmd := &cobra.Command{
52-
Use: "run",
53-
Short: "Run PHPUnit tests in parallel",
54-
Long: "Discover and execute PHPUnit tests using parallel workers",
55-
RunE: c.Run.Execute,
52+
Use: "run",
53+
Short: "Run PHPUnit tests in parallel",
54+
Long: "Discover and execute PHPUnit tests using parallel workers",
55+
RunE: c.Run.Execute,
56+
SilenceUsage: true,
5657
PreRunE: func(cmd *cobra.Command, args []string) error {
5758
// Update config with flags after parsing
5859
cfg.Flags = flags.ToConfigFlags()

internal/cli/commands/run.go

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,12 @@ func (rc *RunCommand) Execute(cmd *cobra.Command, args []string) error {
279279
if err := rc.storage.Save(results, failures, duration, rc.config.Processors); err != nil {
280280
return fmt.Errorf("failed to save test results: %w", err)
281281
}
282-
if err := rc.formatter.PrintMetaStats(); err != nil {
283-
return err
282+
if !debug.IsEnabled() {
283+
if err := rc.formatter.PrintMetaStats(); err != nil {
284+
return err
285+
}
284286
}
285-
if rc.config.Flags.OpenFaills && len(failures) > 0 && rc.viewer != nil {
287+
if rc.config.Flags.OpenFaills && len(failures) > 0 && rc.viewer != nil && !debug.IsEnabled() {
286288
passed, failed := 0, 0
287289
for _, r := range results {
288290
if r.Success {
@@ -320,11 +322,13 @@ func (rc *RunCommand) Execute(cmd *cobra.Command, args []string) error {
320322
return fmt.Errorf("failed to save test results: %w", err)
321323
}
322324
debug.Log("run: results saved")
323-
if err := rc.formatter.PrintMetaStats(); err != nil {
324-
debug.Logf("run: failed to print stats: %v", err)
325-
return err
325+
if !debug.IsEnabled() {
326+
if err := rc.formatter.PrintMetaStats(); err != nil {
327+
debug.Logf("run: failed to print stats: %v", err)
328+
return err
329+
}
326330
}
327-
if rc.config.Flags.OpenFaills && len(failures) > 0 && rc.viewer != nil {
331+
if rc.config.Flags.OpenFaills && len(failures) > 0 && rc.viewer != nil && !debug.IsEnabled() {
328332
passed, failed := 0, 0
329333
for _, r := range results {
330334
if r.Success {

0 commit comments

Comments
 (0)