Code Duplication    Length = 23-23 lines in 2 locations

tests/DryRunPipelineTest.php 2 locations

@@ 74-96 (lines=23) @@
71
	/**
72
	 * Test deployments dont do anything
73
	 */
74
	public function testDeployment() {
75
		$step = $this->getDummyDeployment();
76
77
		// First run; creates snapshot
78
		$step->start();
79
		$this->assertHasLog('TestDeployStep:Snapshot creating snapshot of database');
80
		$this->assertHasLog('[Skipped] Create DNDataTransfer backup');
81
82
83
		// Second run, finalises snapshot and creates deployment
84
		PipelineTest_MockLog::clear();
85
		$step->start();
86
		$this->assertHasLog('Checking status of TestDeployStep:Snapshot...');
87
		$this->assertHasLog('[Skipped] Checking progress of snapshot backup');
88
		$this->assertHasLog('TestDeployStep:Deployment starting deployment');
89
		$this->assertHasLog('[Skipped] Create DNDeployment for SHA 9ae502821345ab39b04d46ce6bb822ccdd7f7414');
90
91
		// Third run, complete deployment
92
		PipelineTest_MockLog::clear();
93
		$step->start();
94
		$this->assertHasLog('Checking status of TestDeployStep:Deployment...');
95
		$this->assertHasLog('[Skipped] Checking progress of deployment');
96
	}
97
98
	/**
99
	 * Test the rollback step
@@ 101-123 (lines=23) @@
98
	/**
99
	 * Test the rollback step
100
	 */
101
	public function testRollback() {
102
		$step = $this->getDummyRollback();
103
104
		// First run, start revert code
105
		$step->start();
106
		$this->assertHasLog('RollbackStep:Deployment starting revert deployment');
107
		$this->assertHasLog('[Skipped] Create DNDeployment');
108
109
		// Second run, finish deployment and start database restoration
110
		PipelineTest_MockLog::clear();
111
		$step->start();
112
		$this->assertHasLog('Checking status of RollbackStep:Deployment...');
113
		$this->assertHasLog('[Skipped] Checking progress of deployment');
114
		$this->assertHasLog('RollbackStep:Snapshot reverting database from snapshot');
115
		$this->assertHasLog('[Skipped] Create DNDataTransfer restore');
116
117
		// Third run, complete snapshot restore
118
		PipelineTest_MockLog::clear();
119
		$step->start();
120
		$this->assertHasLog('Checking status of RollbackStep:Snapshot...');
121
		$this->assertHasLog('[Skipped] Checking progress of snapshot restore');
122
		$this->assertHasLog('Step finished successfully!');
123
	}
124
125
	/**
126
	 * Make the dummy deployment step