Remove integrity check for deleted variants in OCs

We have no way to see the output of this weird RSpec integrity check
thus, it's pointless. It only adds unnecessary load the server.

However, the issue it checks seems to still be happening although
not very often. UK's server has 70 occurrences the last one being from
early 2019 while FR's server returns 10.
This commit is contained in:
Pau Perez
2019-09-06 10:30:26 +02:00
parent e3ce2a7486
commit 410e23085e
2 changed files with 0 additions and 26 deletions

View File

@@ -16,10 +16,6 @@ every 1.day, at: '01:00am' do
rake 'ofn:cache:check_products_integrity'
end
every 1.day, at: '12:05am' do
run_file "lib/open_food_network/integrity_checker.rb"
end
every 1.day, at: '2:45am' do
rake 'db2fog:clean' if ENV['S3_BACKUPS_BUCKET']
end

View File

@@ -1,22 +0,0 @@
require 'rspec/rails'
require 'rspec/autorun'
# This spec file is one part of a two-part strategy to maintain data integrity. The first part
# is to proactively protect data integrity using database constraints (not null, foreign keys,
# etc) and ActiveRecord validations. As a backup to those two techniques, and particularly in
# the cases where it's not possible to model an integrity concern with database constraints,
# we can add a reactive integrity test here.
# These tests are run nightly and the results are emailed to the MAILTO address in
# config/schedule.rb if any failures occur.
# Ref: http://pluralsight.com/training/Courses/TableOfContents/database-your-friend
describe "data integrity" do
it "has no deleted variants in order cycles" do
# When a variant is soft deleted, it should be removed from all order cycles
# via Spree::Product#delete or Spree::Variant#delete.
evs = ExchangeVariant.joins(:variant).where('spree_variants.deleted_at IS NOT NULL')
evs.count.should == 0
end
end