Skip to content

Commit

Permalink
Bundler: Run native helper specs
Browse files Browse the repository at this point in the history
Fix bundler `script/ci-test` bash codes and conform scripts to use
`bin/bash`.

Native helper specs are not being run as the script/ci-test currently
bails out with:

```
./script/ci-test: 7: [: bundler1: unexpected operator
./script/ci-test: 14: [: bundler1: unexpected operator
```
  • Loading branch information
feelepxyz committed Jun 16, 2021
1 parent 5aed0e5 commit a55182c
Show file tree
Hide file tree
Showing 22 changed files with 80 additions and 46 deletions.
13 changes: 5 additions & 8 deletions bundler/helpers/v1/spec/functions/file_parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
)
end

let(:project_name) { "gemfile" }

describe "#parsed_gemfile" do
let(:project_name) { "gemfile" }

subject(:parsed_gemfile) do
in_tmp_folder do
dependency_source.parsed_gemfile(gemfile_name: "Gemfile")
Expand Down Expand Up @@ -43,14 +43,11 @@
end

describe "#parsed_gemspec" do
let!(:gemspec_fixture) do
fixture("ruby", "gemspecs", "exact")
end
let(:project_name) { "gemfile_exact" }

subject(:parsed_gemspec) do
in_tmp_folder do |tmp_path|
File.write(File.join(tmp_path, "test.gemspec"), gemspec_fixture)
dependency_source.parsed_gemspec(gemspec_name: "test.gemspec")
in_tmp_folder do |_tmp_path|
dependency_source.parsed_gemspec(gemspec_name: "example.gemspec")
end
end

Expand Down
13 changes: 5 additions & 8 deletions bundler/helpers/v2/spec/functions/file_parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
)
end

let(:project_name) { "gemfile" }

describe "#parsed_gemfile" do
let(:project_name) { "gemfile" }

subject(:parsed_gemfile) do
in_tmp_folder do
dependency_source.parsed_gemfile(gemfile_name: "Gemfile")
Expand Down Expand Up @@ -108,14 +108,11 @@
end

describe "#parsed_gemspec" do
let!(:gemspec_fixture) do
fixture("ruby", "gemspecs", "exact")
end
let(:project_name) { "gemfile_exact" }

subject(:parsed_gemspec) do
in_tmp_folder do |tmp_path|
File.write(File.join(tmp_path, "test.gemspec"), gemspec_fixture)
dependency_source.parsed_gemspec(gemspec_name: "test.gemspec")
in_tmp_folder do |_tmp_path|
dependency_source.parsed_gemspec(gemspec_name: "example.gemspec")
end
end

Expand Down
24 changes: 13 additions & 11 deletions bundler/script/ci-test
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
#!/bin/sh -e
#!/bin/bash

set -e

bundle install
bundle exec rubocop .
bundle exec rspec spec

if [ "$SUITE_NAME" == "bundler1" ]; then
cd helpers/v1 && \
BUNDLER_VERSION=1 bundle install && \
BUNDLER_VERSION=1 bundle exec rspec spec &&\
cd -
if [[ "$SUITE_NAME" == "bundler1" ]]; then
cd helpers/v1 \
&& BUNDLER_VERSION=1 bundle install \
&& BUNDLER_VERSION=1 bundle exec rspec spec\
&& cd -
fi

if [ "$SUITE_NAME" == "bundler2" ]; then
cd helpers/v2 && \
BUNDLER_VERSION=2 bundle install && \
BUNDLER_VERSION=2 bundle exec rspec spec &&\
cd -
if [[ "$SUITE_NAME" == "bundler2" ]]; then
cd helpers/v2 \
&& BUNDLER_VERSION=2 bundle install \
&& BUNDLER_VERSION=2 bundle exec rspec spec \
&& cd -
fi
4 changes: 3 additions & 1 deletion cargo/script/ci-test
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh -e
#!/bin/bash

set -e

bundle install
bundle exec rubocop .
Expand Down
4 changes: 3 additions & 1 deletion common/script/ci-test
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh -e
#!/bin/bash

set -e

bundle install
bundle exec rubocop .
Expand Down
4 changes: 3 additions & 1 deletion common/spec/helpers/test/error_bash
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/sh
#!/bin/bash

set -e

exit 1
4 changes: 3 additions & 1 deletion common/spec/helpers/test/run_bash
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/bin/sh
#!/bin/bash

set -e

echo "$@"
4 changes: 3 additions & 1 deletion composer/script/ci-test
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh -e
#!/bin/bash

set -e

bundle install
bundle exec rubocop .
Expand Down
4 changes: 3 additions & 1 deletion dep/script/ci-test
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh -e
#!/bin/bash

set -e

bundle install
bundle exec rubocop .
Expand Down
4 changes: 3 additions & 1 deletion docker/script/ci-test
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh -e
#!/bin/bash

set -e

bundle install
bundle exec rubocop .
Expand Down
4 changes: 3 additions & 1 deletion elm/script/ci-test
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh -e
#!/bin/bash

set -e

bundle install
bundle exec rubocop .
Expand Down
4 changes: 3 additions & 1 deletion git_submodules/script/ci-test
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh -e
#!/bin/bash

set -e

bundle install
bundle exec rubocop .
Expand Down
4 changes: 3 additions & 1 deletion github_actions/script/ci-test
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh
#!/bin/bash

set -e

bundle install
bundle exec rubocop .
Expand Down
4 changes: 3 additions & 1 deletion go_modules/script/ci-test
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh -e
#!/bin/bash

set -e

bundle install
bundle exec rubocop .
Expand Down
4 changes: 3 additions & 1 deletion gradle/script/ci-test
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh -e
#!/bin/bash

set -e

bundle install
bundle exec rubocop .
Expand Down
4 changes: 3 additions & 1 deletion hex/script/ci-test
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh -e
#!/bin/bash

set -e

bundle install
bundle exec rubocop .
Expand Down
4 changes: 3 additions & 1 deletion maven/script/ci-test
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh -e
#!/bin/bash

set -e

bundle install
bundle exec rubocop .
Expand Down
4 changes: 3 additions & 1 deletion npm_and_yarn/script/ci-test
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh -e
#!/bin/bash

set -e

bundle install
bundle exec rubocop .
Expand Down
4 changes: 3 additions & 1 deletion nuget/script/ci-test
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh -e
#!/bin/bash

set -e

bundle install
bundle exec rubocop .
Expand Down
4 changes: 3 additions & 1 deletion omnibus/script/ci-test
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh -e
#!/bin/bash

set -e

bundle install
bundle exec rubocop .
4 changes: 3 additions & 1 deletion python/script/ci-test
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh -e
#!/bin/bash

set -e

bundle install
pyenv exec flake8 helpers/. --count --exclude=./.*,./python/spec/fixtures --show-source --statistics
Expand Down
4 changes: 3 additions & 1 deletion terraform/script/ci-test
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh -e
#!/bin/bash

set -e

bundle install
bundle exec rubocop .
Expand Down

0 comments on commit a55182c

Please sign in to comment.