From 65126b7f84afff6aedf2dbf15424cff62d1244a7 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Thu, 19 Dec 2024 10:33:25 +0100 Subject: [PATCH] Allow to skip frontend specs from extensions When we test extensions with the new starter frontend we run this template to generate the dummy app. This template also installs all frontend specs. This leads to unnecessary long build times, flaky sepcs and simply wastes a lot of resources. Since the extension tests it's own behavior in the dummy app we simply must not duplicate every single spec we also test in this repo. --- template.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/template.rb b/template.rb index c151595f..933c4bed 100644 --- a/template.rb +++ b/template.rb @@ -145,7 +145,13 @@ end RUBY - directory 'spec', verbose: false + # Allows to skip frontend specs generation from extensions CI pipelines + if ENV.fetch("FRONTEND_SPECS", "all") == "all" + directory 'spec', verbose: false + else + # This file is always necessary in order to run frontend specs from extensions + copy_file 'spec/solidus_starter_frontend_spec_helper.rb', verbose: auto_accept, force: auto_accept + end # In CI, the Rails environment is test. In that Rails environment, # `Solidus::InstallGenerator#setup_assets` adds `solidus_frontend` assets to