Skip to content

Commit

Permalink
Get tests to run locally
Browse files Browse the repository at this point in the history
The Github pipelines are checking out helm charts, whereas it is not doing so locally. Changing the test to look at a local version of helm-charts. Unfortunately this means that we are tied to having the helm charts repo checked out to get it passing locally.
  • Loading branch information
minhngocd committed Sep 20, 2024
1 parent c57e9fe commit a5b15f0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
env:
RAILS_ENV: test
GOVUK_CONTENT_SCHEMAS_PATH: vendor/publishing-api/content_schemas
GOVUK_HELM_CHARTS_PATH: vendor/govuk-helm-charts
TEST_DATABASE_URL: ${{ steps.setup-postgres.outputs.db-url }}
run: bundle exec rake spec

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ To enable them for your GOV.UK account add them to your account in [Signon](http

### Running the test suite

**Note:** You will need to checkout `govuk-helm-charts` into your `govuk` repository in order to have local tests passing.

```
bundle exec rake
```
Expand Down
3 changes: 2 additions & 1 deletion spec/db/scrub_access_limited_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
RSpec.describe "Scrub Access Limited SQL Script" do
def execute_sql
sql = File.read(Rails.root.join("vendor/govuk-helm-charts/charts/db-backup/scripts/content-publisher.sql"))
helm_charts_path = ENV.fetch("GOVUK_HELM_CHARTS_PATH", "../govuk-helm-charts")
sql = File.read(Rails.root.join("#{helm_charts_path}/charts/db-backup/scripts/content-publisher.sql"))
ActiveRecord::Base.connection.execute(sql)
end

Expand Down

0 comments on commit a5b15f0

Please sign in to comment.