Skip to content

Commit

Permalink
Merge branch 'main' into VACMS-18005-aging-content-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dsasser authored Jun 11, 2024
2 parents cc34b39 + e18cd9a commit fee52e7
Show file tree
Hide file tree
Showing 35 changed files with 1,872 additions and 1,121 deletions.
4 changes: 2 additions & 2 deletions .ddev/mutagen/mutagen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# and add your own configuration. If you override it you will
# probably want to check it in.
# Please do `ddev mutagen reset` after changing the file.
# See DDEV Mutagen docs at
# https://ddev.readthedocs.io/en/stable/users/install/performance/#mutagen
# See ddev mutagen docs at
# https://ddev.readthedocs.io/en/latest/users/install/performance/
# For detailed information about mutagen configuration options, see
# https://mutagen.io/documentation/introduction/configuration
sync:
Expand Down
423 changes: 2 additions & 421 deletions .github/ISSUE_TEMPLATE/sitewide-crew-member-onboarding.md

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions READMES/cms-collab-cycle/collab-cycle-qa.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
### CMS Collaboration Cycle QA Discovery

Currently, the Platform Collaboration Cycle incorporates QA during the Staging Review. Currently, five QA artifacts are expected during the Staging Review, four of which are required. QA artifacts currently include the following:

1. **Regression Test Plan - Required**

- The product must have a regression test plan that proves the new changes don't break previously-integrated functionality.

2. **Test Plan - Required**

- The product must have a test plan that describes the method(s) that will be used to verify product changes.

3. **Traceability Reports - Warning**

- The product must have a Coverage for References report that demonstrates user stories have been verified by test cases in the test plan. The product must also have a Summary (Defects) report that demonstrates that the defects discovered during QA testing were discovered by executing test cases in the test plan.

4. **E2E Test Participation - Required**

- The product must have 1 or more End to End (E2E) tests.

5. **Unit Test Coverage - Required**

- The overall product must have 80% or higher unit test coverage in each category: Lines, Functions, Statements, and Branches.

More details on how these artifacts are currently evaluated during the Staging Review can be found on the Platform’s [QA Standards](https://depo-platform-documentation.scrollhelp.site/developer-docs/quality-assurance-standards#QAstandards-VA.govQAStandards) page.

**Proposed additions for CMS:**
While I believe the current QA artifacts expected at the Staging Review provide a strong baseline to work from, I do believe we can enhance E2E Test Participation. Requiring a single E2E test for a feature doesn’t necessarily provide adequate, repeatable, test coverage to help protect from future regressions. I’d like to propose that we add further clarification to the Test Plan and E2E Test Participation artifacts as described below:

1. **Test Plan** - test plans often contain many test scenarios covering less frequently encountered edge cases in addition to the core functionality the feature is trying to provide. I request that product team(s) denote within the test plan what is considered core functionality to the feature as “Critical Path”.

- **Example**: A new feature for editing content may have some edge cases that, if not working correctly, create a minor bug, or inconvenience to end users. This would not be considered “critical path”. However, incorrect system behavior that prevents user(s) from being able to edit content as intended, would be considered “critical path”.

2. **E2E Test Participation** - As as first step, I suggest we require participating teams to indicate which of the “Critical Path” tests in the test plan are automated with E2E tests. They should also calculate the percentage of “Critical Path” tests covered by automated E2E tests.

**Benefits:**
By requiring teams to explicitly indicate which tests within their test plans are covering core, or “critical”, functionality, and whether they are automated with E2E tests, we are bringing awareness to the highest value tests within test plans. Calculating the percentage of “Critical Path” coverage provides a metric to identify gaps in automated test coverage, better highlighting opportunities to better guard against future regressions, and protect end users from potentially negative user experiences. Lastly, incorporating better automated test coverage provides developers with more confidence in their ability to make changes to CMS functionality with fewer unknown negative implications.
2 changes: 1 addition & 1 deletion READMES/events-api
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Directions for Events API

This is a REST API created in Drupal Views using the REST UI Module. It is located in the Drupal CMS backend and is administered by the CMS team.

The current location to view the API is: /all-events-data_format=json
The current location to view the API is: /all-events-data?_format=json

The API is currently set to json format but can also be used for xml or to get a csv download. This is accomplished by changing the data_format in the url above. (I.e. /all-events-data_format=csv or /all-events-data_format=xml)

Expand Down
40 changes: 40 additions & 0 deletions READMES/qa.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,43 @@ All of this is very much in flux at present.
- [Current Challenges](https://va-gov.atlassian.net/wiki/spaces/CMSQA/pages/1812987905/Current+Challenges+Facing+the+Project) -- a survey of some of the more noteworthy QA challenges identified at this time, and how we're attempting to assess and deal with them.

[Table of Contents](../README.md)

### Ideal State of Testing - As of 6/10/2024

**Unit Testing:**
Unit testing in the va.gov-cms repository will be performed using PHPUnit. Ideally, this will be a collaborative effort performed by Drupal Engineers and Test Engineers. Our goal will be to meet the Platform standard of at least 80% code coverage in each of the following categories: Lines, Functions, Statements, and Branches.

**API Testing:**
Necessity of API test coverage is TBD at this point in time. If there are custom endpoints made available to external consumers of the CMS, coverage should be added for those. Another potential candidate would be testing GraphQL queries to retrieve data from the CMS.

**E2E Testing:**
End-to-end testing in the va.gov-cms repository will continue to be performed using Cypress. Ideally, this will be a collaborative effort performed by Drupal Engineers and Test Engineers. This testing should be focused on critical functions replicating common workflows for admins and editorial staff using the CMS.

E2E testing should be divided into specific test runs and run on varying schedules in order to help improve the speed at which developers receive feedback on changes, as well as improve the performance of our release pipeline. Proposed test runs and schedules are outlined below:

1. **Critical Path: **

- A collection of tests from the overall regression test suite should be categorized as “critical path”. These should cover functions within the CMS that are considered “essential” for admins and editorial users to be able to perform their duties. The “critical path” suite should be limited to a conservative number of tests to ensure the suite can run quickly and frequently within daily development workflows.

- The “critical path” suite of tests should be run in all PR environments as well as the daily CI/CD pipeline (BRD).

2. **Regression:**

- A collection of tests that ensures the application still behaves as expected after changes have been introduced. This is essentially the full suite of automated end-to-end tests, so long as the functionality is still relevant to CMS users.

- The full “regression” test suite should be run nightly so that each day’s changes are still fully tested. Running on a nightly schedule can help provide frequent feedback to daily changes, hopefully without obstructing developers workflows or slowing the daily CI/CD pipeline (BRD).

Initially, I would suggest reporting the results of the critical path run in the daily CI/CD pipeline as well as the nightly regression run into the Platform’s instance of TestRail. This will help provide a historical record of test performance to help identify when breaking changes are introduced.

**Smoke Testing:**
A small number or single test script proving the CMS is accessible and functioning should be performed after production releases. If limited by login, this may be able to be replaced by synthetic monitoring scripts that prove the CMS Login page is accessible.

**Manual/Exploratory Testing:**
1. Manual: Any functionality in the CMS that is not easily automated, login for instance, should be tested manually on a regular basis. Frequency of this testing can vary depending on the criticality of the functionality in question.

2. Exploratory: Exploratory testing sessions with a given scope could be performed as needed with large feature releases. This is a good way to examine user experience and integration points between features that were developed and tested in isolation.

**Synthetic Monitoring:**
Synthetic monitors in Datadog should be utilized to help ensure “up-time” of the CMS application in our non-production and production environments. This can be as simple as the existing monitors ensuring the Login page is accessible in both Staging and Production.

Further discovery can be performed on whether synthetic monitoring can provide more detailed live coverage of the CMS application across environments.
74 changes: 35 additions & 39 deletions config/sync/migrate_plus.migration.va_node_facility_nca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ source:
data_fetcher_plugin: http
data_parser_plugin: json
urls:
- 'https://dev-api.va.gov/services/va_facilities/v0/facilities/all'
- 'https://sandbox-api.va.gov/services/va_facilities/v1/facilities?per_page=1000'
- 'https://sandbox-api.va.gov/services/va_facilities/v1/facilities?per_page=1000&page=2'
- 'https://sandbox-api.va.gov/services/va_facilities/v1/facilities?per_page=1000&page=3'
headers:
Accept: application/vnd.geo+json
Accept: application/json
apikey: 'DEFINED IN settings.php'
item_selector: features/
item_selector: data/
ids:
id:
type: string
Expand All @@ -36,91 +38,95 @@ source:
-
name: facility_type
label: facility_type
selector: properties/facility_type
selector: attributes/facilityType
-
name: id
label: id
selector: properties/id
selector: id
-
name: name
label: name
selector: properties/name
selector: attributes/name
-
name: classification
label: classification
selector: properties/classification
selector: attributes/classification
-
name: website
label: website
selector: properties/website
selector: attributes/website
-
name: time_zone
label: time_zone
selector: properties/time_zone
selector: attributes/timeZone
-
name: mailing_city
label: mailing_city
selector: properties/address/mailing/city
selector: attributes/address/mailing/city
-
name: mailing_state
label: mailing_state
selector: properties/address/mailing/state
selector: attributes/address/mailing/state
-
name: mailing_zip
label: mailing_zip
selector: properties/address/mailing/zip
selector: attributes/address/mailing/zip
-
name: mailing_address1
label: mailing_address1
selector: properties/address/mailing/address_1
selector: attributes/address/mailing/address1
-
name: mailing_address2
label: mailing_address2
selector: properties/address/mailing/address_2
selector: attributes/address/mailing/address2
-
name: mailing_address3
label: mailing_address3
selector: properties/address/mailing/address_3
selector: attributes/address/mailing/address3
-
name: physical_city
label: physical_city
selector: properties/address/physical/city
selector: attributes/address/physical/city
-
name: physical_state
label: physical_state
selector: properties/address/physical/state
selector: attributes/address/physical/state
-
name: physical_zip
label: physical_zip
selector: properties/address/physical/zip
selector: attributes/address/physical/zip
-
name: physical_address1
label: physical_address1
selector: properties/address/physical/address_1
selector: attributes/address/physical/address1
-
name: physical_address2
label: physical_address2
selector: properties/address/physical/address_2
selector: attributes/address/physical/address2
-
name: physical_address3
label: physical_address3
selector: properties/address/physical/address_3
selector: attributes/address/physical/address3
-
name: fax
label: fax
selector: properties/phone/fax
selector: attributes/phone/fax
-
name: phone
label: phone
selector: properties/phone/main
selector: attributes/phone/main
-
name: hours
label: hours
selector: properties/hours
selector: attributes/hours
-
name: coordinates
label: coordinates
selector: geometry/coordinates
name: latitude
label: latitude
selector: attributes/lat
-
name: longitude
label: longitude
selector: attributes/long
process:
non_field1:
plugin: skip_on_value
Expand Down Expand Up @@ -292,21 +298,11 @@ process:
field_administration:
plugin: default_value
default_value: 192
latitude:
plugin: extract
source: coordinates
index:
- 1
longitude:
plugin: extract
source: coordinates
index:
- 0
field_geolocation:
plugin: geofield_latlon
source:
- '@latitude'
- '@longitude'
- latitude
- longitude
langcode:
plugin: default_value
default_value: en
Expand Down
62 changes: 29 additions & 33 deletions config/sync/migrate_plus.migration.va_node_facility_vba.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ source:
data_fetcher_plugin: http
data_parser_plugin: json
urls:
- 'https://dev-api.va.gov/services/va_facilities/v0/facilities/all'
- 'https://sandbox-api.va.gov/services/va_facilities/v1/facilities?per_page=1000&'
- 'https://sandbox-api.va.gov/services/va_facilities/v1/facilities?per_page=1000&page=2'
- 'https://sandbox-api.va.gov/services/va_facilities/v1/facilities?per_page=1000&page=3'
headers:
Accept: application/vnd.geo+json
Accept: application/json
apikey: 'DEFINED IN settings.php'
item_selector: features/
item_selector: data/
ids:
id:
type: string
Expand All @@ -35,63 +37,67 @@ source:
-
name: address1
label: address1
selector: properties/address/physical/address_1
selector: attributes/address/physical/address1
-
name: address2
label: address2
selector: properties/address/physical/address_2
selector: attributes/address/physical/address2
-
name: address3
label: address3
selector: properties/address/physical/address_3
selector: attributes/address/physical/address3
-
name: city
label: city
selector: properties/address/physical/city
selector: attributes/address/physical/city
-
name: classification
label: classification
selector: properties/classification
-
name: coordinates
label: coordinates
selector: geometry/coordinates
selector: attributes/classification
-
name: facility_type
label: facility_type
selector: properties/facility_type
selector: attributes/facilityType
-
name: hours
label: hours
selector: properties/hours
selector: attributes/hours
-
name: time_zone
label: time_zone
selector: properties/time_zone
selector: attributes/timeZone
-
name: id
label: id
selector: properties/id
selector: id
-
name: latitude
label: latitude
selector: attributes/lat
-
name: longitude
label: longitude
selector: attributes/long
-
name: name
label: name
selector: properties/name
selector: attributes/name
-
name: phone-main
label: phone-main
selector: properties/phone/main
selector: attributes/phone/main
-
name: state
label: state
selector: properties/address/physical/state
selector: attributes/address/physical/state
-
name: zip
label: zip
selector: properties/address/physical/zip
selector: attributes/address/physical/zip
-
name: benefits
label: benefits
selector: properties/services/benefits
selector: attributes/services/benefits
process:
non_field1:
plugin: skip_on_value
Expand Down Expand Up @@ -143,21 +149,11 @@ process:
field_address/locality: city
field_address/administrative_area: state
field_address/postal_code: zip
latitude:
plugin: extract
source: coordinates
index:
- 1
longitude:
plugin: extract
source: coordinates
index:
- 0
field_geolocation:
plugin: geofield_latlon
source:
- '@latitude'
- '@longitude'
- latitude
- longitude
field_office_hours:
plugin: va_field_office_hours
source: hours
Expand Down
Loading

0 comments on commit fee52e7

Please sign in to comment.