LOC-15: Testing Mode



Issue Information

Issue Type: New Feature
 
Priority: Major
Status: Closed

Reported By:
Ben Tasker
Assigned To:
Ben Tasker
Project: LocalChat (LOC)
Resolution: Done (2018-05-20 09:55:40)
Target version: V0.0.2,
Components: Server ,

Created: 2018-05-14 09:10:53
Time Spent Working


Description
We're approaching the point of Minimum Viable Product.

Before the release of V0.0.2 can happen, need to do some fairly thorough testing.

Currently, it's hard to test that the database contains what we think it does - as it's in memory, short of a memory dump, you cannot access it from another process.

This FR is to implement a testing mode, including some safety precautions.

The server should accept a CLI argument --testing-mode-enable. When this is present, the following should happen

- Database should be created on disk
- Whenever a user joins a room, a warning that the system is in testing mode should be pushed into the room

With the database on disk, test scripts will then be able to poll the database to verify that data's being written as expected.


Issue Links

Toggle State Changes

Activity


The testing database will be written out into the current working directory with a filename of localchat-testing.db.

As this is now implemented, marking as complete.
btasker changed status from 'Open' to 'Resolved'
btasker added 'Done' to resolution
btasker changed status from 'Resolved' to 'Closed'
Repo: LocalChat
Host:Rimmer

commit 990a4a03c62e83914d6cd967f272eba8fed07903
Author: B Tasker <github@<Domain Hidden>>
Date: Sun May 20 09:52:12 2018 +0100

Commit Message: LOC-15 Implement Testing mode

When the argument '--enable-testing-mode' is included in the server's commandline, the database will be created on disk instead of in memory.

This is so that tests can check the database directly to verify that what's been written into the database is what's expected.

When testing mode is enabled, the server will print a warning on the commandline at startup.
It will also push a message into rooms whenever a new user joins, so that if it is inadvertantly used, users will know that their message payloads are being written to disk.

.gitignore | 1 +
server/LocalChat.py | 44 +++++++++++++++++++++++++++++++++++---------
2 files changed, 36 insertions(+), 9 deletions(-)


View Commit | View Changes
Repo: LocalChat
Host:Rimmer

commit d0031cd99b3e65ac8440851812c4136b2d82b111
Author: B Tasker <github@<Domain Hidden>>
Date: Mon May 21 00:02:40 2018 +0100

Commit Message: LOC-15 In testing mode, the purge interval is 30 seconds

When testing mode is enabled, the purge should kill messages older than 30 seconds. This is so the tests don't have to pause for 10 minutes.

server/LocalChat.py | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)


View Commit | View Changes
Repo: LocalChat
Host:Rimmer

commit 026f4b6e4c4d483230c7d1ccaff05ebf80ea35d8
Author: B Tasker <github@<Domain Hidden>>
Date: Mon May 21 00:13:07 2018 +0100

Commit Message: LOC-15 in testing mode auto-room closure happens after 3 minutes

server/LocalChat.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)


View Commit | View Changes