File tree 4 files changed +36
-5
lines changed
4 files changed +36
-5
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ exports = module.exports = {
16
16
'nodejs' : {
17
17
CPU_SHARE : '1.2' ,
18
18
MEM_LIMIT : '500m'
19
+ } ,
20
+ 'python' : {
21
+ CPU_SHARE : '1.2' ,
22
+ MEM_LIMIT : '500m'
19
23
}
20
24
} ,
21
25
LANGS : {
Original file line number Diff line number Diff line change @@ -45,8 +45,9 @@ export default class ProjectScenario extends Scenario {
45
45
async result ( currentJobDir : string , job : ProjectJob ) : Promise < ProjectResult > {
46
46
const setup_stdout = cat ( path . join ( currentJobDir , 'setup.stdout' ) ) . toString ( )
47
47
const setup_stderr = cat ( path . join ( currentJobDir , 'setup.stderr' ) ) . toString ( )
48
+ const setup_code = cat ( path . join ( currentJobDir , 'setup.code' ) ) . toString ( )
48
49
49
- if ( setup_stderr ) {
50
+ if ( setup_code !== '0' ) {
50
51
return {
51
52
id : job . id ,
52
53
scenario : 'project' ,
Original file line number Diff line number Diff line change @@ -23,11 +23,8 @@ project:
23
23
timelimit : 60
24
24
} ) )
25
25
26
- console . log ( result )
27
-
28
26
// assertions
29
- expect ( 1 ) . to . be . equal ( 1 )
30
- // expect(submitResult.testcases[0].result).to.eq('Success')
27
+ expect ( result . testcases [ 0 ] . score ) . to . eq ( 100 )
31
28
} )
32
29
} )
33
30
Original file line number Diff line number Diff line change
1
+ import { execute } from '../../src/tasks/'
2
+ import { expect } from 'chai'
3
+ import { ProjectJob } from "../../src/tasks/jobs/project"
4
+
5
+ describe ( 'project - python' , ( ) => {
6
+ it ( 'nodejs project submits correctly' , async ( ) => {
7
+ const result = await execute ( new ProjectJob ( {
8
+ id : 5 ,
9
+ lang : 'python' ,
10
+ source : 'https://minio.cb.lk/hackerblocks/python-solution.zip' ,
11
+ problem : 'https://minio.cb.lk/hackerblocks/python-problem.zip' ,
12
+ config : `
13
+ project:
14
+ allowed-folders:
15
+ - main/
16
+ before-test:
17
+ - pip install -r requirements.txt
18
+ testcases:
19
+ - python manage.py test tests/*
20
+ ` ,
21
+ scenario : 'project' ,
22
+ timelimit : 60
23
+ } ) )
24
+
25
+ // assertions
26
+ expect ( result . testcases [ 0 ] . score ) . to . eq ( 100 )
27
+ } )
28
+ } )
29
+
You can’t perform that action at this time.
0 commit comments