Skip to content

Commit 10add17

Browse files
Pranav Ravichandrand2lam
authored andcommitted
feat(675): Implement functions for freeze windows. BREAKING CHANGE: Adds stopFrozen() and startFrozen() to be implemented inside executors #54
This reverts commit 526e4ac.
1 parent 526e4ac commit 10add17

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

index.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,34 @@ class Executor {
109109
throw new Error('Not implemented');
110110
}
111111

112+
/**
113+
* Starts a new frozen build in an executor
114+
* @method _startFrozen
115+
* @param {Object} config Configuration
116+
* @return {Promise}
117+
*/
118+
startFrozen(config) {
119+
return this._startFrozen(config);
120+
}
121+
122+
async _startFrozen() {
123+
throw new Error('Not implemented');
124+
}
125+
126+
/**
127+
* Stops a previously scheduled frozen build in an executor
128+
* @async _stopFrozen
129+
* @param {Object} config Configuration
130+
* @return {Promise}
131+
*/
132+
stopFrozen(config) {
133+
return this._stopFrozen(config);
134+
}
135+
136+
async _stopFrozen() {
137+
throw new Error('Not implemented');
138+
}
139+
112140
/**
113141
* Get the status of a build
114142
* @method status

test/index.test.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ describe('index test', () => {
2424
stop: Joi.object().required(),
2525
startPeriodic: Joi.object().required(),
2626
stopPeriodic: Joi.object().required(),
27+
startFrozen: Joi.object().required(),
28+
stopFrozen: Joi.object().required(),
2729
status: Joi.object().required()
2830
}
2931
}
@@ -114,6 +116,26 @@ describe('index test', () => {
114116
})
115117
));
116118

119+
it('startFrozen returns an error when not overridden', () => (
120+
instance.startFrozen({})
121+
.then(() => {
122+
throw new Error('Oh no');
123+
}, (err) => {
124+
assert.isOk(err, 'err is null');
125+
assert.equal(err.message, 'Not implemented');
126+
})
127+
));
128+
129+
it('stopFrozen returns an error when not overridden', () => (
130+
instance.stopFrozen({})
131+
.then(() => {
132+
throw new Error('Oh no');
133+
}, (err) => {
134+
assert.isOk(err, 'error is null');
135+
assert.equal(err.message, 'Not implemented');
136+
})
137+
));
138+
117139
it('status returns an error when not overridden', () => (
118140
instance.status({})
119141
.then(() => {

0 commit comments

Comments
 (0)