mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
[clsi] initial implementation of compile from history (#31883)
* [clsi] initial implementation of compile from history * [clsi] copy changes * [saas-e2e] extend test case with nested folder * [saas-e2e] add test case for tracked changes * [web] fix accumulating changes from multiple chunks * [web] optimize size check for compile request payload * [clsi] deduplicate globalBlobs * [clsi] add validation for request body details * [clsi] add metrics for compile from history * [clsi] download binary files concurrently * [clsi] skip download of empty file blob * [clsi] break down e2e compile time metric by compileFromHistory GitOrigin-RevId: 0dadef93e89d8a172c35cb130a1042d9d1bec42a
This commit is contained in:
@@ -148,6 +148,7 @@ describe('CompileController', () => {
|
||||
...file,
|
||||
})),
|
||||
clsiCacheShard: undefined,
|
||||
baseHistoryVersion: undefined,
|
||||
},
|
||||
})
|
||||
.should.equal(true)
|
||||
@@ -176,6 +177,7 @@ describe('CompileController', () => {
|
||||
...file,
|
||||
})),
|
||||
clsiCacheShard: undefined,
|
||||
baseHistoryVersion: undefined,
|
||||
},
|
||||
})
|
||||
.should.equal(true)
|
||||
@@ -224,6 +226,7 @@ describe('CompileController', () => {
|
||||
...file,
|
||||
})),
|
||||
clsiCacheShard: undefined,
|
||||
baseHistoryVersion: undefined,
|
||||
},
|
||||
})
|
||||
})
|
||||
@@ -272,6 +275,7 @@ describe('CompileController', () => {
|
||||
...file,
|
||||
})),
|
||||
clsiCacheShard: undefined,
|
||||
baseHistoryVersion: undefined,
|
||||
},
|
||||
})
|
||||
})
|
||||
@@ -304,6 +308,7 @@ describe('CompileController', () => {
|
||||
stats: ctx.stats,
|
||||
timings: ctx.timings,
|
||||
clsiCacheShard: undefined,
|
||||
baseHistoryVersion: undefined,
|
||||
},
|
||||
})
|
||||
.should.equal(true)
|
||||
@@ -339,6 +344,7 @@ describe('CompileController', () => {
|
||||
// JSON.stringify will omit these undefined values
|
||||
buildId: undefined,
|
||||
clsiCacheShard: undefined,
|
||||
baseHistoryVersion: undefined,
|
||||
},
|
||||
})
|
||||
.should.equal(true)
|
||||
@@ -373,6 +379,7 @@ describe('CompileController', () => {
|
||||
// JSON.stringify will omit these undefined values
|
||||
buildId: undefined,
|
||||
clsiCacheShard: undefined,
|
||||
baseHistoryVersion: undefined,
|
||||
},
|
||||
})
|
||||
.should.equal(true)
|
||||
@@ -405,6 +412,7 @@ describe('CompileController', () => {
|
||||
// JSON.stringify will omit these undefined values
|
||||
buildId: undefined,
|
||||
clsiCacheShard: undefined,
|
||||
baseHistoryVersion: undefined,
|
||||
},
|
||||
})
|
||||
.should.equal(true)
|
||||
|
||||
@@ -21,6 +21,14 @@ describe('ProjectPersistenceManager', () => {
|
||||
default: (ctx.UrlCache = {}),
|
||||
}))
|
||||
|
||||
vi.doMock(
|
||||
'../../../app/js/HistoryResourceWriter',
|
||||
() =>
|
||||
(ctx.HistoryResourceWriter = {
|
||||
clearCacheCb: sinon.stub().yields(null),
|
||||
})
|
||||
)
|
||||
|
||||
vi.doMock('../../../app/js/CompileManager', () => ({
|
||||
default: (ctx.CompileManager = {}),
|
||||
}))
|
||||
@@ -163,6 +171,13 @@ describe('ProjectPersistenceManager', () => {
|
||||
.should.equal(true)
|
||||
})
|
||||
|
||||
it('should clear the history cache', ctx => {
|
||||
ctx.HistoryResourceWriter.clearCacheCb.should.have.been.calledWith(
|
||||
ctx.project_id,
|
||||
ctx.user_id
|
||||
)
|
||||
})
|
||||
|
||||
it('should clear all the cached Urls for the project', ctx => {
|
||||
return ctx.UrlCache.clearProject
|
||||
.calledWith(ctx.project_id)
|
||||
|
||||
@@ -494,7 +494,8 @@ describe('RequestParser', () => {
|
||||
it('should return an error', ctx => {
|
||||
ctx.callback
|
||||
.calledWithMatch({
|
||||
message: 'syncType attribute should be one of: full, incremental',
|
||||
message:
|
||||
'syncType attribute should be one of: full, incremental, history-full, history-incremental',
|
||||
})
|
||||
.should.equal(true)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user