DASSL / ClassDB

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

Unit tests for shared ownership of team objects are insufficient (M) #257

Open afig opened 6 years ago

afig commented 6 years ago

A discussion in MS Teams started by @smurthys has identified that tests for shared ownership of team schemas are lacking, despite this now being a major component of ClassDB's feature set.

To summarize how team privileges function: each team has a corresponding schema, which is owned by the team. When a member is added to a team, they are granted the team's role. This results in the member being granted all privileges that were held by the team. ClassDB also assigns some default privileges which makes use of this feature more intuitive.

Ownership of objects in team schemas are generally of two kinds: member-owned and team-owned. Member-owned objects are owned by the member (student) who created the object. Team-owned objects are owned by the role that corresponds to the team. By default, all objects created in a team's schema are member-owned.

With that said, tests for the following assertions should be present in ClassDB's test suite:

Currently, some of these assertions are tested in the privilege tests, as well as in testClassDBRolesMgmt.sql. However, the tests in the privileges suite are not exhaustive, and the tests in testClassDBRolesMgmt.sql are performed by checking Postgres' catalog, rather than using actual connections to the DB as the appropriate users.

As discussed in MS Teams, adding scripted tests for these are not a high priority, at least not for M4. Due to the robustness of existing code and complete tests of related functionality, it is not expected that there will be any issues performing the above items. However, these assertions should still be tested manually before a production release.

Please review the assertions made, and suggest any other aspects about the teams functionality that should be true.