Suite documentationAll software
Contents

Running it

Running the suite

Where each product lives, how it is deployed, when the demonstrations rebuild, and how to check that everything hangs together.

Where things live #

Each product has its own web address, its own database and its own code repository, on one shared hosting account. There is no shared database between products: they talk only through their APIs. That is deliberate. A fault in one product cannot corrupt another's records.

ProductAddressRebuilt nightly at
Care Corecore.findcarescotland.com03:15
Contractscontracts.findcarescotland.com03:20
Digital IDid.findcarescotland.com03:25
Strategic Plansstrategic.findcarescotland.com03:30
Policy Corepolicies.findcarescotland.com03:35
Care Planscare.findcarescotland.com03:40
Incident Coreincidents.findcarescotland.com03:45
Improvement Coreimprove.findcarescotland.com03:50
EngageTrackengage.findcarescotland.com03:55

Times are the server's. The directory itself is at findcarescotland.com.

The nightly rebuild, and why the order matters #

Every demonstration is wiped and rebuilt each night with invented data, so a visitor can never leave anything behind. The order is deliberate: Care Core first, because everything else reads people from it, then the others, with the products that read counts from each other after the ones they read from. Incident Core runs before Improvement Core and EngageTrack so that the counts they show are current. If you change a time, keep that order.

Deploying a change #

0 Hosting notes learned the hard way: cron commands are limited to 255 characters; wrap a command in sh -c '…'; a one-off job repeats every minute until deleted, so delete it as soon as it has run; and write long output to a file and read it back.

Tests #

Each product has its own test script (php tests/run.php) that refuses to run unless the database name contains "test", so a test can never touch real data. These are the unit and rule tests. They answer "does this product do what it should".

The suite check #

The tests above do not tell you whether the joins work. That is what the suite check is for. It is a small separate program that signs in to every demonstration the way a visitor does, opens every page in each menu, and checks that data really flows between products: names in Care Core appear in Digital ID, Policy Core, Incident Core, Improvement Core, EngageTrack and Care Plans; EngageTrack shows restraint counts from Incident Core; Improvement Core shows evidence from EngageTrack and aims from Strategic Plans; Care Plans shows Incident Core counts.

php bin/check.php                 everything (about four minutes)
php bin/check.php --only=engage   one product
php bin/check.php --json          for a dashboard

It waits between requests and backs off if the host asks it to slow down, and it says who it is. On its first full run, 164 of 167 checks passed and none failed.

Backups #

Be exact about what exists:

  • Care Plans has a daily backup script scheduled.
  • Incident Core, Improvement Core and EngageTrack each include a backup script and a restore check.
  • Care Core and Digital ID have no scheduled backup. Care Core's documentation tells you to take them and to keep .env and APP_KEY somewhere separate, because without the key the encrypted National Insurance and bank details cannot be read.
  • Nothing copies a backup off the server yet. A backup on the same server is not a backup if the server is lost.

See Before real use.