mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
Merge pull request #25646 from overleaf/em-ds-mobile-app-compile
Compile endpoint for the DS mobile app GitOrigin-RevId: 2fd9f4a6e8c2ed4ee868b0c1293f6760b9d113c8
This commit is contained in:
@@ -715,6 +715,7 @@ async function _getPersistenceOptions(
|
||||
}
|
||||
|
||||
const CompileController = {
|
||||
COMPILE_TIMEOUT_MS,
|
||||
compile: expressify(_CompileController.compile),
|
||||
stopCompile: expressify(_CompileController.stopCompile),
|
||||
compileSubmission: expressify(_CompileController.compileSubmission),
|
||||
|
||||
@@ -443,7 +443,7 @@ describe('LinkedFiles', function () {
|
||||
projectTwoRootFolderId = projectTwo.rootFolder[0]._id.toString()
|
||||
})
|
||||
|
||||
it('should import the project.pdf file from the source project and refresh it', async function () {
|
||||
it('should import the output.pdf file from the source project and refresh it', async function () {
|
||||
// import the file
|
||||
let { response, body } = await owner.doRequest('post', {
|
||||
url: `/project/${projectOneId}/linked_file`,
|
||||
@@ -453,7 +453,7 @@ describe('LinkedFiles', function () {
|
||||
provider: 'project_output_file',
|
||||
data: {
|
||||
source_project_id: projectTwoId,
|
||||
source_output_file_path: 'project.pdf',
|
||||
source_output_file_path: 'output.pdf',
|
||||
build_id: '1234-abcd',
|
||||
},
|
||||
},
|
||||
@@ -468,7 +468,7 @@ describe('LinkedFiles', function () {
|
||||
expect(firstFile.linkedFileData).to.deep.equal({
|
||||
provider: 'project_output_file',
|
||||
source_project_id: projectTwoId,
|
||||
source_output_file_path: 'project.pdf',
|
||||
source_output_file_path: 'output.pdf',
|
||||
build_id: '1234-abcd',
|
||||
importedAt: new Date().toISOString(),
|
||||
})
|
||||
@@ -503,7 +503,7 @@ describe('LinkedFiles', function () {
|
||||
linkedFileData: {
|
||||
provider: 'project_output_file',
|
||||
v1_source_doc_id: 9999999, // We won't find this id in the database
|
||||
source_output_file_path: 'project.pdf',
|
||||
source_output_file_path: 'output.pdf',
|
||||
},
|
||||
_id: 'abcdef',
|
||||
rev: 0,
|
||||
|
||||
@@ -9,14 +9,14 @@ class MockClsiApi extends AbstractMockApi {
|
||||
error: null,
|
||||
outputFiles: [
|
||||
{
|
||||
url: `http://clsi:3013/project/${req.params.project_id}/build/1234/output/project.pdf`,
|
||||
path: 'project.pdf',
|
||||
url: `http://clsi:3013/project/${req.params.project_id}/build/1234/output/output.pdf`,
|
||||
path: 'output.pdf',
|
||||
type: 'pdf',
|
||||
build: 1234,
|
||||
},
|
||||
{
|
||||
url: `http://clsi:3013/project/${req.params.project_id}/build/1234/output/project.log`,
|
||||
path: 'project.log',
|
||||
url: `http://clsi:3013/project/${req.params.project_id}/build/1234/output/output.log`,
|
||||
path: 'output.log',
|
||||
type: 'log',
|
||||
build: 1234,
|
||||
},
|
||||
@@ -36,9 +36,9 @@ class MockClsiApi extends AbstractMockApi {
|
||||
'/project/:project_id/build/:build_id/output/*',
|
||||
(req, res) => {
|
||||
const filename = req.params[0]
|
||||
if (filename === 'project.pdf') {
|
||||
if (filename === 'output.pdf') {
|
||||
plainTextResponse(res, 'mock-pdf')
|
||||
} else if (filename === 'project.log') {
|
||||
} else if (filename === 'output.log') {
|
||||
plainTextResponse(res, 'mock-log')
|
||||
} else {
|
||||
res.sendStatus(404)
|
||||
|
||||
@@ -538,7 +538,7 @@ describe('CompileController', function () {
|
||||
describe('getFileFromClsiWithoutUser', function () {
|
||||
beforeEach(function () {
|
||||
this.submission_id = 'sub-1234'
|
||||
this.file = 'project.pdf'
|
||||
this.file = 'output.pdf'
|
||||
this.req.params = {
|
||||
submission_id: this.submission_id,
|
||||
build_id: this.build_id,
|
||||
|
||||
Reference in New Issue
Block a user