DASSL / ClassDB

An open-source system to let students experiment with relational data
https://dassl.github.io/ClassDB/
Other
7 stars 2 forks source link

Make logging tests use new drop dispositions and improve user views #196

Closed wildtayne closed 6 years ago

wildtayne commented 6 years ago

This is a collection of small fixes/improvements to the logging tests scripts and user views. I intended for this to be two separate PRs, but I accidentally merged all the changes into one commit.

With these changes, all tests pass a new ClassDB instance setup using the new quick-start guide 🎉

smurthys commented 6 years ago

Thanks @srrollo for the changes. I totally agree the doc on removing users is extremely helpful.

I have the following observations in addFrequentViewsCore.sql (some of these I find as I review the fie):

Related, I also suggest adding ORDER BY UserName to view User in addClassDBRolesViewsCore.sql. This change will automatically impose ordering on the result of some functions in addFrequentViewsCore.sql.

I have not had a chance to look at the test scripts, but I notice a COMMIT has changed to ROLLBACK. This is the correct approach. However, in a test script that uses ROLLBACK, it is not necessary to drop/delete objects unless drop/delete is part of the test.

I just created a new issue #197 about using ROLLBACK instead of COMMIT in test scripts, but we don't need to address that issue in M2.

wildtayne commented 6 years ago

Thanks for the review @smurthys. I've made the suggested changes to ordering.

Good point about not dropping objects in tests when not using ROLLBACK. In this case, testAddConnectionActivityLogging.psql can't use ROLLBACK, because the test spans multiple transactions due to changing connections.