Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback #1

Open
wants to merge 25 commits into
base: feedback
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 29 additions & 19 deletions .github/classroom/autograding.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"tests": [
{
"name": "Default /app/ endpoint",
"name": "Default endpoint",
"setup": "npm install",
"run": "PORT=\"$(shuf -i 2000-65535 -n 1)\"; (timeout --signal=SIGINT 5 node server.js --port=$PORT; exit 0) & sleep 1s && curl -I http://localhost:${PORT}/app/ && sleep 5s",
"input": "",
"output": "HTTP\\/(1.1|2)\\s*200\\s*(OK)?",
"comparison": "regex",
"timeout": 10,
"points": 7143
"points": 8334
},
{
"name": "Nonexistent endpoint",
Expand All @@ -18,87 +18,97 @@
"output": "HTTP\\/(1.1|2)\\s*404\\s*(Not Found)?",
"comparison": "regex",
"timeout": 10,
"points": 7143
"points": 8334
},
{
"name": "Random coin flip endpoint /app/flip/",
"name": "Random coin flip endpoint",
"setup": "",
"run": "PORT=\"$(shuf -i 2000-65535 -n 1)\"; (timeout --signal=SIGINT 5 node server.js --port=$PORT; exit 0) & sleep 1s && curl http://localhost:${PORT}/app/flip/ && sleep 5s",
"input": "",
"output": "\\{\"flip\":\"(heads|tails)\"\\}",
"comparison": "regex",
"timeout": 10,
"points": 7143
"points": 8334
},
{
"name": "Flip many coins endpoint /app/flips/:number/",
"name": "Flip many coins endpoint",
"setup": "",
"run": "PORT=\"$(shuf -i 2000-65535 -n 1)\"; NUMBER=\"$(shuf -i 100-500 -n 1)\"; (timeout --signal=SIGINT 5 node server.js --port=$PORT; exit 0) & sleep 1s && curl http://localhost:${PORT}/app/flips/${NUMBER}/ && sleep 5s",
"input": "",
"output": "\\{\"raw\":\\[\"(heads|tails)\",.*\\],\"summary\":\\{\"(heads|tails)\":[0-9]{1,3},\"(heads|tails)\":[0-9]{1,3}\\}\\}",
"comparison": "regex",
"timeout": 10,
"points": 7143
"points": 8333
},
{
"name": "Header check /app/flip/",
"name": "Header check flip",
"setup": "",
"run": "PORT=\"$(shuf -i 2000-65535 -n 1)\"; (timeout --signal=SIGINT 5 node server.js --port=$PORT; exit 0) & sleep 1s && curl -I http://localhost:${PORT}/app/flip/ && sleep 5s",
"input": "",
"output": "HTTP\\/(1.1|2)\\s*200\\s*(OK)?",
"comparison": "regex",
"timeout": 10,
"points": 7143
"points": 8333
},
{
"name": "Header check /app/flips/:number/",
"name": "Header check flips",
"setup": "",
"run": "PORT=\"$(shuf -i 2000-65535 -n 1)\"; NUMBER=\"$(shuf -i 100-500 -n 1)\"; (timeout --signal=SIGINT 5 node server.js --port=$PORT; exit 0) & sleep 1s && curl -I http://localhost:${PORT}/app/flips/${NUMBER}/ && sleep 5s",
"input": "",
"output": "HTTP\\/(1.1|2)\\s*200\\s*(OK)?",
"comparison": "regex",
"timeout": 10,
"points": 7143
"points": 8333
},
{
"name": "Call a flip heads at endpoint /app/flip/call/heads/",
"name": "Call a flip heads at endpoint",
"setup": "",
"run": "PORT=\"$(shuf -i 2000-65535 -n 1)\"; (timeout --signal=SIGINT 5 node server.js --port=$PORT; exit 0) & sleep 1s && curl http://localhost:${PORT}/app/flip/call/heads/ && sleep 5s",
"input": "",
"output": "\\{\"call\":\"heads\",\"flip\":\"(heads|tails)\",\"result\":\"(win|lose)\"\\}",
"comparison": "regex",
"timeout": 10,
"points": 7143
"points": 8333
},
{
"name": "Call a flip tails at endpoint /app/flip/call/tails/",
"name": "Call a flip tails at endpoint",
"setup": "",
"run": "PORT=\"$(shuf -i 2000-65535 -n 1)\"; (timeout --signal=SIGINT 5 node server.js --port=$PORT; exit 0) & sleep 1s && curl http://localhost:${PORT}/app/flip/call/tails/ && sleep 5s",
"input": "",
"output": "\\{\"call\":\"tails\",\"flip\":\"(heads|tails)\",\"result\":\"(win|lose)\"\\}",
"comparison": "regex",
"timeout": 10,
"points": 7143
"points": 8333
},
{
"name": "Header check /app/flip/call/heads/",
"name": "Header check",
"setup": "",
"run": "PORT=\"$(shuf -i 2000-65535 -n 1)\"; (timeout --signal=SIGINT 5 node server.js --port=$PORT; exit 0) & sleep 1s && curl -I http://localhost:${PORT}/app/flip/call/heads/ && sleep 5s",
"input": "",
"output": "HTTP\\/(1.1|2)\\s*200\\s*(OK)?",
"comparison": "regex",
"timeout": 10,
"points": 7143
"points": 8333
},
{
"name": "Header check /app/flip/call/tails/",
"name": "Header check",
"setup": "",
"run": "PORT=\"$(shuf -i 2000-65535 -n 1)\"; (timeout --signal=SIGINT 5 node server.js --port=$PORT; exit 0) & sleep 1s && curl -I http://localhost:${PORT}/app/flip/call/tails/ && sleep 5s",
"input": "",
"output": "HTTP\\/(1.1|2)\\s*200\\s*(OK)?",
"comparison": "regex",
"timeout": 10,
"points": 7142
"points": 8333
},
{
"name": "Node version",
"setup": "",
"run": "node -v",
"input": "",
"output": "",
"comparison": "included",
"timeout": 10,
"points": null
}
]
}
Loading