aboutsummaryrefslogtreecommitdiffstats
path: root/misc/random_bugs/create_random_bugs.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-09-25 17:56:58 +0200
committerMichael Muré <batolettre@gmail.com>2018-09-25 17:56:58 +0200
commit40c6e64e4badfd543dc98237e1aeb3d8958cfe90 (patch)
tree03a992d71a1bfa3f069a5ef179649c0cf8479764 /misc/random_bugs/create_random_bugs.go
parent5d7c3a76af85a857a6bb0bff5bac5282c0a9908f (diff)
downloadgit-bug-40c6e64e4badfd543dc98237e1aeb3d8958cfe90.tar.gz
cache: add raw edit functions to allow setting up the author, the timestamp and the metadatas
Diffstat (limited to 'misc/random_bugs/create_random_bugs.go')
-rw-r--r--misc/random_bugs/create_random_bugs.go32
1 files changed, 24 insertions, 8 deletions
diff --git a/misc/random_bugs/create_random_bugs.go b/misc/random_bugs/create_random_bugs.go
index dfef4e07..66ca18a9 100644
--- a/misc/random_bugs/create_random_bugs.go
+++ b/misc/random_bugs/create_random_bugs.go
@@ -66,7 +66,12 @@ func GenerateRandomBugsWithSeed(opts Options, seed int64) []*bug.Bug {
for i := 0; i < opts.BugNumber; i++ {
addedLabels = []string{}
- b, err := operations.Create(randomPerson(opts.PersonNumber), fake.Sentence(), paragraphs())
+ b, err := operations.Create(
+ randomPerson(opts.PersonNumber),
+ time.Now().Unix(),
+ fake.Sentence(),
+ paragraphs(),
+ )
if err != nil {
panic(err)
@@ -106,12 +111,23 @@ func GenerateRandomOperationPacksWithSeed(packNumber int, opNumber int, seed int
var op bug.Operation
- op = operations.NewCreateOp(randomPerson(5), fake.Sentence(), paragraphs(), nil)
+ op = operations.NewCreateOp(
+ randomPerson(5),
+ time.Now().Unix(),
+ fake.Sentence(),
+ paragraphs(),
+ nil,
+ )
opp.Append(op)
for j := 0; j < opNumber-1; j++ {
- op = operations.NewAddCommentOp(randomPerson(5), paragraphs(), nil)
+ op = operations.NewAddCommentOp(
+ randomPerson(5),
+ time.Now().Unix(),
+ paragraphs(),
+ nil,
+ )
opp.Append(op)
}
@@ -148,19 +164,19 @@ func paragraphs() string {
}
func comment(b bug.Interface, p bug.Person) {
- _ = operations.Comment(b, p, paragraphs())
+ _ = operations.Comment(b, p, time.Now().Unix(), paragraphs())
}
func title(b bug.Interface, p bug.Person) {
- _ = operations.SetTitle(b, p, fake.Sentence())
+ _ = operations.SetTitle(b, p, time.Now().Unix(), fake.Sentence())
}
func open(b bug.Interface, p bug.Person) {
- _ = operations.Open(b, p)
+ _ = operations.Open(b, p, time.Now().Unix())
}
func close(b bug.Interface, p bug.Person) {
- _ = operations.Close(b, p)
+ _ = operations.Close(b, p, time.Now().Unix())
}
var addedLabels []string
@@ -187,5 +203,5 @@ func labels(b bug.Interface, p bug.Person) {
// ignore error
// if the randomisation produce no changes, no op
// is added to the bug
- _, _ = operations.ChangeLabels(b, p, added, removed)
+ _, _ = operations.ChangeLabels(b, p, time.Now().Unix(), added, removed)
}