COMP3311 25T1 |
Assignment 1 Testing Script |
Database Systems |
[Assignment Spec] [Database Design] [Examples] [Testing]
In order to test your assignment, you need to set up the following pre-conditions:
Note that your ass1.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 ass1.sql file before testing.
You then run the command:
$ 3311 autotest ass1
And if you're lucky, you see output something like this:
$ 3311 autotest ass1 ./sql_create schema.sql ass1.sql TRUE # ass1.sql --- Loading Database Dump --- CREATE TYPE CREATE TYPE CREATE DOMAIN CREATE DOMAIN CREATE TABLE CREATE TABLE CREATE TABLE CREATE TABLE GRANT GRANT GRANT REVOKE REVOKE --- Loading Student Submission --- CREATE VIEW CREATE VIEW CREATE VIEW CREATE VIEW CREATE VIEW CREATE VIEW CREATE VIEW CREATE VIEW CREATE VIEW CREATE FUNCTION CREATE FUNCTION ./sql_clean ass1.sql Test Dump0_Q0_Create_Database (Load the database with schema (should always succeed)) - passed Test Dump0_Q1_Ensure_Exists (Ensure View Q1 exists, with the correct interface) - passed Test Dump0_Q2_Ensure_Exists (Ensure View Q2 exists, with the correct interface) - passed Test Dump0_Q3_Ensure_Exists (Ensure View Q3 exists, with the correct interface) - passed Test Dump0_Q4_Ensure_Exists (Ensure View Q4 exists, with the correct interface) - passed Test Dump0_Q5_Ensure_Exists (Ensure View Q5 exists, with the correct interface) - passed Test Dump0_Q6_Ensure_Exists (Ensure View Q6 exists, with the correct interface) - passed Test Dump0_Q7_Ensure_Exists (Ensure View Q7 exists, with the correct interface) - passed Test Dump0_Q8_Ensure_Exists (Ensure Function Q8 exists, with the correct interface) - passed Test Dump0_Q9_Ensure_Exists (Ensure Function Q9 exists, with the correct interface) - passed Test Dump0_Q0_Remove_Database (Remove the database (should always succeed)) - passed Test Dump1_Q0_Create_Database (Load the database with dump (should always succeed)) - passed Test Dump1_Q1_A (SELECT * FROM Q1 ORDER BY Maker;) - passed Test Dump1_Q2_A (SELECT * FROM Q2 ORDER BY Cheese, Maker;) - passed Test Dump1_Q3_A (SELECT * FROM Q3 ORDER BY Cheese, Maker;) - passed Test Dump1_Q4_A (SELECT * FROM Q4 ORDER BY Factory;) - passed Test Dump1_Q5_A (SELECT * FROM Q5 ORDER BY Style;) - passed Test Dump1_Q6_A (SELECT * FROM Q6 ORDER BY Country;) - passed Test Dump1_Q7_A (SELECT * FROM Q7 ORDER BY Cheese, Maker;) - passed Test Dump1_Q8_A (SELECT * FROM Q8('bert');) - passed Test Dump1_Q8_B (SELECT * FROM Q8('dairy');) - passed Test Dump1_Q8_C (SELECT * FROM Q8('ee');) - passed Test Dump1_Q8_D (SELECT * FROM Q8('o');) - passed Test Dump1_Q9_A (SELECT * FROM Q9('ick');) - passed Test Dump1_Q9_B (SELECT * FROM Q9('dairy');) - passed Test Dump1_Q9_C (SELECT * FROM Q9('xx');) - passed Test Dump1_Q0_Remove_Database (Remove the database (should always succeed)) - passed 27 tests passed 0 tests failed
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 ass1 Q0 Q8 ./sql_create schema.sql ass1.sql TRUE # ass1.sql --- Loading Database Dump --- CREATE TYPE CREATE TYPE CREATE DOMAIN CREATE DOMAIN CREATE TABLE CREATE TABLE CREATE TABLE CREATE TABLE GRANT GRANT GRANT REVOKE REVOKE --- Loading Student Submission --- CREATE VIEW CREATE VIEW CREATE VIEW CREATE VIEW CREATE VIEW CREATE VIEW CREATE VIEW CREATE VIEW CREATE VIEW CREATE FUNCTION CREATE FUNCTION ./sql_clean ass1.sql Test Dump0_Q0_Create_Database (Load the database with schema (should always succeed)) - passed Test Dump0_Q8_Ensure_Exists (Ensure Function Q8 exists, with the correct interface) - passed Test Dump0_Q0_Remove_Database (Remove the database (should always succeed)) - passed Test Dump1_Q0_Create_Database (Load the database with dump (should always succeed)) - passed Test Dump1_Q8_A (SELECT * FROM Q8('bert');) - passed Test Dump1_Q8_B (SELECT * FROM Q8('dairy');) - passed Test Dump1_Q8_C (SELECT * FROM Q8('ee');) - passed Test Dump1_Q8_D (SELECT * FROM Q8('o');) - passed Test Dump1_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 ass1.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 ass1.sql file into the database.
NOTICE messages are fine, WARNING or ERROR are not.