mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
[web] adopt free/premium compile backend class (#34846)
* [web] adopt free/premium compile backend class * [rails] adopt free compile backend class for pdf conversion GitOrigin-RevId: e12c99a27363f5654132c2fcdc6c5d8ccc591868
This commit is contained in:
@@ -51,7 +51,26 @@ describe('ClsiCookieManager', function () {
|
||||
ctx.project_id,
|
||||
ctx.user_id,
|
||||
'',
|
||||
'c3d'
|
||||
'free'
|
||||
)
|
||||
ctx.redis.get
|
||||
.calledWith(`clsiserver:free:${ctx.project_id}:${ctx.user_id}`)
|
||||
.should.equal(true)
|
||||
serverId.should.equal('clsi-7')
|
||||
})
|
||||
|
||||
it('should fall back to the old key during the free/premium rollout', async function (ctx) {
|
||||
ctx.redis.get
|
||||
.withArgs(`clsiserver:free:${ctx.project_id}:${ctx.user_id}`)
|
||||
.resolves(null)
|
||||
ctx.redis.get
|
||||
.withArgs(`clsiserver:c3d:${ctx.project_id}:${ctx.user_id}`)
|
||||
.resolves('clsi-7')
|
||||
const serverId = await ctx.ClsiCookieManager.promises.getServerId(
|
||||
ctx.project_id,
|
||||
ctx.user_id,
|
||||
'',
|
||||
'free'
|
||||
)
|
||||
ctx.redis.get
|
||||
.calledWith(`clsiserver:c3d:${ctx.project_id}:${ctx.user_id}`)
|
||||
@@ -83,7 +102,7 @@ describe('ClsiCookieManager', function () {
|
||||
ctx.project_id,
|
||||
ctx.user_id,
|
||||
'',
|
||||
'c3d'
|
||||
'free'
|
||||
)
|
||||
ctx.ClsiCookieManager.promises._populateServerIdViaRequest
|
||||
.calledWith(ctx.project_id, ctx.user_id)
|
||||
@@ -114,13 +133,13 @@ describe('ClsiCookieManager', function () {
|
||||
ctx.project_id,
|
||||
ctx.user_id,
|
||||
'standard',
|
||||
'c3d'
|
||||
'free'
|
||||
)
|
||||
const args = ctx.ClsiCookieManager.promises.setServerId.args[0]
|
||||
args[0].should.equal(ctx.project_id)
|
||||
args[1].should.equal(ctx.user_id)
|
||||
args[2].should.equal('standard')
|
||||
args[3].should.equal('c3d')
|
||||
args[3].should.equal('free')
|
||||
args[4].should.deep.equal(ctx.clsiServerId)
|
||||
})
|
||||
|
||||
@@ -130,7 +149,7 @@ describe('ClsiCookieManager', function () {
|
||||
ctx.project_id,
|
||||
ctx.user_id,
|
||||
'',
|
||||
'c3d'
|
||||
'free'
|
||||
)
|
||||
serverId.should.equal(ctx.clsiServerId)
|
||||
})
|
||||
@@ -149,7 +168,7 @@ describe('ClsiCookieManager', function () {
|
||||
ctx.project_id,
|
||||
ctx.user_id,
|
||||
'standard',
|
||||
'c3d',
|
||||
'free',
|
||||
ctx.clsiServerId,
|
||||
null
|
||||
)
|
||||
@@ -163,9 +182,10 @@ describe('ClsiCookieManager', function () {
|
||||
await ctx.ClsiCookieManager.promises.clearServerId(
|
||||
ctx.project_id,
|
||||
ctx.user_id,
|
||||
'c3d'
|
||||
'free'
|
||||
)
|
||||
ctx.redis.del.should.have.been.calledWith(
|
||||
`clsiserver:free:${ctx.project_id}:${ctx.user_id}`,
|
||||
`clsiserver:c3d:${ctx.project_id}:${ctx.user_id}`
|
||||
)
|
||||
})
|
||||
@@ -184,12 +204,12 @@ describe('ClsiCookieManager', function () {
|
||||
ctx.project_id,
|
||||
ctx.user_id,
|
||||
'standard',
|
||||
'c3d',
|
||||
'free',
|
||||
ctx.clsiServerId,
|
||||
null
|
||||
)
|
||||
ctx.redis.setex.should.have.been.calledWith(
|
||||
`clsiserver:c3d:${ctx.project_id}:${ctx.user_id}`,
|
||||
`clsiserver:free:${ctx.project_id}:${ctx.user_id}`,
|
||||
ctx.settings.clsiCookie.ttlInSeconds,
|
||||
ctx.clsiServerId
|
||||
)
|
||||
@@ -201,12 +221,12 @@ describe('ClsiCookieManager', function () {
|
||||
ctx.project_id,
|
||||
ctx.user_id,
|
||||
'standard',
|
||||
'c3d',
|
||||
'free',
|
||||
ctx.clsiServerId,
|
||||
null
|
||||
)
|
||||
expect(ctx.redis.setex).to.have.been.calledWith(
|
||||
`clsiserver:c3d:${ctx.project_id}:${ctx.user_id}`,
|
||||
`clsiserver:free:${ctx.project_id}:${ctx.user_id}`,
|
||||
ctx.settings.clsiCookie.ttlInSecondsRegular,
|
||||
ctx.clsiServerId
|
||||
)
|
||||
@@ -229,7 +249,7 @@ describe('ClsiCookieManager', function () {
|
||||
ctx.project_id,
|
||||
ctx.user_id,
|
||||
'standard',
|
||||
'c3d',
|
||||
'free',
|
||||
ctx.clsiServerId,
|
||||
null
|
||||
)
|
||||
@@ -254,12 +274,12 @@ describe('ClsiCookieManager', function () {
|
||||
ctx.project_id,
|
||||
ctx.user_id,
|
||||
'standard',
|
||||
'c3d',
|
||||
'free',
|
||||
ctx.clsiServerId,
|
||||
null
|
||||
)
|
||||
ctx.redis_secondary.setex.should.have.been.calledWith(
|
||||
`clsiserver:c3d:${ctx.project_id}:${ctx.user_id}`,
|
||||
`clsiserver:free:${ctx.project_id}:${ctx.user_id}`,
|
||||
ctx.settings.clsiCookie.ttlInSeconds,
|
||||
ctx.clsiServerId
|
||||
)
|
||||
@@ -273,14 +293,14 @@ describe('ClsiCookieManager', function () {
|
||||
ctx.project_id,
|
||||
ctx.user_id,
|
||||
'standard',
|
||||
'c3d',
|
||||
'free',
|
||||
ctx.clsiServerId,
|
||||
'previous-clsi-server-id'
|
||||
)
|
||||
expect(
|
||||
ctx.fetchUtils.fetchStringWithResponse
|
||||
).to.have.been.calledWith(
|
||||
`${ctx.settings.apis.clsi.url}/instance-state?clsiserverid=previous-clsi-server-id&compileGroup=standard&compileBackendClass=c3d`,
|
||||
`${ctx.settings.apis.clsi.url}/instance-state?clsiserverid=previous-clsi-server-id&compileGroup=standard&compileBackendClass=free`,
|
||||
{ method: 'GET', signal: sinon.match.instanceOf(AbortSignal) }
|
||||
)
|
||||
}
|
||||
|
||||
@@ -178,7 +178,9 @@ describe('ClsiManager', function () {
|
||||
},
|
||||
clsi: {
|
||||
url: `http://${CLSI_HOST}`,
|
||||
submissionBackendClass: 'c3d',
|
||||
submissionCompileBackendClass: 'free',
|
||||
standardCompileBackendClass: 'free',
|
||||
priorityCompileBackendClass: 'premium',
|
||||
},
|
||||
clsi_new: {
|
||||
doubleCompileFree: {
|
||||
@@ -333,7 +335,7 @@ describe('ClsiManager', function () {
|
||||
ctx.project._id,
|
||||
ctx.user_id,
|
||||
{
|
||||
compileBackendClass: 'c3d',
|
||||
compileBackendClass: 'free',
|
||||
compileGroup: 'standard',
|
||||
timeout: ctx.timeout,
|
||||
}
|
||||
@@ -347,7 +349,7 @@ describe('ClsiManager', function () {
|
||||
url.host === CLSI_HOST &&
|
||||
url.pathname ===
|
||||
`/project/${ctx.project._id}/user/${ctx.user_id}/compile` &&
|
||||
url.searchParams.get('compileBackendClass') === 'c3d' &&
|
||||
url.searchParams.get('compileBackendClass') === 'free' &&
|
||||
url.searchParams.get('compileGroup') === 'standard'
|
||||
),
|
||||
{
|
||||
@@ -427,7 +429,7 @@ describe('ClsiManager', function () {
|
||||
ctx.project._id,
|
||||
ctx.user_id,
|
||||
'standard',
|
||||
'c3d',
|
||||
'free',
|
||||
`${ctx.newClsiServerId}1`
|
||||
)
|
||||
})
|
||||
@@ -471,7 +473,7 @@ describe('ClsiManager', function () {
|
||||
ctx.project._id,
|
||||
ctx.user_id,
|
||||
{
|
||||
compileBackendClass: 'c3d',
|
||||
compileBackendClass: 'free',
|
||||
compileGroup: 'standard',
|
||||
timeout: ctx.timeout,
|
||||
compileFromHistory: true,
|
||||
@@ -488,7 +490,7 @@ describe('ClsiManager', function () {
|
||||
url.host === CLSI_HOST &&
|
||||
url.pathname ===
|
||||
`/project/${ctx.project._id}/user/${ctx.user_id}/compile` &&
|
||||
url.searchParams.get('compileBackendClass') === 'c3d' &&
|
||||
url.searchParams.get('compileBackendClass') === 'free' &&
|
||||
url.searchParams.get('compileGroup') === 'standard'
|
||||
),
|
||||
{
|
||||
@@ -576,7 +578,7 @@ describe('ClsiManager', function () {
|
||||
ctx.project._id,
|
||||
ctx.user_id,
|
||||
'standard',
|
||||
'c3d',
|
||||
'free',
|
||||
`${ctx.newClsiServerId}1`
|
||||
)
|
||||
})
|
||||
@@ -619,7 +621,7 @@ describe('ClsiManager', function () {
|
||||
ctx.result = await ctx.ClsiManager.promises.sendRequest(
|
||||
ctx.project._id,
|
||||
ctx.user_id,
|
||||
{ compileBackendClass: 'c3d', compileGroup: 'standard' }
|
||||
{ compileBackendClass: 'free', compileGroup: 'standard' }
|
||||
)
|
||||
})
|
||||
|
||||
@@ -654,7 +656,7 @@ describe('ClsiManager', function () {
|
||||
{
|
||||
timeout: 100,
|
||||
incrementalCompilesEnabled: true,
|
||||
compileBackendClass: 'c3d',
|
||||
compileBackendClass: 'free',
|
||||
compileGroup: 'priority',
|
||||
compileFromClsiCache: true,
|
||||
populateClsiCache: true,
|
||||
@@ -707,7 +709,7 @@ describe('ClsiManager', function () {
|
||||
url.hostname === CLSI_HOST &&
|
||||
url.pathname ===
|
||||
`/project/${ctx.project._id}/user/${ctx.user_id}/compile` &&
|
||||
url.searchParams.get('compileBackendClass') === 'c3d' &&
|
||||
url.searchParams.get('compileBackendClass') === 'free' &&
|
||||
url.searchParams.get('compileGroup') === 'priority'
|
||||
),
|
||||
{
|
||||
@@ -1006,7 +1008,7 @@ describe('ClsiManager', function () {
|
||||
ctx.result = await ctx.ClsiManager.promises.sendRequest(
|
||||
ctx.project._id,
|
||||
ctx.user_id,
|
||||
{ compileBackendClass: 'c3d' }
|
||||
{ compileBackendClass: 'free' }
|
||||
)
|
||||
})
|
||||
|
||||
@@ -1031,7 +1033,7 @@ describe('ClsiManager', function () {
|
||||
it('should clear the CLSI server id cookie', function (ctx) {
|
||||
expect(
|
||||
ctx.ClsiCookieManager.promises.clearServerId
|
||||
).to.have.been.calledWith(ctx.project._id, ctx.user_id, 'c3d')
|
||||
).to.have.been.calledWith(ctx.project._id, ctx.user_id, 'free')
|
||||
})
|
||||
|
||||
it('should return a success status', function (ctx) {
|
||||
@@ -1060,7 +1062,7 @@ describe('ClsiManager', function () {
|
||||
ctx.project._id,
|
||||
ctx.user_id,
|
||||
{
|
||||
compileBackendClass: 'c3d',
|
||||
compileBackendClass: 'free',
|
||||
compileGroup: 'standard',
|
||||
}
|
||||
)
|
||||
@@ -1076,7 +1078,7 @@ describe('ClsiManager', function () {
|
||||
url.host === CLSI_HOST &&
|
||||
url.pathname ===
|
||||
`/project/${ctx.project._id}/user/${ctx.user_id}/compile` &&
|
||||
url.searchParams.get('compileBackendClass') === 'c3d' &&
|
||||
url.searchParams.get('compileBackendClass') === 'free' &&
|
||||
url.searchParams.get('compileGroup') === 'standard'
|
||||
)
|
||||
)
|
||||
@@ -1093,7 +1095,7 @@ describe('ClsiManager', function () {
|
||||
ctx.AnalyticsManager.recordEventForUserInBackground
|
||||
).to.have.been.calledWith(ctx.user_id, 'double-compile-result', {
|
||||
projectId: 'project-id',
|
||||
compileBackendClass: 'c3d',
|
||||
compileBackendClass: 'free',
|
||||
newCompileBackendClass: 'n4',
|
||||
status: 'success',
|
||||
compileTime: 1337,
|
||||
@@ -1114,7 +1116,7 @@ describe('ClsiManager', function () {
|
||||
ctx.project._id,
|
||||
ctx.user_id,
|
||||
{
|
||||
compileBackendClass: 'c3d',
|
||||
compileBackendClass: 'free',
|
||||
compileGroup: 'standard',
|
||||
}
|
||||
)
|
||||
@@ -1130,7 +1132,7 @@ describe('ClsiManager', function () {
|
||||
url.host === CLSI_HOST &&
|
||||
url.pathname ===
|
||||
`/project/${ctx.project._id}/user/${ctx.user_id}/compile` &&
|
||||
url.searchParams.get('compileBackendClass') === 'c3d' &&
|
||||
url.searchParams.get('compileBackendClass') === 'free' &&
|
||||
url.searchParams.get('compileGroup') === 'standard'
|
||||
)
|
||||
)
|
||||
@@ -1144,7 +1146,7 @@ describe('ClsiManager', function () {
|
||||
ctx.project._id,
|
||||
ctx.user_id,
|
||||
{
|
||||
compileBackendClass: 'c4d',
|
||||
compileBackendClass: 'premium',
|
||||
compileGroup: 'priority',
|
||||
}
|
||||
)
|
||||
@@ -1160,7 +1162,7 @@ describe('ClsiManager', function () {
|
||||
url.host === CLSI_HOST &&
|
||||
url.pathname ===
|
||||
`/project/${ctx.project._id}/user/${ctx.user_id}/compile` &&
|
||||
url.searchParams.get('compileBackendClass') === 'c4d' &&
|
||||
url.searchParams.get('compileBackendClass') === 'premium' &&
|
||||
url.searchParams.get('compileGroup') === 'priority'
|
||||
)
|
||||
)
|
||||
@@ -1177,7 +1179,7 @@ describe('ClsiManager', function () {
|
||||
ctx.AnalyticsManager.recordEventForUserInBackground
|
||||
).to.have.been.calledWith(ctx.user_id, 'double-compile-result', {
|
||||
projectId: 'project-id',
|
||||
compileBackendClass: 'c4d',
|
||||
compileBackendClass: 'premium',
|
||||
newCompileBackendClass: 'n4d',
|
||||
status: 'success',
|
||||
compileTime: 1337,
|
||||
@@ -1222,7 +1224,7 @@ describe('ClsiManager', function () {
|
||||
ctx.result = await ctx.ClsiManager.promises.sendExternalRequest(
|
||||
ctx.submissionId,
|
||||
ctx.clsiRequest,
|
||||
{ compileBackendClass: 'c3d', compileGroup: 'standard' }
|
||||
{ compileBackendClass: 'free', compileGroup: 'standard' }
|
||||
)
|
||||
})
|
||||
|
||||
@@ -1232,7 +1234,7 @@ describe('ClsiManager', function () {
|
||||
url =>
|
||||
url.host === CLSI_HOST &&
|
||||
url.pathname === `/project/${ctx.submissionId}/compile` &&
|
||||
url.searchParams.get('compileBackendClass') === 'c3d' &&
|
||||
url.searchParams.get('compileBackendClass') === 'free' &&
|
||||
url.searchParams.get('compileGroup') === 'standard'
|
||||
),
|
||||
{
|
||||
@@ -1297,7 +1299,7 @@ describe('ClsiManager', function () {
|
||||
await ctx.ClsiManager.promises.deleteAuxFiles(
|
||||
ctx.project._id,
|
||||
ctx.user_id,
|
||||
{ compileBackendClass: 'c3d', compileGroup: 'standard' },
|
||||
{ compileBackendClass: 'free', compileGroup: 'standard' },
|
||||
'node-1'
|
||||
)
|
||||
})
|
||||
@@ -1309,7 +1311,7 @@ describe('ClsiManager', function () {
|
||||
url.host === CLSI_HOST &&
|
||||
url.pathname ===
|
||||
`/project/${ctx.project._id}/user/${ctx.user_id}` &&
|
||||
url.searchParams.get('compileBackendClass') === 'c3d' &&
|
||||
url.searchParams.get('compileBackendClass') === 'free' &&
|
||||
url.searchParams.get('compileGroup') === 'standard' &&
|
||||
url.searchParams.get('clsiserverid') === 'node-1'
|
||||
),
|
||||
@@ -1331,7 +1333,7 @@ describe('ClsiManager', function () {
|
||||
|
||||
it('should clear the clsi persistance', function (ctx) {
|
||||
ctx.ClsiCookieManager.promises.clearServerId
|
||||
.calledWith(ctx.project._id, ctx.user_id, 'c3d')
|
||||
.calledWith(ctx.project._id, ctx.user_id, 'free')
|
||||
.should.equal(true)
|
||||
})
|
||||
|
||||
@@ -1347,7 +1349,7 @@ describe('ClsiManager', function () {
|
||||
await ctx.ClsiManager.promises.deleteAuxFiles(
|
||||
ctx.project._id,
|
||||
ctx.user_id,
|
||||
{ compileBackendClass: 'c4d', compileGroup: 'priority' },
|
||||
{ compileBackendClass: 'premium', compileGroup: 'priority' },
|
||||
'node-1'
|
||||
)
|
||||
// wait for the background task to finish
|
||||
@@ -1357,7 +1359,7 @@ describe('ClsiManager', function () {
|
||||
it('should clear both cookies', function (ctx) {
|
||||
expect(
|
||||
ctx.ClsiCookieManager.promises.clearServerId
|
||||
).to.have.been.calledWith(ctx.project._id, ctx.user_id, 'c4d')
|
||||
).to.have.been.calledWith(ctx.project._id, ctx.user_id, 'premium')
|
||||
expect(
|
||||
ctx.ClsiCookieManager.promises.clearServerId
|
||||
).to.have.been.calledWith(ctx.project._id, ctx.user_id, 'n4d')
|
||||
@@ -1370,7 +1372,7 @@ describe('ClsiManager', function () {
|
||||
url.host === CLSI_HOST &&
|
||||
url.pathname ===
|
||||
`/project/${ctx.project._id}/user/${ctx.user_id}` &&
|
||||
url.searchParams.get('compileBackendClass') === 'c4d' &&
|
||||
url.searchParams.get('compileBackendClass') === 'premium' &&
|
||||
url.searchParams.get('compileGroup') === 'priority' &&
|
||||
url.searchParams.get('clsiserverid') === 'node-1'
|
||||
),
|
||||
@@ -1399,7 +1401,7 @@ describe('ClsiManager', function () {
|
||||
ctx.project._id,
|
||||
ctx.user_id,
|
||||
false,
|
||||
{ compileBackendClass: 'c3d', compileGroup: 'standard' },
|
||||
{ compileBackendClass: 'free', compileGroup: 'standard' },
|
||||
'node-1'
|
||||
)
|
||||
})
|
||||
@@ -1409,7 +1411,7 @@ describe('ClsiManager', function () {
|
||||
sinon.match(
|
||||
url =>
|
||||
url.toString() ===
|
||||
`http://clsi.example.com/project/${ctx.project._id}/user/${ctx.user_id}/wordcount?compileBackendClass=c3d&compileGroup=standard&file=main.tex&image=mock-image-name&clsiserverid=node-1`
|
||||
`http://clsi.example.com/project/${ctx.project._id}/user/${ctx.user_id}/wordcount?compileBackendClass=free&compileGroup=standard&file=main.tex&image=mock-image-name&clsiserverid=node-1`
|
||||
)
|
||||
)
|
||||
})
|
||||
@@ -1426,7 +1428,7 @@ describe('ClsiManager', function () {
|
||||
ctx.project._id,
|
||||
ctx.user_id,
|
||||
'other.tex',
|
||||
{ compileBackendClass: 'c3d', compileGroup: 'standard' },
|
||||
{ compileBackendClass: 'free', compileGroup: 'standard' },
|
||||
'node-2'
|
||||
)
|
||||
})
|
||||
@@ -1438,7 +1440,7 @@ describe('ClsiManager', function () {
|
||||
url.host === CLSI_HOST &&
|
||||
url.pathname ===
|
||||
`/project/${ctx.project._id}/user/${ctx.user_id}/wordcount` &&
|
||||
url.searchParams.get('compileBackendClass') === 'c3d' &&
|
||||
url.searchParams.get('compileBackendClass') === 'free' &&
|
||||
url.searchParams.get('compileGroup') === 'standard' &&
|
||||
url.searchParams.get('clsiserverid') === 'node-2' &&
|
||||
url.searchParams.get('file') === 'other.tex' &&
|
||||
@@ -1460,7 +1462,7 @@ describe('ClsiManager', function () {
|
||||
ctx.project._id,
|
||||
ctx.user_id,
|
||||
false,
|
||||
{ compileBackendClass: 'c4d', compileGroup: 'priority' },
|
||||
{ compileBackendClass: 'premium', compileGroup: 'priority' },
|
||||
'node-1'
|
||||
)
|
||||
// wait for the background task to finish
|
||||
@@ -1472,7 +1474,7 @@ describe('ClsiManager', function () {
|
||||
sinon.match(
|
||||
url =>
|
||||
url.toString() ===
|
||||
`http://clsi.example.com/project/${ctx.project._id}/user/${ctx.user_id}/wordcount?compileBackendClass=c4d&compileGroup=priority&file=main.tex&image=mock-image-name&clsiserverid=node-1`
|
||||
`http://clsi.example.com/project/${ctx.project._id}/user/${ctx.user_id}/wordcount?compileBackendClass=premium&compileGroup=priority&file=main.tex&image=mock-image-name&clsiserverid=node-1`
|
||||
)
|
||||
)
|
||||
expect(ctx.FetchUtils.fetchStringWithResponse).to.have.been.calledWith(
|
||||
|
||||
@@ -27,7 +27,7 @@ describe('CompileController', function () {
|
||||
promises: {
|
||||
compile: sinon.stub(),
|
||||
getProjectCompileLimits: sinon.stub().resolves({
|
||||
compileBackendClass: 'c3d',
|
||||
compileBackendClass: 'free',
|
||||
compileGroup: 'standard',
|
||||
}),
|
||||
syncTeX: sinon.stub(),
|
||||
@@ -48,7 +48,7 @@ describe('CompileController', function () {
|
||||
clsi: {
|
||||
url: 'http://clsi.example.com:3013',
|
||||
downloadHost: 'http://clsi.example.com:8080',
|
||||
submissionBackendClass: 'c3d',
|
||||
submissionCompileBackendClass: 'free',
|
||||
},
|
||||
clsi_priority: {
|
||||
url: 'http://clsi-priority.example.com',
|
||||
@@ -481,7 +481,7 @@ describe('CompileController', function () {
|
||||
ctx.ClsiManager.promises.sendExternalRequest.should.have.been.calledWith(
|
||||
ctx.submission_id,
|
||||
{ compileGroup: 'special', timeout: 600 },
|
||||
{ compileGroup: 'special', compileBackendClass: 'c3d', timeout: 600 }
|
||||
{ compileGroup: 'special', compileBackendClass: 'free', timeout: 600 }
|
||||
)
|
||||
})
|
||||
})
|
||||
@@ -512,7 +512,7 @@ describe('CompileController', function () {
|
||||
draft: true,
|
||||
check: 'validate',
|
||||
compileGroup: 'standard',
|
||||
compileBackendClass: 'c3d',
|
||||
compileBackendClass: 'free',
|
||||
timeout: 60,
|
||||
}
|
||||
)
|
||||
@@ -646,7 +646,7 @@ describe('CompileController', function () {
|
||||
|
||||
it('should proxy the PDF from the CLSI', function (ctx) {
|
||||
ctx.fetchUtils.fetchStreamWithResponse.should.have.been.calledWith(
|
||||
`${ctx.settings.apis.clsi.url}/project/${ctx.projectId}/user/${ctx.user_id}/build/${ctx.build_id}/output/output.zip?compileBackendClass=c3d&clsiserverid=${ctx.clsiServerId}`
|
||||
`${ctx.settings.apis.clsi.url}/project/${ctx.projectId}/user/${ctx.user_id}/build/${ctx.build_id}/output/output.zip?compileBackendClass=free&clsiserverid=${ctx.clsiServerId}`
|
||||
)
|
||||
})
|
||||
})
|
||||
@@ -657,7 +657,7 @@ describe('CompileController', function () {
|
||||
.stub()
|
||||
.resolves({
|
||||
compileGroup: 'priority',
|
||||
compileBackendClass: 'c4d',
|
||||
compileBackendClass: 'premium',
|
||||
})
|
||||
await ctx.CompileController.getOutputZipFromClsi(
|
||||
ctx.req,
|
||||
@@ -668,7 +668,7 @@ describe('CompileController', function () {
|
||||
|
||||
it('should proxy the PDF from the CLSI', function (ctx) {
|
||||
ctx.fetchUtils.fetchStreamWithResponse.should.have.been.calledWith(
|
||||
`${ctx.settings.apis.clsi.url}/project/${ctx.projectId}/user/${ctx.user_id}/build/${ctx.build_id}/output/output.zip?compileBackendClass=c4d&clsiserverid=${ctx.clsiServerId}`
|
||||
`${ctx.settings.apis.clsi.url}/project/${ctx.projectId}/user/${ctx.user_id}/build/${ctx.build_id}/output/output.zip?compileBackendClass=premium&clsiserverid=${ctx.clsiServerId}`
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -19,7 +19,11 @@ describe('CompileManager', function () {
|
||||
vi.doMock('@overleaf/settings', () => ({
|
||||
default: (ctx.settings = {
|
||||
apis: {
|
||||
clsi: { submissionBackendClass: 'c3d' },
|
||||
clsi: {
|
||||
submissionCompileBackendClass: 'free',
|
||||
standardCompileBackendClass: 'free',
|
||||
priorityCompileBackendClass: 'premium',
|
||||
},
|
||||
},
|
||||
redis: { web: { host: '127.0.0.1', port: 42 } },
|
||||
rateLimit: { autoCompile: {} },
|
||||
@@ -292,7 +296,7 @@ describe('CompileManager', function () {
|
||||
.calledWith(null, {
|
||||
timeout: ctx.timeout,
|
||||
compileGroup: ctx.group,
|
||||
compileBackendClass: 'c4d',
|
||||
compileBackendClass: 'premium',
|
||||
ownerAnalyticsId: 'abc',
|
||||
})
|
||||
.should.equal(true)
|
||||
@@ -322,7 +326,7 @@ describe('CompileManager', function () {
|
||||
await ctx.CompileManager.promises.getProjectCompileLimits(
|
||||
ctx.project_id
|
||||
)
|
||||
expect(compileBackendClass).to.equal('c4d')
|
||||
expect(compileBackendClass).to.equal('premium')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user