Skip to content

Commit

Permalink
Retire old and unused site prism specs and related overhead (#1281)
Browse files Browse the repository at this point in the history
* Remove unused browser checks
* Update README
* Update Dockerfile and Gemfile
peterdavidhamilton authored Jul 23, 2024
1 parent 0d74434 commit 5de737d
Showing 39 changed files with 6 additions and 1,416 deletions.
1 change: 0 additions & 1 deletion .github/workflows/azure-deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -16,7 +16,6 @@ on:
- .yardopts
- bin/*
- docker-compose.*
- terraform/**
- terraform-azure/**
- uml/*

1 change: 0 additions & 1 deletion .github/workflows/azure-deploy-review.yml
Original file line number Diff line number Diff line change
@@ -16,7 +16,6 @@ on:
- bin/*
- docker-compose.*
- Dockerfile
- terraform
- terraform-azure
- uml/*

1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -18,7 +18,6 @@ on:
- bin/*
- docker-compose.*
- Dockerfile
- terraform
- terraform-azure

jobs:
74 changes: 0 additions & 74 deletions .github/workflows/qa.yml

This file was deleted.

4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -53,9 +53,7 @@ doc
coverage

# Self-signed certificates
localhost.crt
localhost.key
nscacert.pem
*.pem

# Yarn files
.yarn/*
27 changes: 0 additions & 27 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -117,33 +117,6 @@ COPY .rubocop_todo.yml ${APP_HOME}/.rubocop_todo.yml

CMD ["bundle", "exec", "rspec"]

# ------------------------------------------------------------------------------
# Test UI Stage (additional non-Ruby dependencies, containerised version of local dev experience)
# ------------------------------------------------------------------------------
FROM app as ui

RUN bundle config unset without
RUN bundle config set without development
RUN bundle install --no-binstubs --retry=10 --jobs=4

COPY ui ${APP_HOME}/ui

CMD ["bundle", "exec", "rspec", "--default-path", "ui"]

# ------------------------------------------------------------------------------
# QA Stage - ./bin/docker-qa
# ------------------------------------------------------------------------------
FROM base as qa

RUN gem install pry-byebug rspec capybara site_prism selenium-webdriver faker dry-inflector

WORKDIR /srv

COPY ui /srv/spec
COPY .rspec /srv/.rspec

CMD ["rspec"]

# ------------------------------------------------------------------------------
# Pa11y CI - ./bin/docker-pa11y
# ------------------------------------------------------------------------------
11 changes: 0 additions & 11 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -106,14 +106,3 @@ group :test do
gem 'show_me_the_cookies'
gem 'simplecov'
end

# NB:
# This gem group is being installed into an as yet unused Docker target 'ui' that
# adds additional test dependencies for /ui tests alongside application code.
# However, this is also available in an isolated container, target 'qa'.
#
group :ui do
gem 'dry-inflector'
gem 'selenium-webdriver'
gem 'site_prism'
end
18 changes: 1 addition & 17 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -471,7 +471,7 @@ GEM
actionpack (>= 5.2)
railties (>= 5.2)
retriable (3.1.2)
rexml (3.3.2)
rexml (3.3.1)
strscan
rouge (4.2.0)
rspec-core (3.13.0)
@@ -535,14 +535,7 @@ GEM
rexml
ruby-progressbar (1.13.0)
ruby-rc4 (0.1.5)
rubyzip (2.3.2)
safely_block (0.4.0)
selenium-webdriver (4.23.0)
base64 (~> 0.2)
logger (~> 1.4)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
sentry-rails (5.18.1)
railties (>= 5.0)
sentry-ruby (~> 5.18.1)
@@ -562,11 +555,6 @@ GEM
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
site_prism (5.0.3)
addressable (~> 2.8, >= 2.8.4)
capybara (~> 3.32)
site_prism-all_there (> 2, < 5)
site_prism-all_there (3.0.5)
sitemap_generator (6.3.0)
builder (~> 3.0)
slim (5.2.1)
@@ -625,7 +613,6 @@ GEM
faraday (~> 2.0)
faraday-follow_redirects
webrick (1.8.1)
websocket (1.2.11)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
@@ -665,7 +652,6 @@ DEPENDENCIES
dibber
dotenv-rails
dry-core
dry-inflector
dry-initializer
dry-struct
dry-types
@@ -697,12 +683,10 @@ DEPENDENCIES
rspec-rails
rubocop-govuk
rubocop-performance
selenium-webdriver
sentry-rails
sentry-ruby
show_me_the_cookies
simplecov
site_prism
sitemap_generator
slim-rails
sprockets-rails
37 changes: 3 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -127,30 +127,15 @@ The commands run common tasks inside containers:
equivalent of `bin/rspec`
- `bin/docker-doc` runs a YARD documentation server
- `bin/docker-uml` exports UML diagrams as default PNGs
- `bin/docker-prod` starts rails in production under `https`
- `bin/docker-qa` runs the browser tests against a running production application,
a containerised equivalent of `bin/qa`
- `bin/docker-pa11y` runs WCAG checks against a generated `sitemap.xml`

These commands can be used to debug problems:

- `docker ps` lists all active **Docker** processes
- `docker system prune` tidies up your system
- `docker-compose -f docker-compose.yml -f docker-compose.<FILE>.yml --project-name recovery run --rm app`
can help identify why the application is not running in either the `dev`, `test`, or `qa` contexts
- `BASE_URL=https://app:3000 docker-compose -f docker-compose.yml -f docker-compose.qa.yml --project-name recovery up app` debug the UAT tests

## Using Rake

Custom tasks are namespaced under `eyfs`, list them using `rake --tasks eyfs`.

```sh
# Generate secure bot user
$ rake eyfs:bot
# Que job to insert page view events for injected module items
$ rake eyfs:jobs:plug_content
# Recalculate module completion time
$ rake eyfs:user_progress
# Enable the post login 'What's new' page
$ rake eyfs:whats_new
```
@@ -196,19 +181,6 @@ Production console access
| 6274651 | eyf-recovery | early-years-foundation-reform | eyf-recovery |
+---------+--------------+-------------------------------+--------------+

## Quality Assurance

The UI/UA test suite can be run against any site.
A production-like application is available as a composed Docker service for local development.
To run a self-signed certificate must first be generated.

1. `./bin/docker-certs` (Mac users can trust the certificate in [Keychain Access](https://support.apple.com/en-gb/guide/keychain-access))
2. `./bin/docker-qa` (this will build and bring up the application with a clean database)
3. `./bin/docker-prod-reset` (clean and reseed the prerequisite user accounts)
4. `./bin/docker-qa` (retest)
4. `BASE_URL=https://deployment ./bin/docker-qa` (alternative test against another server)


## Accessibility Standards

An automated accessibility audit can be run against a development server running
@@ -277,7 +249,7 @@ Using this authentication method also requires basic HTTP auth credentials.

For status updates see <https://status.account.gov.uk/>

### Questions
### Support

Questions can be directed to the `#govuk-one-login` slack channel <https://ukgovernmentdigital.slack.com/archives/C02AQUJ6WTC>

@@ -302,14 +274,14 @@ User [service accounts](https://cloud.google.com/iam/docs/service-accounts) can
- [Staging Dashboard](https://lookerstudio.google.com/reporting/8f550461-c4e7-4c9f-b597-6f27669ff14c)
- [Staging Bucket](https://console.cloud.google.com/storage/browser/eyfs-data-dashboard-staging)
- [Production Dashboard](https://lookerstudio.google.com/reporting/095cfc94-d1d2-4a32-a2ba-d5899c3ecea5)
- [Production Bucket](https://console.cloud.google.com/storage/browser/eyfs-data-dashboard-live)
- [Production Bucket](https://console.cloud.google.com/storage/browser/eyfs-recovery-production)

**Downloading exported data**

- `gcloud auth login`
- `gcloud config set project eyfsdashboard`
- `gsutil ls` (list buckets)
- `gsutil -m cp -r "gs://eyfs-data-dashboard-live/eventsdata" "gs://eyfs-data-dashboard-live/useranswers" .` (export folders recursively)
- `gsutil -m cp -r "gs://eyfs-recovery-production/events" "gs://eyfs-recovery-production/training" .` (export folders recursively)


---
@@ -357,7 +329,6 @@ File.open(file, 'w') { |file| file.write(data.to_yaml) }
<!-- Deployments -->

[prototype-app]: https://eye-recovery.herokuapp.com
[interim-prototype-app]: https://child-development-training-prototype.london.cloudapps.digital
[production]: https://child-development-training.education.gov.uk
[staging]: https://staging.child-development-training.education.gov.uk
[development]: https://eyrecovery-dev.azurewebsites.net
@@ -370,11 +341,9 @@ File.open(file, 'w') { |file| file.write(data.to_yaml) }
[ci-workflow]: https://github.com/DFE-Digital/early-years-foundation-recovery/actions/workflows/ci.yml
[production-workflow]: https://github.com/DFE-Digital/early-years-foundation-recovery/actions/workflows/production.yml
[staging-workflow]: https://github.com/DFE-Digital/early-years-foundation-recovery/actions/workflows/staging.yml
[qa-workflow]: https://github.com/DFE-Digital/early-years-foundation-recovery/actions/workflows/qa.yml

<!-- GH workflow badges -->

[brakeman-badge]: https://github.com/DFE-Digital/early-years-foundation-recovery/actions/workflows/brakeman.yml/badge.svg
[pa11y-badge]: https://github.com/DFE-Digital/early-years-foundation-recovery/actions/workflows/pa11y.yml/badge.svg
[ci-badge]: https://github.com/DFE-Digital/early-years-foundation-recovery/actions/workflows/ci.yml/badge.svg
[qa-badge]: https://github.com/DFE-Digital/early-years-foundation-recovery/actions/workflows/qa.yml/badge.svg
2 changes: 1 addition & 1 deletion bin/docker-build
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
# ------------------------------------------------------------------------------
set -e

for env in dev test qa; do
for env in dev test; do
docker-compose \
-f docker-compose.yml \
-f docker-compose.$env.yml \
12 changes: 0 additions & 12 deletions bin/docker-certs

This file was deleted.

17 changes: 0 additions & 17 deletions bin/docker-prod

This file was deleted.

10 changes: 0 additions & 10 deletions bin/docker-prod-reset

This file was deleted.

26 changes: 0 additions & 26 deletions bin/docker-qa

This file was deleted.

15 changes: 0 additions & 15 deletions bin/qa

This file was deleted.

74 changes: 0 additions & 74 deletions docker-compose.qa.yml

This file was deleted.

34 changes: 0 additions & 34 deletions ui/drivers/capybara_drivers.rb

This file was deleted.

64 changes: 0 additions & 64 deletions ui/drivers/chrome.rb

This file was deleted.

64 changes: 0 additions & 64 deletions ui/drivers/firefox.rb

This file was deleted.

28 changes: 0 additions & 28 deletions ui/e2e_spec.rb

This file was deleted.

23 changes: 0 additions & 23 deletions ui/home_page_spec.rb

This file was deleted.

12 changes: 0 additions & 12 deletions ui/pages/base.rb

This file was deleted.

11 changes: 0 additions & 11 deletions ui/pages/edit_name.rb

This file was deleted.

7 changes: 0 additions & 7 deletions ui/pages/home.rb

This file was deleted.

11 changes: 0 additions & 11 deletions ui/pages/my_account.rb

This file was deleted.

9 changes: 0 additions & 9 deletions ui/pages/privacy_policy.rb

This file was deleted.

26 changes: 0 additions & 26 deletions ui/pages/sign_in.rb

This file was deleted.

9 changes: 0 additions & 9 deletions ui/pages/terms_and_conditions.rb

This file was deleted.

17 changes: 0 additions & 17 deletions ui/privacy_policy.spec.rb

This file was deleted.

21 changes: 0 additions & 21 deletions ui/profile_management_spec.rb

This file was deleted.

7 changes: 0 additions & 7 deletions ui/sections/footer.rb

This file was deleted.

13 changes: 0 additions & 13 deletions ui/sections/header.rb

This file was deleted.

35 changes: 0 additions & 35 deletions ui/spec_helper.rb

This file was deleted.

606 changes: 0 additions & 606 deletions ui/support/ast/child-development-and-the-eyfs.yml

This file was deleted.

15 changes: 0 additions & 15 deletions ui/support/env.rb

This file was deleted.

3 changes: 0 additions & 3 deletions ui/support/shared/with_guest.rb

This file was deleted.

16 changes: 0 additions & 16 deletions ui/support/shared/with_user.rb

This file was deleted.

17 changes: 0 additions & 17 deletions ui/terms_and_conditions_spec.rb

This file was deleted.

44 changes: 0 additions & 44 deletions ui/ui.rb

This file was deleted.

0 comments on commit 5de737d

Please sign in to comment.