Skip to content
This repository has been archived by the owner on Apr 30, 2021. It is now read-only.

Commit

Permalink
Add timing for local regression runs
Browse files Browse the repository at this point in the history
  • Loading branch information
Yevgeny Pats committed Oct 22, 2019
1 parent 81761d3 commit e91dc5c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

const FuzzitEndpoint = "https://app.fuzzit.dev"
const Version = "v2.4.73"
const Version = "v2.4.74"

type Target struct {
Name string `firestore:"target_name"`
Expand Down
7 changes: 6 additions & 1 deletion cmd/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"log"
"strconv"
"strings"
"time"

"github.com/fuzzitdev/fuzzit/v2/client"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -110,19 +111,23 @@ var jobCmd = &cobra.Command{
newJob.TargetId = target

if newJob.Type == "local-regression" {
start := time.Now()
err = gFuzzitClient.CreateLocalJob(newJob, args[1:])
if err != nil && skipIfNotExist && (err.Error() == "401 Unauthorized" || err.Error() == "fuzzer exited with 22") {
log.Println("Target doesn't exist yet. skipping...")
return
}
diff := time.Now().Sub(start)
log.Printf("Regression for %s took %s seconds", target, diff)
} else {
_, err = gFuzzitClient.CreateJob(newJob, additionalCorpus, args[1:])
log.Printf("Job created successfully")
}

if err != nil {
log.Fatal(err)
}
log.Printf("Job created successfully")

},
}

Expand Down

0 comments on commit e91dc5c

Please sign in to comment.