mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #13454 from overleaf/jpa-n2d-split-test
[web] add split test for running standard compiles on n2d instances GitOrigin-RevId: 05b85870c2ff5eb0345e700101225535a4a569f1
This commit is contained in:
parent
55c5330108
commit
f038cd4d10
2 changed files with 50 additions and 14 deletions
|
@ -246,10 +246,19 @@ module.exports = CompileManager = {
|
|||
_getCompileBackendClassDetails(owner, compileGroup, callback) {
|
||||
const { defaultBackendClass } = Settings.apis.clsi
|
||||
if (compileGroup === 'standard') {
|
||||
return callback(null, {
|
||||
compileBackendClass: defaultBackendClass,
|
||||
showFasterCompilesFeedbackUI: false,
|
||||
})
|
||||
return SplitTestHandler.getAssignmentForMongoUser(
|
||||
owner,
|
||||
'compile-backend-class-n2d',
|
||||
(err, assignment) => {
|
||||
if (err) return callback(err, {})
|
||||
const { variant } = assignment
|
||||
callback(null, {
|
||||
compileBackendClass:
|
||||
variant === 'default' ? defaultBackendClass : variant,
|
||||
showFasterCompilesFeedbackUI: false,
|
||||
})
|
||||
}
|
||||
)
|
||||
}
|
||||
SplitTestHandler.getAssignmentForMongoUser(
|
||||
owner,
|
||||
|
|
|
@ -250,16 +250,43 @@ describe('CompileManager', function () {
|
|||
beforeEach(function () {
|
||||
this.features.compileGroup = 'standard'
|
||||
})
|
||||
it('should return the default class and disable ui', function (done) {
|
||||
this.CompileManager.getProjectCompileLimits(
|
||||
this.project_id,
|
||||
(err, { compileBackendClass, showFasterCompilesFeedbackUI }) => {
|
||||
if (err) return done(err)
|
||||
expect(compileBackendClass).to.equal('e2')
|
||||
expect(showFasterCompilesFeedbackUI).to.equal(false)
|
||||
done()
|
||||
}
|
||||
)
|
||||
|
||||
describe('default', function () {
|
||||
beforeEach(function () {
|
||||
this.getAssignmentForMongoUser.yields(null, {
|
||||
variant: 'default',
|
||||
})
|
||||
})
|
||||
it('should return the e2 class and disable the ui', function (done) {
|
||||
this.CompileManager.getProjectCompileLimits(
|
||||
this.project_id,
|
||||
(err, { compileBackendClass, showFasterCompilesFeedbackUI }) => {
|
||||
if (err) return done(err)
|
||||
expect(compileBackendClass).to.equal('e2')
|
||||
expect(showFasterCompilesFeedbackUI).to.equal(false)
|
||||
done()
|
||||
}
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('n2d variant', function () {
|
||||
beforeEach(function () {
|
||||
this.getAssignmentForMongoUser.yields(null, {
|
||||
variant: 'n2d',
|
||||
})
|
||||
})
|
||||
it('should return the n2d class and disable the ui', function (done) {
|
||||
this.CompileManager.getProjectCompileLimits(
|
||||
this.project_id,
|
||||
(err, { compileBackendClass, showFasterCompilesFeedbackUI }) => {
|
||||
if (err) return done(err)
|
||||
expect(compileBackendClass).to.equal('n2d')
|
||||
expect(showFasterCompilesFeedbackUI).to.equal(false)
|
||||
done()
|
||||
}
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue