Skip to content

Commit

Permalink
Merge branch 'enable-app-insights' of https://github.com/DFE-Digital/…
Browse files Browse the repository at this point in the history
  • Loading branch information
nwarms committed Oct 18, 2023
2 parents 1f511d2 + 1b0be7c commit 5862bf1
Show file tree
Hide file tree
Showing 13 changed files with 191 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/continuous-integration-terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ jobs:
run: rm ./terraform/backend.tf

- name: Run a Terraform init
uses: docker://hashicorp/terraform:1.5.7
uses: docker://hashicorp/terraform:1.6.1
with:
entrypoint: terraform
args: -chdir=terraform init

- name: Run a Terraform validate
uses: docker://hashicorp/terraform:1.5.7
uses: docker://hashicorp/terraform:1.6.1
with:
entrypoint: terraform
args: -chdir=terraform validate

- name: Run a Terraform format check
uses: docker://hashicorp/terraform:1.5.7
uses: docker://hashicorp/terraform:1.6.1
with:
entrypoint: terraform
args: -chdir=terraform fmt -check=true -diff=true
Expand Down
99 changes: 99 additions & 0 deletions DfE.FindInformationAcademiesTrusts/Pages/Trusts/Details.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,102 @@
@{
Layout = "_TrustLayout";
}

<section class="govuk-!-margin-top-8 govuk-!-margin-bottom-9">
<div class="govuk-summary-card">
<div class="govuk-summary-card__title-wrapper">
<h2 class="govuk-summary-card__title">Trust details</h2>
</div>
<div class="govuk-summary-card__content">
<dl class="govuk-summary-list">
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
Address
</dt>
<dd class="govuk-summary-list__value">
Dorthy Inlet, Kingston upon Hull, City of, JY36 9VC
</dd>
</div>
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
Opened on
</dt>
<dd class="govuk-summary-list__value">
30 Dec 2013
</dd>
</div>
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
Region and territory
</dt>
<dd class="govuk-summary-list__value">
Yorkshire and the Humber
</dd>
</div>
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
Information from other services (opens in a new tab)
</dt>
<dd class="govuk-summary-list__value">
<p class="govuk-body">
<a class="govuk-link" href="#">Companies House</a>
</p>
<p class="govuk-body">
<a class="govuk-link" href="#">Get information about schools</a>
</p>
<p class="govuk-body">
<a class="govuk-link" href="#">Schools financial benchmarking</a>
</p>
<p class="govuk-body">
<a class="govuk-link" href="#">Find school college and performance data in England</a>
</p>
</dd>
</div>
</dl>
</div>
</div>
</section>

<section class="govuk-!-margin-top-8 govuk-!-margin-bottom-9">
<div class="govuk-summary-card">
<div class="govuk-summary-card__title-wrapper">
<h2 class="govuk-summary-card__title">Reference numbers</h2>
</div>
<div class="govuk-summary-card__content">
<dl class="govuk-summary-list">
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
UID (Unique group identifier)
</dt>
<dd class="govuk-summary-list__value">
2412
</dd>
</div>
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
Group ID (identifier) and TRN (trust reference number)
</dt>
<dd class="govuk-summary-list__value">
TR3971
</dd>
</div>
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
UKPRN (UK provider reference number)
</dt>
<dd class="govuk-summary-list__value">
10013796
</dd>
</div>
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">
Companies House number
</dt>
<dd class="govuk-summary-list__value">
03080547
</dd>
</div>
</dl>
</div>
</div>
</section>
2 changes: 1 addition & 1 deletion terraform/.terraform-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.7
1.6.1
23 changes: 23 additions & 0 deletions terraform/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions terraform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,15 @@ If everything looks good, answer `yes` and wait for the new infrastructure to be

| Name | Version |
|------|---------|
| <a name="provider_azurerm"></a> [azurerm](#provider\_azurerm) | 3.73.0 |
| <a name="provider_azurerm"></a> [azurerm](#provider\_azurerm) | 3.75.0 |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_azure_container_apps_hosting"></a> [azure\_container\_apps\_hosting](#module\_azure\_container\_apps\_hosting) | github.com/DFE-Digital/terraform-azurerm-container-apps-hosting | v1.1.0 |
| <a name="module_azurerm_key_vault"></a> [azurerm\_key\_vault](#module\_azurerm\_key\_vault) | github.com/DFE-Digital/terraform-azurerm-key-vault-tfvars | v0.2.0 |
| <a name="module_azurerm_key_vault"></a> [azurerm\_key\_vault](#module\_azurerm\_key\_vault) | github.com/DFE-Digital/terraform-azurerm-key-vault-tfvars | v0.2.1 |
| <a name="module_statuscake-tls-monitor"></a> [statuscake-tls-monitor](#module\_statuscake-tls-monitor) | github.com/dfe-digital/terraform-statuscake-tls-monitor | v0.1.1 |

## Resources

Expand Down Expand Up @@ -201,6 +202,9 @@ If everything looks good, answer `yes` and wait for the new infrastructure to be
| <a name="input_project_name"></a> [project\_name](#input\_project\_name) | Project name. Will be used along with `environment` as a prefix for all resources. | `string` | n/a | yes |
| <a name="input_redis_cache_capacity"></a> [redis\_cache\_capacity](#input\_redis\_cache\_capacity) | Redis Cache Capacity | `number` | n/a | yes |
| <a name="input_redis_cache_sku"></a> [redis\_cache\_sku](#input\_redis\_cache\_sku) | Redis Cache SKU | `string` | n/a | yes |
| <a name="input_statuscake_api_token"></a> [statuscake\_api\_token](#input\_statuscake\_api\_token) | API token for StatusCake | `string` | n/a | yes |
| <a name="input_statuscake_contact_group_integrations"></a> [statuscake\_contact\_group\_integrations](#input\_statuscake\_contact\_group\_integrations) | List of Integration IDs to connect to your Contact Group | `list(string)` | `[]` | no |
| <a name="input_statuscake_contact_group_name"></a> [statuscake\_contact\_group\_name](#input\_statuscake\_contact\_group\_name) | Name of the contact group in StatusCake | `string` | `""` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Tags to be applied to all resources | `map(string)` | n/a | yes |
| <a name="input_tfvars_filename"></a> [tfvars\_filename](#input\_tfvars\_filename) | tfvars filename. This file is uploaded and stored encrypted within Key Vault, to ensure that the latest tfvars are stored in a shared place. | `string` | n/a | yes |
| <a name="input_virtual_network_address_space"></a> [virtual\_network\_address\_space](#input\_virtual\_network\_address\_space) | Virtual network address space CIDR | `string` | n/a | yes |
Expand Down
4 changes: 0 additions & 4 deletions terraform/ci-storage.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,5 @@ resource "azurerm_monitor_diagnostic_setting" "ci-test-reports" {

metric {
category = "Transaction"

retention_policy {
enabled = false
}
}
}
2 changes: 1 addition & 1 deletion terraform/key-vault-tfvars-secrets.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module "azurerm_key_vault" {
source = "github.com/DFE-Digital/terraform-azurerm-key-vault-tfvars?ref=v0.2.0"
source = "github.com/DFE-Digital/terraform-azurerm-key-vault-tfvars?ref=v0.2.1"

environment = local.environment
project_name = local.project_name
Expand Down
4 changes: 4 additions & 0 deletions terraform/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,8 @@ locals {
key_vault_access_users = var.key_vault_access_users
key_vault_access_ipv4 = var.key_vault_access_ipv4
tfvars_filename = var.tfvars_filename
statuscake_api_token = var.statuscake_api_token
statuscake_monitored_resource_address = "https://${local.dns_zone_domain_name}${local.monitor_endpoint_healthcheck}"
statuscake_contact_group_name = var.statuscake_contact_group_name
statuscake_contact_group_integrations = var.statuscake_contact_group_integrations
}
12 changes: 12 additions & 0 deletions terraform/statuscake-tls-monitor.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module "statuscake-tls-monitor" {
source = "github.com/dfe-digital/terraform-statuscake-tls-monitor?ref=v0.1.1"

statuscake_api_token = local.statuscake_api_token
statuscake_monitored_resource_address = local.statuscake_monitored_resource_address
statuscake_alert_at = [ # days to alert on
14, 7, 3
]
statuscake_contact_group_name = local.statuscake_contact_group_name
statuscake_contact_group_integrations = local.statuscake_contact_group_integrations
statuscake_contact_group_email_addresses = local.monitor_email_receivers
}
18 changes: 18 additions & 0 deletions terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -277,3 +277,21 @@ variable "tfvars_filename" {
description = "tfvars filename. This file is uploaded and stored encrypted within Key Vault, to ensure that the latest tfvars are stored in a shared place."
type = string
}

variable "statuscake_api_token" {
description = "API token for StatusCake"
type = string
sensitive = true
}

variable "statuscake_contact_group_name" {
description = "Name of the contact group in StatusCake"
type = string
default = ""
}

variable "statuscake_contact_group_integrations" {
description = "List of Integration IDs to connect to your Contact Group"
type = list(string)
default = []
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ test.describe('Details page', () => {
await detailsPage.goTo()
await detailsPage.expect.toSeeCorrectTrustNameAndTypeInHeader()
await detailsPage.trustNavigation.expect.toBeVisible()

await detailsPage.expect.toSeeCorrectTrustDetails()
await detailsPage.expect.toSeeCorrectTrustReferenceNumbers()
await expectNoAccessibilityViolations()
})
})
17 changes: 17 additions & 0 deletions tests/playwright/page-object-model/trust/details-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ export class DetailsPage {
readonly trustHeading: TrustHeaderComponent
readonly trustNavigation: TrustNavigationComponent
readonly pageHeadingLocator: Locator
readonly trustDetailsCardLocator: Locator
readonly referenceNumbersCardLocator: Locator

constructor (readonly page: Page) {
this.expect = new DetailsPageAssertions(this)
this.trustHeading = new TrustHeaderComponent(page)
this.trustNavigation = new TrustNavigationComponent(page)
this.pageHeadingLocator = page.locator('h1')
this.trustDetailsCardLocator = this.page.getByText('Trust details Address')
this.referenceNumbersCardLocator = this.page.getByText('Reference numbers UID')
}

async goTo (
Expand All @@ -40,4 +44,17 @@ class DetailsPageAssertions {
const { name, type } = MockTrustsProvider.expectedFormattedTrustResult
await this.detailsPage.trustHeading.expect.toSeeCorrectTrustNameAndType(name, type)
}

async toSeeCorrectTrustDetails (): Promise<void> {
await expect(this.detailsPage.trustDetailsCardLocator).toContainText('Address Dorthy Inlet, Kingston upon Hull, City of, JY36 9VC')
await expect(this.detailsPage.trustDetailsCardLocator).toContainText('Opened on 30 Dec 2013')
await expect(this.detailsPage.trustDetailsCardLocator).toContainText('Region and territory Yorkshire and the Humber')
}

async toSeeCorrectTrustReferenceNumbers (): Promise<void> {
await expect(this.detailsPage.referenceNumbersCardLocator).toContainText('UID (Unique group identifier) 2412')
await expect(this.detailsPage.referenceNumbersCardLocator).toContainText('Group ID (identifier) and TRN (trust reference number) TR3971')
await expect(this.detailsPage.referenceNumbersCardLocator).toContainText('UKPRN (UK provider reference number) 10013796')
await expect(this.detailsPage.referenceNumbersCardLocator).toContainText('Companies House number 03080547')
}
}
5 changes: 5 additions & 0 deletions tests/playwright/ui-tests/trusts/details-page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ test.describe('Details page', () => {
await detailsPage.expect.toSeeCorrectTrustNameAndTypeInHeader()
})

test('user should see the correct trust information', async () => {
await detailsPage.expect.toSeeCorrectTrustDetails()
await detailsPage.expect.toSeeCorrectTrustReferenceNumbers()
})

test.describe('given a user tries to visit the url without an existing trust', () => {
test.beforeEach(({ page }) => {
notFoundPage = new NotFoundPage(page)
Expand Down

0 comments on commit 5862bf1

Please sign in to comment.