Skip to content

Commit

Permalink
Merge pull request #449 from DFE-Digital/release/6-Nov-24-R1
Browse files Browse the repository at this point in the history
Release branch created 6 Nov 24 (R1)
  • Loading branch information
RobertGHippo authored Nov 27, 2024
2 parents 0fd1b69 + 8e9b45a commit f909d17
Show file tree
Hide file tree
Showing 83 changed files with 5,277 additions and 883 deletions.
36 changes: 36 additions & 0 deletions .github/actions/run-playwright-smoke-tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Run Playwright smoke tests
description: Run smoke tests using Playwright

inputs:
webapp_url:
required: true
type: string
auth_secret:
required: true
type: string

runs:
using: composite
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
shell: bash
working-directory: ./tests/Dfe.EarlyYearsQualification.SmokeTests/playwright
run: npm ci
- name: Install Playwright Browsers
shell: bash
working-directory: ./tests/Dfe.EarlyYearsQualification.SmokeTests/playwright
run: npx playwright install --with-deps
- name: Run Playwright tests
shell: bash
working-directory: ./tests/Dfe.EarlyYearsQualification.SmokeTests/playwright
run: WEBAPP_URL=https://${{ inputs.webapp_url }}.azurewebsites.net AUTH_SECRET=${{ inputs.auth_secret }} npx playwright test
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
2 changes: 1 addition & 1 deletion .github/workflows/code-pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
--ServiceAccess:IsPublic="true" &
- name: ZAP Scan
uses: zaproxy/action-baseline@v0.13.0
uses: zaproxy/action-baseline@v0.14.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
docker_name: 'ghcr.io/zaproxy/zaproxy:stable'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev-security-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
# Run full ZAP scan
- name: ZAP Scan
uses: zaproxy/action-full-scan@v0.11.0
uses: zaproxy/action-full-scan@v0.12.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
docker_name: 'ghcr.io/zaproxy/zaproxy:stable'
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/development-build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,9 @@ jobs:
uses: ./.github/actions/health-check
with:
webapp_url: ${{ vars.WEBAPP_NAME }}

# Run smoke test
- name: Run smoke tests
uses: ./.github/actions/run-smoke-tests

- name: Run Playwright smoke tests
uses: ./.github/actions/run-playwright-smoke-tests
with:
webapp_url: ${{ vars.WEBAPP_NAME }}
webapp_url: ${{ vars.WEBAPP_NAME }}
auth_secret: ${{ secrets.WEBAPP_E2E_ACCESS_KEY }}
10 changes: 5 additions & 5 deletions .github/workflows/release-build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ jobs:
webapp_url: "${{ vars.WEBAPP_NAME }}-${{ vars.WEBAPP_SLOT_NAME }}"

# Run smoke test
- name: Run smoke tests against slot
uses: ./.github/actions/run-smoke-tests
- name: Run Playwright smoke tests against slot
uses: ./.github/actions/run-playwright-smoke-tests
with:
webapp_url: "${{ vars.WEBAPP_NAME }}-${{ vars.WEBAPP_SLOT_NAME }}"
auth_secret: ${{ secrets.WEBAPP_E2E_ACCESS_KEY }}
Expand Down Expand Up @@ -116,9 +116,9 @@ jobs:
with:
webapp_url: "${{ vars.WEBAPP_NAME }}-${{ vars.WEBAPP_SLOT_NAME }}"

# Run smoke test
- name: Run smoke tests against slot
uses: ./.github/actions/run-smoke-tests
# Run smoke test
- name: Run Playwright smoke tests against slot
uses: ./.github/actions/run-playwright-smoke-tests
with:
webapp_url: "${{ vars.WEBAPP_NAME }}-${{ vars.WEBAPP_SLOT_NAME }}"
auth_secret: ${{ secrets.WEBAPP_E2E_ACCESS_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/terraform-pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Terraform PR Check

on:
pull_request:
branches: ["release/**", "fix/**"]
branches: ["release/**", "fix/**", "feature/**"]
paths:
- 'terraform/**'
- '.github/workflows/terraform-pr-check.yml'
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/tf-azure-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ jobs:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v4

# Checks that all Terraform configuration files adhere to a canonical format
# Will fail the build if not
- name: Terraform Format
run: terraform fmt -check

# Sets an environment variable to contain the current IP address
- name: IP address env
Expand Down Expand Up @@ -84,11 +89,6 @@ jobs:
-backend-config="container_name=${{ secrets.TERRAFORM_STATE_STORAGE_CONTAINER_NAME }}"
-backend-config="key=${{ secrets.TERRAFORM_STATE_KEY }}"
# Checks that all Terraform configuration files adhere to a canonical format
# Will fail the build if not
- name: Terraform Format
run: terraform fmt -check

# Generates Terraform input variables
- name: Generate Terraform Variables
shell: bash
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -502,4 +502,7 @@ build/
tests/Dfe.EarlyYearsQualification.E2ETests/cypress/screenshots/

# Sonar
.sonarqube/
.sonarqube/

# k6 browser tests screenshots
screenshots/
2 changes: 1 addition & 1 deletion adr/0019-license.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 0019 - Software License

* **Status**: proposed
* **Status**: accepted

## Context and Problem Statement

Expand Down
30 changes: 30 additions & 0 deletions adr/0020-load-test-framework.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 0020 - Load Testing Framework

* **Status**: accepted

## Context and Problem Statement

To ensure confidence in the service's performance under user load.

## Decision Drivers

* Ease of maintenance
* Established practice among other DfE service development teams
* Ability to use existing Cypress (or Playwright) tests

## Considered Options

* Azure Load Test
* JMeter
* Grafana k6

Azure Load Test can be fed `*.jmx` files from JMeter. However, JMeter itself seems a little
old fashioned nowadays, and was not designed with ease of development & maintenance, nor
for cloud native infrastructure. Also, Azure Load Test incurs a cost to run.

Grafana k6 is in use by other DfE teams, and investigation showed it is flexible
and easy to use.

## Decision Outcome

Grafana k6.
3 changes: 2 additions & 1 deletion adr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ General information about architectural decision records is available at <https:
| [0016 - IaC Documentation](./0016-terraform-docs.md) | Accepted |
| [0017 - Access Guard in Pilot](./0017-access-guard-in-pilot.md) | Accepted |
| [0018 - Release & Branch Strategy](./0018-release-and-branch.md) | Accepted |
| [0019 - Software License](./0019-license.md) | Proposed |
| [0019 - Software License](./0019-license.md) | Accepted |
| [0020 - Load Testing Framework](./0020-load-test-framework.md) | Accepted |
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Dfe.EarlyYearsQualification.Content.Constants;

public static class AdditionalRequirementQuestions
{
public const string QtsQuestion = "1G5cIiKB8QVYujpVH58btv";
}
19 changes: 2 additions & 17 deletions src/Dfe.EarlyYearsQualification.Content/Constants/AdvicePages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,7 @@ public static class AdvicePages
public const string QualificationNotOnTheList = "XU6vhxIHdeasGLwueCGel";

/// <summary>
/// Entry ID for the "Qualification Level 7" advice page
/// Entry ID for the "Level 7 qualification post-2014" advice page.
/// </summary>
public const string QualificationLevel7 = "1bGiyvwsJZPd14dwrVtWCM";

/// <summary>
/// Entry ID for the "Level 6 qualification pre-2014" advice page.
/// </summary>
public const string Level6QualificationPre2014 = "2TT7k2J5KUNmUQ3f8A56tw";

/// <summary>
/// Entry ID for the "Level 6 qualification post-2014" advice page.
/// </summary>
public const string Level6QualificationPost2014 = "5aoy3C3jIEKdMo8fauvyvk";

/// <summary>
/// Entry ID for the TEMPORARY Privacy Policy page.
/// </summary>
public const string TemporaryPrivacyPolicy = "6VCAUoA8ERp0hkeT5JcM72";
public const string Level7QualificationPost2014 = "4nfocBj9Alwfa15ke8MHBj";
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<ItemGroup>
<PackageReference Include="contentful.csharp" Version="8.3.0" />
<PackageReference Include="FuzzySharp" Version="2.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ namespace Dfe.EarlyYearsQualification.Content.Entities;

public class AdditionalRequirementQuestion
{
public SystemProperties Sys { get; init; } = new();

public string Question { get; init; } = string.Empty;

public string HintText { get; init; } = string.Empty;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using Contentful.Core.Models;

namespace Dfe.EarlyYearsQualification.Content.Entities;

public class CheckAdditionalRequirementsAnswerPage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ public class ConfirmQualificationPage
public string ErrorText { get; init; } = string.Empty;
public string ButtonText { get; init; } = string.Empty;
public NavigationLink? BackButton { get; init; }
public string AnswerDisclaimerText { get; init; } = string.Empty;
public string NoAdditionalRequirementsButtonText { get; init; } = string.Empty;
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public class DetailsPage
public Document? FurtherInfoText { get; init; }

public NavigationLink? BackButton { get; init; }

public NavigationLink? BackToAdditionalQuestionsLink { get; init; }

public NavigationLink? BackToConfirmAnswers { get; init; }
public NavigationLink? BackToLevelSixAdviceBefore2014 { get; init; }

public NavigationLink? BackToLevelSixAdvice { get; init; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ public class Qualification(
public string? AdditionalRequirements { get; init; }
public List<AdditionalRequirementQuestion>? AdditionalRequirementQuestions { get; init; }
public List<RatioRequirement>? RatioRequirements { get; init; }
public bool IsAutomaticallyApprovedAtLevel6 { get; init; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,6 @@ public class RatioRequirement
public Document? RequirementForLevel7Before2014 { get; set; }

public Document? RequirementForLevel7After2014 { get; set; }

public Document? RequirementForLevel2BetweenSept14AndAug19 { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,8 @@ await Task.FromResult(CreateAdvicePage("Qualifications achieved in Northern Irel
await Task.FromResult(CreateAdvicePage("Qualification not on the list",
body, QualificationsPath)),

AdvicePages.QualificationLevel7 =>
await Task.FromResult(CreateAdvicePage("Qualification at Level 7",
body,
WhatLevelIsTheQualificationPath)),

AdvicePages.Level6QualificationPre2014 =>
await Task.FromResult(CreateAdvicePage("Level 6 qualification pre 2014",
body, WhatLevelIsTheQualificationPath)),

AdvicePages.Level6QualificationPost2014 =>
await Task.FromResult(CreateAdvicePage("Level 6 qualification post 2014",
body, WhatLevelIsTheQualificationPath)),

AdvicePages.TemporaryPrivacyPolicy =>
await Task.FromResult(CreateAdvicePage("Temporary privacy policy",
AdvicePages.Level7QualificationPost2014 =>
await Task.FromResult(CreateAdvicePage("Level 7 qualification post 2014",
body, WhatLevelIsTheQualificationPath)),
_ => null
};
Expand Down Expand Up @@ -142,12 +129,12 @@ await Task.FromResult(CreateAdvicePage("Temporary privacy policy",
Href = "/confirm-qualification/eyq-240",
OpenInNewTab = false
},
BackToAdditionalQuestionsLink = new NavigationLink
BackToConfirmAnswers = new NavigationLink
{
DisplayText =
"TEST (back to additional questions)",
Href =
"/qualifications/check-additional-questions",
"/qualifications/check-additional-questions/$[qualification-id]$/confirm-answers",
OpenInNewTab = false
},
BackToLevelSixAdvice = new NavigationLink
Expand Down Expand Up @@ -328,7 +315,9 @@ await Task.FromResult(CreateDropdownPage()),
ErrorBannerLink = "Test error banner link",
VariousAwardingOrganisationsExplanation =
ContentfulContentHelper
.Paragraph("Various awarding organisation explanation text")
.Paragraph("Various awarding organisation explanation text"),
AnswerDisclaimerText = "Answer disclaimer text",
NoAdditionalRequirementsButtonText = "Get result"
});
}

Expand All @@ -346,7 +335,7 @@ await Task.FromResult(CreateDropdownPage()),
PreviousQuestionBackButton = new NavigationLink
{
DisplayText = "Previous",
Href = "/previous",
Href = "/qualifications/check-additional-questions",
OpenInNewTab = false
},
CtaButtonText = "Get result",
Expand Down
Loading

0 comments on commit f909d17

Please sign in to comment.