RazortoothRTC / node-smile-server

EpochEDU and SMILE Server
http://razortoothrtc.github.io/node-smile-server
1 stars 1 forks source link

Fix broken tests #30

Open chrqls opened 10 years ago

chrqls commented 10 years ago

Relative issue: https://github.com/SMILEConsortium/node-smile-server/issues/36

chrqls commented 10 years ago

./run_tests

Functional Tests

SMILE Junction Server Functional Tests Mon Oct 7 22:52:27 PDT 2013 Running test case tests/functional/answerQuestion.test.js · ·· trying do add question 'qwerty' by IP 10.0.2.15 ·· trying do add question 'asdfgh' by IP 10.0.2.15 ·· · JSON request ==> {"questionNum":1,"author":"default.15","question":"qwerty","questionType":"QUESTION_PIC","picturePath":"/smile/current/0.jpg","option1":"q","option2":"w","option3":"e","option4":"r"} ✗ · ·· · · ·

A GET to /JunctionServerExecution/current/0.html should return a html with the posted question 
  ✗ should be able to show the registered the question to the user 
    »        
    actual expected 

     1 | <html> 
     2 | <head>Question No.{"questionNum":1 </head> 
     3 | <body> 
     4 | <p>(Question created by ,"author":"default.15)</p> 
     5 | <P>Question: 
     6 | ","question":"qwerty 
     7 | </P> 
     8 | <img class="main" src="","questionType":"QUESTION_PIC","picturePath":"/smile/current/0.jpg" width="200" height="180"/> 
     9 | <P> 
    10 | (1) ","option1":"q<br> 
    11 | (2) ","option2":"w<br> 
    12 | (3) ","option3":"e<br> 
    13 | (4) ","option4":"r<br> 
    14 | </P> 
    15 | </body></html> 
    16 | "} 
     // answerQuestion.test.js:186 

✗ Broken » 14 honored ∙ 1 broken (0.390s) Running test case tests/functional/csv.test.js · ·· · · ✓ OK » 5 honored (0.244s) Running test case tests/functional/currentMessage.test.js · ·· · · ·· · · · ✓ OK » 10 honored (0.254s) Running test case tests/functional/errorHandling.test.js · ·· ·· ·· ·· ·· ·· ·· ·· ·· ·· ·· ·· ·· ·· · · ✓ OK » 31 honored (0.287s) Running test case tests/functional/game.test.js · ·· · ·· ·· · ·· · trying do add question 'qwerty' by IP 10.0.2.15 ·· trying do add question 'asdfgh' by IP 10.0.2.16 ·· · ·· · JSON request ==> {"questionNum":1,"author":"test","question":"qwerty","questionType":"QUESTION_PIC","picturePath":"/smile/current/0.jpg","option1":"q","option2":"w","option3":"e","option4":"r"} ✗ · JSON request ==> {"questionNum":2,"author":"test2","question":"asdfgh","questionType":"QUESTION","picturePath":"/smile/current/1.jpg","option1":"a","option2":"s","option3":"d","option4":"f"} ✗ ·· · ·· · ·· · · JSON request ==> {"questionNum":2,"author":"test2","question":"asdfgh","questionType":"QUESTION","picturePath":"/smile/current/1.jpg","answer":"2","option1":"a","option2":"s","option3":"d","option4":"f","numCorrectPeople":0,"numberOfStudents":2,"averageRating":3.5} ✗ ·· · · ·· · · · · · ·

A GET to /JunctionServerExecution/current/0.html should return a html with the posted question 
  ✗ should be able to show the registered the question to the user 
    »        
    actual expected 

     1 | <html> 
     2 | <head>Question No.{"questionNum":1 </head> 
     3 | <body> 
     4 | <p>(Question created by ,"author":"test)</p> 
     5 | <P>Question: 
     6 | ","question":"qwerty 
     7 | </P> 
     8 | <img class="main" src="","questionType":"QUESTION_PIC","picturePath":"/smile/current/0.jpg" width="200" height="180"/> 
     9 | <P> 
    10 | (1) ","option1":"q<br> 
    11 | (2) ","option2":"w<br> 
    12 | (3) ","option3":"e<br> 
    13 | (4) ","option4":"r<br> 
    14 | </P> 
    15 | </body></html> 
    16 | "} 
     // game.test.js:356 

A GET to /JunctionServerExecution/current/1.html should return a html with the posted question 
  ✗ should be able to show the registered the question to the user 
    »        
    actual expected 

     1 | <html> 
     2 | <head>Question No.{"questionNum":2 </head> 
     3 | <body> 
     4 | <p>(Question created by ,"author":"test2)</p> 
     5 | <P>Question: 
     6 | ","question":"asdfgh 
     7 | </P> 
     8 | <P> 
     9 | (","questionType":"QUESTION","picturePath":"/smile/current/1) .jpg","option1":"a<br> 
    10 | (2) ","option2":"s<br> 
    11 | (3) ","option3":"d<br> 
    12 | (4) ","option4":"f<br> 
    13 | </P> 
    14 | </body></html> 
    15 | "} 
     // game.test.js:403 

A GET to /JunctionServerExecution/current/1_result.html should return a html with the question results 
  ✗ should be able to show the question result to the user 
    »        
    actual expected 

     1 | <html> 
     2 | <head>Question No.{"questionNum":2 </head> 
     3 | <body> 
     4 | <p>(Question created by ,"author":"test2)</p> 
     5 | <P>Question: 
     6 | ","question":"asdfgh 
     7 | </P> 
     8 | <P> 
     9 | (","questionType":"QUESTION","picturePath":"/smile/current/1) a<br> 
    10 | (.jpg","answer":"2) ","option1":"a","option2":"s<font color = red>&nbsp; &#10004;</font><br> 
    11 | (3) ","option3":"d<br> 
    12 | (4) ","option4":"f<br> 
    13 | </P> 
    14 | Correct Answer: 2<br> 
    15 | <P> Num correct people: ","numCorrectPeople":0 / ,"numberOfStudents":2<br> 
    16 | Average rating: ,"averageRating":3.5<br> 
    17 | </body></html> 
    18 | } 
     // game.test.js:596 

✗ Broken » 43 honored ∙ 3 broken (0.417s) Running test case tests/functional/l10n.test.js · ·· · · ✓ OK » 5 honored (0.223s) Running test case tests/functional/ratingMetadata.test.js · · ·· · · ✓ OK » 6 honored (0.249s) Running test case tests/functional/receiveMessage.test.js · ·· trying do add question 'qwerty' by IP 10.0.2.15 ·· · ·· · · ✓ OK » 10 honored (0.243s) Running test case tests/functional/registerStudent.test.js · ·· · ·· · · · · ✓ OK » 10 honored (0.248s) Running test case tests/functional/sendInitMessage.test.js · ·· · · ·· · · · ✓ OK » 10 honored (0.243s) Running test case tests/functional/startMakeQuestion.test.js · ·· · · ·· · · · ✓ OK » 10 honored (0.190s) Running test case tests/functional/startSolveQuestion.test.js · ·· trying do add question 'qwerty' by IP 10.0.2.15 ·· ·· · · ·· · · · ✓ OK » 14 honored (0.240s)

Unit Tests

2013-10-07 22:52:40.075 WARN nlogger - Error loading nlogger config file. Using defaults 2013-10-07 22:52:40.094 DEBUG main:5 - Running unit tests with nodeunit

persisteus TURN OFF DEBUG for Production

student · ✔ testEmptyStudents ✔ testOneStudent ·· ✓ OK » 3 honored (0.083s) ✔ testTwoStudents ✔ testMissingProperties ✔ testStatusOfStudents ✔ testAnswerQuestions

game trying do add question 'qwerty' by IP 172.16.129.242 trying do add question 'simpactico foo' by IP 172.16.129.242 trying do add question 'qwerty' by IP 172.16.129.242 WARNING: Ignoring duplicated question: qwerty (test-b8d9e5e67402c406f626f1115a23a1923f974f21). ✔ testIsDupQuestion ✔ testcalcScoreAndRating ✔ testResults

question ✔ testEmptyQuestions ✔ testOneQuestion ✔ testMissingMandatoryProperties ✔ testRightAnswers ✔ testNumberOfQuestions WARNING: Ignoring duplicated question: qwerty (test2-8b0f930ab7d2be99a27eb798597a5d5b485ce786). ✔ testIgnoreDuplicatedQuestions

OK: 37 assertions (248ms)

chrqls commented 10 years ago

screen shot 2014-02-15 at 03 05 12