department-of-veterans-affairs / va.gov-team

Public resources for building on and in support of VA.gov. Visit complete Knowledge Hub:
https://depo-platform-documentation.scrollhelp.site/index.html
282 stars 203 forks source link

Create Synthetic Monitoring Test for DSLogon Status #24353

Closed pjhill closed 3 years ago

pjhill commented 3 years ago

The original ticket title was "Create Synthetic Monitoring Test for DSLogon Flow".

This ticket was repurposed because we discovered we can't get a DSLogon account.

Issue Description

Original description: Per request from Dror, we would like to add a test to our suite of synthetic monitoring --

Migrate a test that Boris Ning created to test login to DSLogon to our infra. My understanding is that it logs in using DSLogon and then go to va.gov. Can you please create a ticket and post it in here the link. Boris can then add the details in the ticket When we do Q3 planning let's make sure to allocate time to synthetic testing.

New description: Because we can't get a DSLogon account which is required to run Boris' test, Dror asked us to create a canary that monitors the status of DSLogon as reported by this url - https://api.va.gov/v0/backend_statuses


Tasks

Acceptance Criteria

CoryTrimmUSDS commented 3 years ago

Just saw this @pjhill.

I've FWD'd you an email w/ the script, more info on what it does, etc...

holdenhinkle commented 3 years ago

I just sent Boris the following email:

Holden Hinkle holden.hinkle@oddball.io 10:55 AM (8 minutes ago) to Yu.Ning, Peter

Hi Boris,

I'm working on adapting your DSLogon monitor script to a synthetic monitor for VA.gov (see ticket #24353).

I have your script, but I'm missing the following local modules it requires:

const config = require('./src/config');
const listener = require('./src/page-listener');
const statuspageio = require('./src/statuspage');

Are you able to email them to me?

Thanks, and all the best,

Holden

holdenhinkle commented 3 years ago

Repo for the script while I'm converting it - https://github.com/department-of-veterans-affairs/dslogon-monitor-script

holdenhinkle commented 3 years ago

Boris emailed me the link to the repo with those missing files - https://github.com/department-of-veterans-affairs/monitor-dslogon

I refactored the script to use synthetics instead of puppeteer - https://github.com/department-of-veterans-affairs/dslogon-monitor-script/blob/master/index.js

Now we need the DSLogon account...

holdenhinkle commented 3 years ago

I asked Dror if he might be able to help us get a DSLogon account - https://dsva.slack.com/archives/C01CHAY3ULR/p1626366012314000?thread_ts=1626204805.284200&cid=C01CHAY3ULR

holdenhinkle commented 3 years ago

Unfortunately, we can't get an account for DSLogon.

https://dslogon.statuspage.io/ relies on https://api.va.gov/v0/backend_statuses which has a status for DSLogon.

Here's an example:

{"service":"DS Logon","service_id":"dslogon","status":"active","last_incident_timestamp":"2021-07-13T22:25:57.000+00:00"}

Dror:

So they just look at the success rate of people logging in with DSLogon. Let's go ahead and use that approach.

holdenhinkle commented 3 years ago

Write canary script to throw error when dslogon status is not active - https://github.com/department-of-veterans-affairs/dslogon-monitor-script/blob/master/status.js

holdenhinkle commented 3 years ago

Unfortunately, I still can't create a canary - https://dsva.slack.com/archives/CBU0KDSB1/p1626378419165800?thread_ts=1625067149.442700&cid=CBU0KDSB1

holdenhinkle commented 3 years ago

I was able to create the Canary. It didn't work on the first run and I realized I had to promisify the https request so I did a quick refactor. It works now:

image.png

Here's the script - https://github.com/department-of-veterans-affairs/dslogon-monitor-script/blob/master/status.js

holdenhinkle commented 3 years ago

I handed this off to Ops - https://github.com/department-of-veterans-affairs/va.gov-team/issues/27520

pjhill commented 3 years ago

Ops ticket is still open. Let's monitor that and close this ticket when Ops resolves the PagerDuty integration.

pjhill commented 3 years ago

PagerDuty integration is complete.