@@ -532,49 +532,6 @@ func TestSetPipelineJobs(t *testing.T) {
532
532
}
533
533
}
534
534
535
- func TestStopPipelineRunFailIfPipelineNotInRunningState (t * testing.T ) {
536
- gaia .Cfg = & gaia.Config {}
537
- storeInstance := store .NewBoltStore ()
538
- tmp , _ := ioutil .TempDir ("" , "TestStopPipelineRunFailIfPipelineNotInRunningState" )
539
- gaia .Cfg .DataPath = tmp
540
- gaia .Cfg .WorkspacePath = filepath .Join (tmp , "tmp" )
541
- gaia .Cfg .Bolt .Mode = 0600
542
- gaia .Cfg .Logger = hclog .New (& hclog.LoggerOptions {
543
- Level : hclog .Trace ,
544
- Output : hclog .DefaultOutput ,
545
- Name : "Gaia" ,
546
- })
547
- gaia .Cfg .Worker = 2
548
- if err := storeInstance .Init (tmp ); err != nil {
549
- t .Fatal (err )
550
- }
551
- p , _ := prepareTestData ()
552
- _ = storeInstance .PipelinePut (& p )
553
- s , err := NewScheduler (storeInstance , & MemDBFake {}, & PluginFakeFailed {}, & CAFake {}, & VaultFake {})
554
- if err != nil {
555
- t .Fatal (err )
556
- }
557
- _ , err = s .SchedulePipeline (& p , prepareArgs ())
558
- if err != nil {
559
- t .Fatal (err )
560
- }
561
- s .schedule ()
562
- r , err := storeInstance .PipelineGetRunByPipelineIDAndID (p .ID , 1 )
563
- if err != nil {
564
- t .Fatal (err )
565
- }
566
- if r .Status != gaia .RunScheduled {
567
- t .Fatalf ("run has status %s but should be %s\n " , r .Status , string (gaia .RunScheduled ))
568
- }
569
- err = s .StopPipelineRun (& p , 1 )
570
- if err == nil {
571
- t .Fatal ("error was nil. should have failed" )
572
- }
573
- if err .Error () != "pipeline is not in running state" {
574
- t .Fatal ("error was not what was expected 'pipeline is not in running state'. got: " , err .Error ())
575
- }
576
- }
577
-
578
535
func TestStopPipelineRun (t * testing.T ) {
579
536
gaia .Cfg = & gaia.Config {}
580
537
storeInstance := store .NewBoltStore ()
0 commit comments