Revert "FEATURE: Allow theme tests to be run in production (#12815)" (#12840)

This reverts commit 7217dcb67a59f9c47d655455b60b4e1d8dc30f28.

https://meta.discourse.org/t/failed-to-bootstrap-due-to-out-of-memory-killer/188141/18?u=osama

Precompiling test_helper.js is so expensive that it can make bootstrap
fail on servers with limited resources (2GB RAM). We will find another
way that doesn't require much resources.
This commit is contained in:
Osama Sayegh
2021-04-26 23:05:58 +03:00
committed by GitHub
parent b32c7df0e9
commit a169dc6832
27 changed files with 208 additions and 24460 deletions

View File

@ -865,41 +865,4 @@ HTML
end
end
describe "#baked_js_tests_with_digest" do
before do
ThemeField.create!(
theme_id: theme.id,
target_id: Theme.targets[:settings],
name: "yaml",
value: "some_number: 1"
)
theme.set_field(
target: :tests_js,
type: :js,
name: "acceptance/some-test.js",
value: "assert.ok(true);"
)
theme.save!
end
it 'returns nil for content and digest if theme does not have tests' do
ThemeField.destroy_all
expect(theme.baked_js_tests_with_digest).to eq([nil, nil])
end
it 'digest does not change when settings are changed' do
content, digest = theme.baked_js_tests_with_digest
expect(content).to be_present
expect(digest).to be_present
expect(content).to include("assert.ok(true);")
theme.update_setting(:some_number, 55)
theme.save!
expect(theme.build_settings_hash[:some_number]).to eq(55)
new_content, new_digest = theme.baked_js_tests_with_digest
expect(new_content).to eq(content)
expect(new_digest).to eq(digest)
end
end
end