DFE-Digital / schools-experience

The Department for Education's Get Schools Experience Service which allows you to find out more about teaching by visiting schools.
https://dfe-digital.github.io/schools-experience/
MIT License
9 stars 4 forks source link

Update dfe-analytics and switch on an entity table check #3222

Closed martyn-w closed 1 week ago

martyn-w commented 2 weeks ago

(Original PR: https://github.com/DFE-Digital/schools-experience/pull/3061)

Trello card

https://trello.com/c/dRaTmD3g/

Context

Enable an Entity Table Check job on GIT which sends a row_count, a checksum and a timestamp for each entity table sent to BigQuery This helps Data Insights team to confirm that database tables match BigQuery and helps them debug them where they don’t

Changes proposed in this pull request

Guidance to review

Check that:

martyn-w commented 1 week ago

NB: updating the dfe-analytics gem to v1.12.7 throws a strange error in the tests:

An error occurred while loading spec_helper.
Failure/Error: require "dfe/analytics/testing"

NameError:
  uninitialized constant DfE::Analytics::BigQueryLegacyApi

      DfE::Analytics::BigQueryLegacyApi.singleton_class.send :prepend, LegacyTestOverrides

...whereas version v1.12.5 does not seem to have this problem

asatwal commented 1 week ago

@martyn-w

Regarding the error: uninitialized constant DfE::Analytics::BigQueryLegacyApi

I believe in spec/rails_helper.rb the line below maybe a problem:

require "dfe/analytics/testing"

I think it's because that file is referencing DfE::Analytics::BigQueryLegacyApi, whereas previously it didn't and the Gem is not fully loaded.

martyn-w commented 1 week ago

Thanks @asatwal, I've added two more require statements to spec/spec_helper.rb, have updated to v1.12.7 and the tests seem run fine now

github-actions[bot] commented 1 week ago

Review app deployed to https://get-school-experience-review-pr-3222.test.teacherservices.cloud :white_check_mark: DfE sign in route obtained: https://get-school-experience-review-pr-2.test.teacherservices.cloud