Remove SavePatch and generate patches on the fly (#9302)

* Save patches to temporary files

* Remove SavePatch and generate patches on the fly

* Use ioutil.TempDir

* fixup! Use ioutil.TempDir

* fixup! fixup! Use ioutil.TempDir

* RemoveAll LocalCopyPath() in initIntergrationTest

* Default to status checking on PR creation

* Remove unnecessary set to StatusChecking

* Protect against unable to load repo

* Handle conflicts

* Restore original conflict setting

* In TestPullRequests update status to StatusChecking before running TestPatch
This commit is contained in:
zeripath 2019-12-13 22:21:06 +00:00 committed by Antoine GIRARD
parent 8f16a2c37b
commit 74179d1b5e
16 changed files with 432 additions and 406 deletions

View file

@ -170,7 +170,7 @@ func TestPullRequests() {
if manuallyMerged(pr) {
continue
}
if err := pr.TestPatch(); err != nil {
if err := TestPatch(pr); err != nil {
log.Error("testPatch: %v", err)
continue
}
@ -194,7 +194,13 @@ func TestPullRequests() {
continue
} else if manuallyMerged(pr) {
continue
} else if err = pr.TestPatch(); err != nil {
}
pr.Status = models.PullRequestStatusChecking
if err := pr.Update(); err != nil {
log.Error("testPatch[%d]: Unable to update status to Checking Status %v", pr.ID, err)
continue
}
if err = TestPatch(pr); err != nil {
log.Error("testPatch[%d]: %v", pr.ID, err)
continue
}