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

Fix testConnectionActivityLogging.psql when importing old logs #250

Closed wildtayne closed 6 years ago

wildtayne commented 6 years ago

This fixes the observed errors in testConnectionActivityLogging.psql by limiting the second import to CURRENT_DATE. There may be a more robust way perform this test, but I would need more time to analyze the issue.

In a nutshell, I believe what was happening is that when there are connections in ClassDB.ConnectionActivity that are at least two days old, importConnectionLog() will always return more than one row. The issue arises when the first import is performed. If there are no current users with connection activity on the dates imported, then no rows are added to ClassDB.ConnectionActivity. Thus, when importConnectionLog() is run in the test proper, more than one row is returned, which is an error.

This is definitely a test design issue rather than a ClassDB issue, however.