| COMP3311 25T2 |
Assignment 2 Database Testing |
Database Systems |
[Assignment Spec] [SQL Schema] [SQL Data] [Grades+Rules] [Examples] [Testing] [Submitting]
In order to test your assignment, you need to set up the following pre-conditions:
Note that your helpers.sql file must be able to load into the database without errors.
This means that you will need to comment out any incomplete views or functions in your helpers.sql file before testing.
You then run the command:
$ 3311 autotest ass2
And if you're lucky, you see output something like this:
$ 3311 autotest ass2
python3 -B -m py_compile *.py # q1.py
./sql_create schema.sql helpers.sql TRUE # q1.py
--- Loading Database Dump ---
CREATE DOMAIN
CREATE DOMAIN
CREATE DOMAIN
CREATE DOMAIN
CREATE DOMAIN
CREATE TYPE
CREATE TYPE
CREATE TYPE
CREATE TYPE
CREATE TYPE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
GRANT
GRANT
GRANT
REVOKE
REVOKE
--- Loading Student Submission ---
[output from loading helpers.sql]
./sql_clean # q1.py
dos2unix: converting file helpers.py to Unix format...
dos2unix: converting file q1.py to Unix format...
dos2unix: converting file q2.py to Unix format...
dos2unix: converting file q3.py to Unix format...
dos2unix: converting file q4.py to Unix format...
dos2unix: converting file q5.py to Unix format...
Test Q0_Create_Database (Load the database with the dump file (should always succeed)) - passed
Test Q1_A ('python3 q1.py') - passed
Test Q2_A ('python3 q2.py COMP3311') - passed
Test Q2_B ('python3 q2.py MATH1081') - passed
Test Q2_C ('python3 q2.py COMPCOMP') - passed
Test Q2_D ('python3 q2.py comp3311') - passed
Test Q2_E ('python3 q2.py MATH1151') - passed
Test Q3_A ('python3 q3.py 3892140') - passed
Test Q3_B ('python3 q3.py 5893146') - passed
Test Q3_C ('python3 q3.py 5895425') - passed
Test Q3_D ('python3 q3.py 1234567') - passed
Test Q3_E ('python3 q3.py 9890898') - passed
Test Q3_F ('python3 q3.py 5894089') - passed
Test Q4_A ('python3 q4.py uoc:>=6 && <12;\ncareer:!(\'PG\');\ntitle:\'math\' && !(\' 1A\' || \'Comp\');\ncode:\'10\' && (\'2\' || \'3\' || \'4\')"\n') - passed
Test Q4_B ('python3 q4.py "uoc:>=6 && <12; career:!(\'PG\'); title:\'data\'; code:\'comp\'"') - passed
Test Q4_C ('python3 q4.py "uoc : = 6; career: \'p\'; title:\'data science\'"') - passed
Test Q4_D ('python3 q4.py ""') - passed
Test Q4_E ('python3 q4.py "code:\'3311\';title \'data\'"') - passed
Test Q4_F ('python3 q4.py "uoc : <6; career: \'P\'; name:\'data science\'"') - passed
Test Q4_G ('python3 q4.py "uoc : =6 &&; career: \'U\'; aaaaa:\'data science\'"') - passed
Test Q4_H ('python3 q4.py "uoc : ! = 6 && = 6"') - passed
Test Q4_I ('python3 q4.py "uoc: < = 2"') - passed
Test Q4_J ('python3 q4.py "uoc: =\'12\'; title: \'mATh\'"') - passed
Test Q4_K ('python3 q4.py " uoc : > 18"') - passed
Test Q5_A ('python3 q5.py 5893146') - passed
Test Q5_B ('python3 q5.py 5893146 3778') - passed
Test Q5_C ('python3 q5.py 5893146 3778 COMPA1') - passed
Test Q5_D ('python3 q5.py 5893146 3778 COMPD1') - passed
Test Q5_E ('python3 q5.py 5893146 3707 COMPBH') - passed
Test Q5_F ('python3 q5.py 5893146 3778 JAPNE1') - passed
Test Q5_G ('python3 q5.py 5892943') - passed
Test Q0_Remove_Database (Remove the database (should always succeed)) - passed
The expected output from each test can be fond on the examples page
You can also test individual views/functions by e.g.
Note that the "Q0" is always required, as it is not really a question but tells autotest to load the data dump file.
$ 3311 autotest ass2 Q0 Q5
python3 -B -m py_compile *.py # q1.py
./sql_create schema.sql helpers.sql TRUE # q1.py
--- Loading Database Dump ---
CREATE DOMAIN
CREATE DOMAIN
CREATE DOMAIN
CREATE DOMAIN
CREATE DOMAIN
CREATE TYPE
CREATE TYPE
CREATE TYPE
CREATE TYPE
CREATE TYPE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
GRANT
GRANT
GRANT
REVOKE
REVOKE
--- Loading Student Submission ---
[output from loading helpers.sql]
./sql_clean # q1.py
dos2unix: converting file helpers.py to Unix format...
dos2unix: converting file q1.py to Unix format...
dos2unix: converting file q2.py to Unix format...
dos2unix: converting file q3.py to Unix format...
dos2unix: converting file q4.py to Unix format...
dos2unix: converting file q5.py to Unix format...
Test Q0_Create_Database (Load the database with the dump file (should always succeed)) - passed
Test Q5_A ('python3 q5.py 5893146') - passed
Test Q5_B ('python3 q5.py 5893146 3778') - passed
Test Q5_C ('python3 q5.py 5893146 3778 COMPA1') - passed
Test Q5_D ('python3 q5.py 5893146 3778 COMPD1') - passed
Test Q5_E ('python3 q5.py 5893146 3707 COMPBH') - passed
Test Q5_F ('python3 q5.py 5893146 3778 JAPNE1') - passed
Test Q5_G ('python3 q5.py 5892943') - passed
Test Q0_Remove_Database (Remove the database (should always succeed)) - passed
9 tests passed 0 tests failed
If you see could not be run because check failed when you run autotest, it means that autotest could not load your helpers.sql
file into the database without errors.
The top of the autotest output, underneath --- Loading Student Submission ---, will show any errors that occurred when loading your helpers.sql file into the database.
NOTICE messages are fine, WARNING or ERROR are not.