diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a442211142..32afa3792d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,9 +26,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - uses: actions/setup-ruby@v1 + - uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6.x + ruby-version: 2.6.10 - uses: workarea-commerce/ci/test@v1 with: command: cd admin && bin/rails test -b @@ -37,9 +37,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - uses: actions/setup-ruby@v1 + - uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6.x + ruby-version: 2.6.10 - uses: workarea-commerce/ci/test@v1 with: command: cd admin && bin/rails teaspoon @@ -48,13 +48,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - uses: actions/setup-ruby@v1 + - uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6.x + ruby-version: 2.6.10 - uses: workarea-commerce/ci/test@v1 with: command: cd admin && bin/rails test test/system/**/*_test.rb -b - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v4 if: failure() with: name: Admin Screenshots @@ -64,9 +64,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - uses: actions/setup-ruby@v1 + - uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6.x + ruby-version: 2.6.10 - uses: workarea-commerce/ci/test@v1 with: command: cd core && bin/rails teaspoon @@ -75,9 +75,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - uses: actions/setup-ruby@v1 + - uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6.x + ruby-version: 2.6.10 - uses: workarea-commerce/ci/test@v1 with: command: cd core && bin/rails test test/**/*_test.rb -b @@ -86,9 +86,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - uses: actions/setup-ruby@v1 + - uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6.x + ruby-version: 2.6.10 - uses: workarea-commerce/ci/test@v1 with: command: cd storefront && bin/rails test -b @@ -97,9 +97,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - uses: actions/setup-ruby@v1 + - uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6.x + ruby-version: 2.6.10 - uses: workarea-commerce/ci/test@v1 with: command: cd storefront && bin/rails teaspoon @@ -108,13 +108,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - uses: actions/setup-ruby@v1 + - uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6.x + ruby-version: 2.6.10 - uses: workarea-commerce/ci/test@v1 with: command: cd storefront && bin/rails test test/system/**/*_test.rb -b - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@4 if: failure() with: name: Storefront Screenshots diff --git a/README.md b/README.md index a756bc4616..6d9c52da66 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,14 @@ If you have any problems, reach out on our [public Slack](https://www.workarea.c **Watch the Quickstart Video:** +Testing +-------------------------------------------------------------------------------- +Tests can be executed using the included `script/test` helper. This script adds the bundled version of Bundler to the `PATH` and runs `rake test` for all engines. + +```bash +./script/test +``` + Plugins -------------------------------------------------------------------------------- diff --git a/core/workarea-core.gemspec b/core/workarea-core.gemspec index 7e3d40561f..f9fd267f01 100644 --- a/core/workarea-core.gemspec +++ b/core/workarea-core.gemspec @@ -14,7 +14,7 @@ Gem::Specification.new do |s| s.files = `git ls-files -- . ':!:data/product_images/*.jpg'`.split("\n") s.required_ruby_version = ['>= 2.5.0', '< 2.7.0'] - s.add_dependency 'bundler', '>= 1.8.0' # 1.8.0 added env variable for secrets + s.add_dependency 'bundler', '>= 2.4.22' s.add_dependency 'rails', '~> 6.0.0' s.add_dependency 'mongoid', '~> 7.2.0' s.add_dependency 'bcrypt', '~> 3.1.10' diff --git a/script/test b/script/test new file mode 100644 index 0000000000..3f2a6dcb5f --- /dev/null +++ b/script/test @@ -0,0 +1,4 @@ +#!/bin/bash +# Run tests using vendored bundler +export PATH="$(pwd)/vendor/bundle/ruby/3.2.0/bin:$PATH" +BUNDLE_GEMFILE="$(pwd)/Gemfile" bundle exec rake test diff --git a/vendor/bundle/ruby/3.2.0/bin/bundle b/vendor/bundle/ruby/3.2.0/bin/bundle new file mode 100644 index 0000000000..90c62627f8 --- /dev/null +++ b/vendor/bundle/ruby/3.2.0/bin/bundle @@ -0,0 +1,38 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# Exit cleanly from an early interrupt +Signal.trap("INT") do + Bundler.ui.debug("\n#{caller.join("\n")}") if defined?(Bundler) + exit 1 +end + +base_path = File.expand_path("../lib", __dir__) + +if File.exist?(base_path) + $LOAD_PATH.unshift(base_path) +end + +require "bundler" + +if Gem.rubygems_version < Gem::Version.new("3.2.3") && Gem.ruby_version < Gem::Version.new("2.7.a") && !ENV["BUNDLER_NO_OLD_RUBYGEMS_WARNING"] + Bundler.ui.warn \ + "Your RubyGems version (#{Gem::VERSION}) has a bug that prevents " \ + "`required_ruby_version` from working for Bundler. Any scripts that use " \ + "`gem install bundler` will break as soon as Bundler drops support for " \ + "your Ruby version. Please upgrade RubyGems to avoid future breakage " \ + "and silence this warning by running `gem update --system 3.2.3`" +end + +require "bundler/friendly_errors" + +Bundler.with_friendly_errors do + require "bundler/cli" + + # Allow any command to use --help flag to show help for that command + help_flags = %w[--help -h] + help_flag_used = ARGV.any? {|a| help_flags.include? a } + args = help_flag_used ? Bundler::CLI.reformatted_help_args(ARGV) : ARGV + + Bundler::CLI.start(args, :debug => true) +end diff --git a/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.19/libexec/bundle b/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.19/libexec/bundle new file mode 100644 index 0000000000..90c62627f8 --- /dev/null +++ b/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.19/libexec/bundle @@ -0,0 +1,38 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# Exit cleanly from an early interrupt +Signal.trap("INT") do + Bundler.ui.debug("\n#{caller.join("\n")}") if defined?(Bundler) + exit 1 +end + +base_path = File.expand_path("../lib", __dir__) + +if File.exist?(base_path) + $LOAD_PATH.unshift(base_path) +end + +require "bundler" + +if Gem.rubygems_version < Gem::Version.new("3.2.3") && Gem.ruby_version < Gem::Version.new("2.7.a") && !ENV["BUNDLER_NO_OLD_RUBYGEMS_WARNING"] + Bundler.ui.warn \ + "Your RubyGems version (#{Gem::VERSION}) has a bug that prevents " \ + "`required_ruby_version` from working for Bundler. Any scripts that use " \ + "`gem install bundler` will break as soon as Bundler drops support for " \ + "your Ruby version. Please upgrade RubyGems to avoid future breakage " \ + "and silence this warning by running `gem update --system 3.2.3`" +end + +require "bundler/friendly_errors" + +Bundler.with_friendly_errors do + require "bundler/cli" + + # Allow any command to use --help flag to show help for that command + help_flags = %w[--help -h] + help_flag_used = ARGV.any? {|a| help_flags.include? a } + args = help_flag_used ? Bundler::CLI.reformatted_help_args(ARGV) : ARGV + + Bundler::CLI.start(args, :debug => true) +end diff --git a/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.19/libexec/bundler b/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.19/libexec/bundler new file mode 100644 index 0000000000..a6826a8c89 --- /dev/null +++ b/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.19/libexec/bundler @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +load File.expand_path("bundle", __dir__)