busser 0.7.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. checksums.yaml +5 -5
  2. data/.github/workflows/ci.yml +32 -0
  3. data/.github/workflows/pr-title.yml +28 -0
  4. data/.github/workflows/publish.yml +45 -0
  5. data/.gitignore +0 -1
  6. data/.markdownlint.yaml +6 -0
  7. data/.release-please-manifest.json +3 -0
  8. data/.rubocop.yml +9 -0
  9. data/.yamllint +6 -0
  10. data/CHANGELOG.md +44 -0
  11. data/CONTRIBUTING.md +103 -0
  12. data/Gemfile +10 -6
  13. data/README.md +82 -21
  14. data/Rakefile +6 -23
  15. data/bin/busser +2 -4
  16. data/busser.gemspec +12 -15
  17. data/features/deserialize_command.feature +4 -1
  18. data/features/plugin_install_command.feature +1 -1
  19. data/features/support/env.rb +4 -16
  20. data/lib/busser/cli.rb +6 -7
  21. data/lib/busser/command/deserialize.rb +16 -11
  22. data/lib/busser/command/plugin.rb +4 -5
  23. data/lib/busser/command/plugin_create.rb +23 -24
  24. data/lib/busser/command/plugin_install.rb +21 -14
  25. data/lib/busser/command/plugin_list.rb +3 -4
  26. data/lib/busser/command/setup.rb +17 -18
  27. data/lib/busser/command/suite.rb +3 -4
  28. data/lib/busser/command/suite_cleanup.rb +3 -3
  29. data/lib/busser/command/suite_path.rb +2 -3
  30. data/lib/busser/command/test.rb +4 -4
  31. data/lib/busser/cucumber/hooks.rb +1 -9
  32. data/lib/busser/cucumber.rb +69 -49
  33. data/lib/busser/helpers.rb +4 -5
  34. data/lib/busser/plugin.rb +12 -6
  35. data/lib/busser/rubygems.rb +35 -39
  36. data/lib/busser/runner_plugin/dummy.rb +2 -3
  37. data/lib/busser/runner_plugin.rb +1 -2
  38. data/lib/busser/thor.rb +3 -4
  39. data/lib/busser/ui.rb +15 -5
  40. data/lib/busser/version.rb +1 -2
  41. data/lib/busser.rb +3 -4
  42. data/release-please-config.json +13 -0
  43. data/renovate.json +8 -0
  44. data/spec/busser/command/deserialize_spec.rb +110 -0
  45. data/spec/busser/helpers_spec.rb +11 -10
  46. data/spec/busser/plugin_spec.rb +133 -0
  47. data/spec/busser/ui_spec.rb +35 -29
  48. data/spec/spec_helper.rb +1 -7
  49. metadata +29 -89
  50. data/.cane +0 -0
  51. data/.simplecov +0 -10
  52. data/.travis.yml +0 -52
  53. data/Guardfile +0 -18
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 30f4595bebbc27b98f099d0e238e426fea215e25
4
- data.tar.gz: 651088d9f4151726593bcceb028f109c9493e225
2
+ SHA256:
3
+ metadata.gz: a59df776e51a951b813e8427048a91915f8a51488899ea85ed38e244704f7fc4
4
+ data.tar.gz: 4fa1ecc9d303f82f4a26629993229a7a82c46edd1d1f14a77c544689b7e8642a
5
5
  SHA512:
6
- metadata.gz: a0a98ba07cfdc996db7457857002286f4cce1a3475554acf02b93236deb389d56362f443d7ca44e7c063e0b64941c8c5570c18482001ab2c19db34706a6411f2
7
- data.tar.gz: 1f430ccc80672473ac4c48b0ee17e194e8a6f2297e5af94aee7a154edc03c7eb8d77c0756f5bb9c5edf7576bdcb530f0716f19f76b676b8e7e67c9f74797c6ab
6
+ metadata.gz: 18e4d5ef6b17149137cade75655c0406194ad432fbb14835a0ce05cd8e32bf0b60c8fa00f2dc4a7015990110972284d23b24488324fcd5af1cce5f445b0806e7
7
+ data.tar.gz: 8bc4b488740a43e4a28a40edf93f0b021fbac496f2edaee2df43f0eb898f708b447b69f14e72498d9d46ffb7b34821d2f1a1f25fae4373c9b62d76cb8e85e84f
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: "Test"
3
+
4
+ "on":
5
+ push:
6
+ branches: [main]
7
+ pull_request:
8
+ workflow_dispatch:
9
+
10
+ # The default token is granted write access to most of the repository.
11
+ # Nothing here needs more than the checkout.
12
+ permissions:
13
+ contents: read
14
+
15
+ # Supersede in-flight runs for a branch. Pull requests cancel freely, but
16
+ # pushes to main do not: every commit on main should keep a build of its own.
17
+ concurrency:
18
+ group: ${{ github.workflow }}-${{ github.ref }}
19
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
20
+
21
+ jobs:
22
+ lint-unit:
23
+ # Pinned to a commit rather than @main so an upstream edit cannot reach
24
+ # this repository's CI without a reviewed pull request. The trailing
25
+ # comment names the release the commit belongs to, which is what lets
26
+ # Renovate track the pin by version and keep both in step.
27
+ uses: test-kitchen/.github/.github/workflows/lint-unit.yml@95ef7803cf23aae5ee68593de5b7e0a731c1a929 # v0.4.0
28
+ with:
29
+ # This gem requires Ruby 3.2, and so do minitest 6 and cucumber 11.
30
+ # Without this the shared workflow would still start a Ruby 3.1 job and
31
+ # bundler would refuse to resolve there.
32
+ ruby_versions: '["3.2", "3.3", "3.4", "4.0"]'
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: "PR Title"
3
+
4
+ "on":
5
+ pull_request_target:
6
+ types: [opened, edited, reopened, synchronize]
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ conventional-title:
13
+ name: "Conventional commit title"
14
+ runs-on: ubuntu-latest
15
+ permissions:
16
+ pull-requests: read
17
+ steps:
18
+ # Pull requests here are squash merged, so the pull request title becomes
19
+ # the commit subject on main. That makes the title the one place worth
20
+ # checking: release-please reads those subjects to decide the next
21
+ # version and to build the changelog.
22
+ #
23
+ # pull_request_target is used so the check also runs for pull requests
24
+ # from forks. No repository code is checked out in this job, so none of
25
+ # the usual pull_request_target risk applies.
26
+ - uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
27
+ env:
28
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: "Release"
3
+
4
+ "on":
5
+ push:
6
+ branches: [main]
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ release-please:
13
+ runs-on: ubuntu-latest
14
+ permissions:
15
+ contents: write # tag the release and commit the version bump
16
+ pull-requests: write # open and update the release pull request
17
+ packages: write # push the gem to GitHub Packages
18
+ steps:
19
+ # Opens and maintains a release pull request. Merging that pull request
20
+ # is what actually cuts a release, so every step below is skipped until
21
+ # release_created is set.
22
+ - uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
23
+ id: release
24
+ with:
25
+ token: ${{ secrets.PORTER_GITHUB_TOKEN }}
26
+
27
+ - name: Checkout code
28
+ if: ${{ steps.release.outputs.release_created }}
29
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
30
+
31
+ # These two steps are handed publishing credentials, so they are pinned
32
+ # to a commit rather than a branch. A floating ref would let whoever
33
+ # controls that branch run code with a token that can push this gem.
34
+ - name: Publish to GitHub Packages
35
+ if: ${{ steps.release.outputs.release_created }}
36
+ uses: actionshub/publish-gem-to-github@86eb0ce1ced1072298bf68776a32a5c9703ad9aa # v1.0.13
37
+ with:
38
+ token: ${{ secrets.GITHUB_TOKEN }}
39
+ owner: ${{ github.repository_owner }}
40
+
41
+ - name: Publish to RubyGems
42
+ if: ${{ steps.release.outputs.release_created }}
43
+ uses: actionshub/publish-gem-to-rubygems@f9126f7a2d36a4fd31a13e78fde5fbdcc4b7b251 # v2.0.6
44
+ with:
45
+ token: ${{ secrets.RUBYGEMS_API_KEY }}
data/.gitignore CHANGED
@@ -6,7 +6,6 @@
6
6
  Gemfile.lock
7
7
  InstalledFiles
8
8
  _yardoc
9
- coverage
10
9
  doc/
11
10
  lib/bundler/man
12
11
  pkg
@@ -0,0 +1,6 @@
1
+ ---
2
+ default: true
3
+ MD004: false
4
+ MD012: false
5
+ MD013: false
6
+ MD024: false
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.9.0"
3
+ }
data/.rubocop.yml ADDED
@@ -0,0 +1,9 @@
1
+ ---
2
+ require:
3
+ - cookstyle/chefstyle
4
+
5
+ AllCops:
6
+ TargetRubyVersion: 3.1
7
+ Exclude:
8
+ - "vendor/**/*"
9
+ - "spec/**/*"
data/.yamllint ADDED
@@ -0,0 +1,6 @@
1
+ ---
2
+ extends: default
3
+ rules:
4
+ line-length:
5
+ max: 256
6
+ level: warning
data/CHANGELOG.md CHANGED
@@ -1,3 +1,47 @@
1
+ ## [0.9.0](https://github.com/test-kitchen/busser/compare/v0.8.0...v0.9.0) (2026-08-28)
2
+
3
+ The first release since 2020. Busser now runs on current Ruby, which is the
4
+ main reason to take this version.
5
+
6
+ ### Breaking changes
7
+
8
+ * Ruby 3.2 or newer is now required ([#61](https://github.com/test-kitchen/busser/pull/61))
9
+
10
+ ### Bug fixes
11
+
12
+ * The CLI no longer crashes on startup on modern Ruby. thor 1.1 and newer are
13
+ required, because earlier versions reference `DidYouMean::SPELL_CHECKERS`,
14
+ which Ruby 3.1 removed ([#54](https://github.com/test-kitchen/busser/pull/54))
15
+ * `base64` is declared as a runtime dependency. It stopped being a default gem,
16
+ so `busser deserialize` failed to load on Ruby 3.4 and
17
+ newer ([#54](https://github.com/test-kitchen/busser/pull/54))
18
+ * A plugin installed at more than one version is no longer reported once per
19
+ version. `busser test` ran that plugin's suite repeatedly and
20
+ `busser plugin list` printed it repeatedly ([#64](https://github.com/test-kitchen/busser/pull/64))
21
+ * `busser deserialize` verifies the md5 digest before writing. It previously
22
+ checked afterwards, so a corrupted or truncated stream left the unverified
23
+ file on disk with its requested permissions, even though the command
24
+ failed ([#64](https://github.com/test-kitchen/busser/pull/64))
25
+
26
+ ### Maintenance
27
+
28
+ * Test suites run on Ruby 3.2 through 4.0 with minitest 6 and cucumber 11, and
29
+ the cucumber suite moved to aruba 2 ([#54](https://github.com/test-kitchen/busser/pull/54), [#60](https://github.com/test-kitchen/busser/pull/60), [#61](https://github.com/test-kitchen/busser/pull/61))
30
+ * CI runs on pushes to main, uses a least privilege token, and pins the shared
31
+ workflow to a release ([#59](https://github.com/test-kitchen/busser/pull/59))
32
+ * Releases are automated with release-please ([#62](https://github.com/test-kitchen/busser/pull/62))
33
+ * Rewritten README, and development documentation moved to
34
+ CONTRIBUTING.md ([#63](https://github.com/test-kitchen/busser/pull/63))
35
+
36
+ ## 0.8.0 / 2020-08-20
37
+
38
+ - Add http_proxy support to `busser plugin install`
39
+ - Use a SPDX compliant license string in the gemspec
40
+ - Remove the pin to bundler 1.x in the development gems
41
+ - Misc readme updates
42
+ - Add testing with Appveyor
43
+ - Pin the Aruba dev dep to prevent API churn
44
+
1
45
  ## 0.7.1 / 2015-04-20
2
46
 
3
47
  ### Bug fixes
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,103 @@
1
+ # Contributing to Busser
2
+
3
+ Thanks for taking the time to contribute. This document covers how to get the
4
+ project running locally, how to check your work before opening a pull request,
5
+ and the commit convention releases depend on.
6
+
7
+ ## Getting set up
8
+
9
+ Busser requires **Ruby 3.2 or newer**. Clone the repository and install the
10
+ development dependencies:
11
+
12
+ ```bash
13
+ git clone https://github.com/test-kitchen/busser.git
14
+ cd busser
15
+ bundle install
16
+ ```
17
+
18
+ Run the CLI from the working tree with `bundle exec busser`.
19
+
20
+ ## Running the tests
21
+
22
+ There are two suites, and `rake` runs both:
23
+
24
+ ```bash
25
+ bundle exec rake test # everything
26
+ bundle exec rake unit # minitest specs only
27
+ bundle exec rake features # cucumber features only
28
+ ```
29
+
30
+ **Unit specs** live in `spec/` and cover library code directly. They use
31
+ minitest's spec syntax with the `_()` expectation form:
32
+
33
+ ```ruby
34
+ _(suite_path.to_s).must_match %r{/suites$}
35
+ ```
36
+
37
+ The bare `suite_path.to_s.must_match` form was removed in minitest 6 and will
38
+ not work.
39
+
40
+ **Cucumber features** live in `features/` and drive the real `busser`
41
+ executable through [aruba](https://github.com/cucumber/aruba), so they cover
42
+ the CLI end to end. The step definitions are in `lib/busser/cucumber.rb`
43
+ because plugin authors reuse them.
44
+
45
+ Features that install plugins sandbox `GEM_HOME` into a temporary directory and
46
+ strip bundler out of the environment, so a test never installs a gem into your
47
+ bundle. If you add a step that shells out, be careful not to reintroduce
48
+ bundler variables: modern RubyGems re-requires `bundler/setup` whenever
49
+ `BUNDLER_SETUP` is present, which silently redirects `GEM_HOME` back at the
50
+ bundle.
51
+
52
+ ## Linting
53
+
54
+ CI runs three linters, all of which you can run locally:
55
+
56
+ ```bash
57
+ bundle exec cookstyle --chefstyle # Ruby
58
+ yamllint --strict . # YAML
59
+ markdownlint-cli2 "**/*.md" "!**/CHANGELOG*.md"
60
+ ```
61
+
62
+ ## Commit messages
63
+
64
+ This project uses [Conventional Commits](https://www.conventionalcommits.org).
65
+ Releases are automated, and the commit subject on `main` is what decides the
66
+ next version number and what appears in the changelog.
67
+
68
+ Pull requests are **squash merged, so the pull request title becomes that
69
+ subject**. A CI check enforces the format on the title; the individual commits
70
+ on your branch are not checked.
71
+
72
+ | Prefix | Effect on the next release |
73
+ | --- | --- |
74
+ | `fix:` | Patch version bump |
75
+ | `feat:` | Minor version bump |
76
+ | `feat!:`, or a `BREAKING CHANGE:` footer | Major version bump |
77
+ | `chore:`, `docs:`, `ci:`, `test:`, `refactor:` | No release |
78
+
79
+ For example:
80
+
81
+ ```text
82
+ fix: install plugins into GEM_HOME rather than the bundle
83
+ feat: add a --verbose flag to plugin install
84
+ ci: pin the shared workflow to a release
85
+ ```
86
+
87
+ ## Opening a pull request
88
+
89
+ 1. Fork the repository and create a branch for your change.
90
+ 2. Add or update tests. A bug fix should come with a test that fails without it.
91
+ 3. Run `bundle exec rake test` and the linters above.
92
+ 4. Open a pull request with a Conventional Commits title.
93
+
94
+ ## Releases
95
+
96
+ Releases are handled by
97
+ [release-please](https://github.com/googleapis/release-please). It watches
98
+ commits landing on `main` and keeps a release pull request open with the next
99
+ version number and the accumulated changelog. Merging that pull request tags
100
+ the release and publishes the gem to RubyGems and GitHub Packages.
101
+
102
+ Maintainers do not bump `lib/busser/version.rb` or edit `CHANGELOG.md` by
103
+ hand; release-please owns both files.
data/Gemfile CHANGED
@@ -1,9 +1,13 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
- gemspec
3
+ gemspec development_group: :test
4
+ group :cookstyle do
5
+ gem "cookstyle"
6
+ end
4
7
 
5
- group :guard do
6
- gem 'guard-minitest'
7
- gem 'guard-cucumber'
8
- gem 'guard-cane'
8
+ group :test do
9
+ gem "minitest", ">= 6.0"
10
+ gem "base64" # cucumber needs it; not a default gem on Ruby 4.0
11
+ gem "cucumber", ">= 11.1"
12
+ gem "rake"
9
13
  end
data/README.md CHANGED
@@ -1,37 +1,98 @@
1
1
  # Busser
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/busser.png)](http://badge.fury.io/rb/busser)
4
- [![Build Status](https://travis-ci.org/test-kitchen/busser.png?branch=master)](https://travis-ci.org/test-kitchen/busser)
5
- [![Code Climate](https://codeclimate.com/github/test-kitchen/busser.png)](https://codeclimate.com/github/test-kitchen/busser)
6
- [![Dependency Status](https://gemnasium.com/test-kitchen/busser.svg)](https://gemnasium.com/test-kitchen/busser)
3
+ [![Gem Version](https://badge.fury.io/rb/busser.svg)](http://badge.fury.io/rb/busser)
7
4
 
8
- Busser is a test setup and execution framework designed to
9
- work on remote nodes whose system dependencies cannot be relied upon, except
10
- for an Omnibus installation of Chef. It uses a plugin architecture to add
11
- support for different testing strategies such minitest, cucumber, bash, etc.
5
+ Busser runs your integration tests on the machine under test.
12
6
 
13
- ## Installation
7
+ It is built for remote nodes whose system dependencies cannot be relied upon,
8
+ so it assumes very little about where it lands. Test frameworks are added as
9
+ plugins, each a `busser-*` gem, which lets a single suite run bash scripts,
10
+ minitest specs, RSpec examples or anything else a plugin knows how to execute.
11
+
12
+ Busser is normally invoked for you by
13
+ [Test Kitchen](https://github.com/test-kitchen/test-kitchen), which installs it
14
+ on the instance under test and runs `busser test` as part of `kitchen verify`.
15
+ You can also drive it directly, which is what the rest of this document covers.
16
+
17
+ ## Status
14
18
 
15
- Add this line to your application's Gemfile:
19
+ This software project is no longer under active development as it has no active maintainers. The software may continue to work for some or all use cases, but issues filed in GitHub will most likely not be triaged. If a new maintainer is interested in working on this project please come chat with us in #test-kitchen on Chef Community Slack.
16
20
 
17
- gem 'busser'
21
+ ## Requirements
18
22
 
19
- And then execute:
23
+ Ruby 3.2 or newer.
20
24
 
21
- $ bundle
25
+ ## Installation
26
+
27
+ ```bash
28
+ gem install busser
29
+ ```
22
30
 
23
- Or install it yourself as:
31
+ Or add it to your `Gemfile`:
24
32
 
25
- $ gem install busser
33
+ ```ruby
34
+ gem "busser"
35
+ ```
26
36
 
27
37
  ## Usage
28
38
 
29
- TODO: Write usage instructions here
39
+ Busser is driven by the `busser` command. Run `busser help`, or
40
+ `busser help SUBCOMMAND`, for the full option list.
41
+
42
+ ### Setting up
43
+
44
+ Create the Busser home directory, where plugins and suites are installed:
45
+
46
+ ```bash
47
+ busser setup
48
+ ```
49
+
50
+ By default this is `/opt/busser`. Set `BUSSER_ROOT` to put it elsewhere.
51
+
52
+ ### Working with plugins
53
+
54
+ Each test framework is a separate `busser-*` gem:
55
+
56
+ ```bash
57
+ busser plugin install busser-bash # install a plugin
58
+ busser plugin install busser-bash@0.3.0 # install a specific version
59
+ busser plugin list # list installed plugins
60
+ busser plugin create junit # scaffold a new plugin
61
+ ```
62
+
63
+ ### Laying out tests
64
+
65
+ Each plugin picks up the tests belonging to it, from a directory named after
66
+ the plugin inside the suite:
67
+
68
+ ```text
69
+ test
70
+ `-- integration
71
+ `-- default # suite name
72
+ |-- bash # picked up by busser-bash
73
+ | `-- my_test.sh
74
+ `-- minitest # picked up by busser-minitest
75
+ `-- test_default.rb
76
+ ```
77
+
78
+ Use `busser suite path` to print where suites live, and `busser suite cleanup`
79
+ to remove them.
80
+
81
+ ### Running tests
82
+
83
+ Run every installed plugin's suites, or name specific plugins:
84
+
85
+ ```bash
86
+ busser test
87
+ busser test bash minitest
88
+ ```
30
89
 
31
90
  ## Contributing
32
91
 
33
- 1. Fork it
34
- 2. Create your feature branch (`git checkout -b my-new-feature`)
35
- 3. Commit your changes (`git commit -am 'Add some feature'`)
36
- 4. Push to the branch (`git push origin my-new-feature`)
37
- 5. Create new Pull Request
92
+ Bug reports and pull requests are welcome. See
93
+ [CONTRIBUTING.md](CONTRIBUTING.md) for how to set up the project, run the test
94
+ suites, and format your commits.
95
+
96
+ ## License
97
+
98
+ Apache License 2.0. See [LICENSE](LICENSE).
data/Rakefile CHANGED
@@ -1,35 +1,18 @@
1
1
  require "bundler/gem_tasks"
2
- require 'rake/testtask'
3
- require 'cucumber/rake/task'
4
- require 'cane/rake_task'
2
+ require "rake/testtask"
3
+ require "cucumber/rake/task"
5
4
 
6
5
  Rake::TestTask.new(:unit) do |t|
7
6
  t.libs.push "lib"
8
- t.test_files = FileList['spec/**/*_spec.rb']
7
+ t.test_files = FileList["spec/**/*_spec.rb"]
9
8
  t.verbose = true
10
9
  end
11
10
 
12
11
  Cucumber::Rake::Task.new(:features) do |t|
13
- t.cucumber_opts = ['features', '-x', '--format progress']
12
+ t.cucumber_opts = ["features", "-x", "--format progress", "--no-color", "-b"]
14
13
  end
15
14
 
16
15
  desc "Run all test suites"
17
- task :test => [:unit, :features]
16
+ task test: %i{unit features}
18
17
 
19
- desc "Run cane to check quality metrics"
20
- Cane::RakeTask.new do |cane|
21
- cane.canefile = './.cane'
22
- end
23
-
24
- desc "Display LOC stats"
25
- task :stats do
26
- puts "\n## Production Code Stats"
27
- sh "countloc -r lib"
28
- puts "\n## Test Code Stats"
29
- sh "countloc -r spec features"
30
- end
31
-
32
- desc "Run all quality tasks"
33
- task :quality => [:cane, :stats]
34
-
35
- task :default => [:test, :quality]
18
+ task default: [:test]
data/bin/busser CHANGED
@@ -1,8 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
- # -*- encoding: utf-8 -*-
3
-
4
2
  $:.unshift File.join(File.dirname(__FILE__), %w{.. lib})
5
- require 'rubygems'
6
- require 'busser/cli'
3
+ require "rubygems" unless defined?(Gem)
4
+ require "busser/cli"
7
5
 
8
6
  Busser::CLI.start
data/busser.gemspec CHANGED
@@ -1,7 +1,6 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
1
+ lib = File.expand_path("lib", __dir__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'busser/version'
3
+ require "busser/version"
5
4
 
6
5
  Gem::Specification.new do |spec|
7
6
  spec.name = "busser"
@@ -11,24 +10,22 @@ Gem::Specification.new do |spec|
11
10
  spec.description = %q{Busser - Runs tests for projects in Test Kitchen}
12
11
  spec.summary = spec.description
13
12
  spec.homepage = "https://github.com/test-kitchen/busser"
14
- spec.license = 'Apache 2.0'
13
+ spec.license = "Apache-2.0"
15
14
 
16
15
  spec.files = `git ls-files`.split($/)
17
16
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
17
  spec.require_paths = ["lib"]
20
18
 
21
- spec.required_ruby_version = ">= 1.9.1"
19
+ spec.required_ruby_version = ">= 3.2"
22
20
 
23
- spec.add_dependency 'thor', '<= 0.19.0'
21
+ # thor 1.1.0 references DidYouMean::SPELL_CHECKERS, removed in Ruby 3.1,
22
+ # so the CLI crashed on startup on every supported Ruby
23
+ spec.add_dependency "thor", ">= 1.1"
24
+ # base64 is no longer a default gem; deserialize needs it at runtime
25
+ spec.add_dependency "base64"
24
26
 
25
- spec.add_development_dependency 'aruba'
26
- spec.add_development_dependency "bundler", "~> 1.3"
27
- spec.add_development_dependency 'cane'
28
- spec.add_development_dependency 'countloc'
29
- spec.add_development_dependency 'fakefs'
30
- spec.add_development_dependency 'minitest'
31
- spec.add_development_dependency 'mocha'
27
+ spec.add_development_dependency "aruba", ">= 2.0"
28
+ spec.add_development_dependency "minitest"
29
+ spec.add_development_dependency "mocha"
32
30
  spec.add_development_dependency "rake"
33
- spec.add_development_dependency 'simplecov'
34
31
  end
@@ -16,4 +16,7 @@ Feature: Deserialize command
16
16
  Scenario: Mismatching MD5 sum fails command
17
17
  When I run `bash -c "cat ../../features/files/base64.txt | busser deserialize --destination=decoded.txt --md5sum=nope --perms=0755"`
18
18
  Then the output should contain "does not match source file"
19
- Then the exit status should not be 0
19
+ And the exit status should not be 0
20
+ # The digest was once checked only after the write, so the command failed
21
+ # while still leaving the unverified file on disk.
22
+ And the file "decoded.txt" should not exist
@@ -20,7 +20,7 @@ Feature: Plugin install command
20
20
  And the exit status should be 0
21
21
  And a gem named "busser-bash" is installed with version "0.1.0"
22
22
 
23
- Scenario: Installing a specfic newer version of an existing plugin
23
+ Scenario: Installing a specific newer version of an existing plugin
24
24
  When I successfully run `busser plugin install busser-bash@0.1.0`
25
25
  And I run `busser plugin install busser-bash@0.1.1`
26
26
  Then the output should contain "Plugin bash installed (version 0.1.1)"
@@ -1,18 +1,6 @@
1
- require 'aruba/cucumber'
2
- require 'busser/cucumber'
1
+ require "aruba/cucumber"
2
+ require "busser/cucumber"
3
3
 
4
- if ENV["COVERAGE"]
5
- require 'simplecov'
6
- SimpleCov.command_name "features"
7
- end
8
-
9
- Before do
10
- @aruba_timeout_seconds = 20
11
- end
12
-
13
- After do |s|
14
- # Tell Cucumber to quit after this scenario is done - if it failed.
15
- # This is useful to inspect the 'tmp/aruba' directory before any other
16
- # steps are executed and clear it out.
17
- Cucumber.wants_to_quit = true if s.failed?
4
+ Aruba.configure do |config|
5
+ config.exit_timeout = 20
18
6
  end
data/lib/busser/cli.rb CHANGED
@@ -1,4 +1,3 @@
1
- # -*- encoding: utf-8 -*-
2
1
  #
3
2
  # Author:: Fletcher Nichol (<fnichol@nichol.ca>)
4
3
  #
@@ -16,12 +15,12 @@
16
15
  # See the License for the specific language governing permissions and
17
16
  # limitations under the License.
18
17
 
19
- require 'busser/thor'
20
- require 'busser/command/deserialize'
21
- require 'busser/command/plugin'
22
- require 'busser/command/setup'
23
- require 'busser/command/suite'
24
- require 'busser/command/test'
18
+ require "busser/thor"
19
+ require "busser/command/deserialize"
20
+ require "busser/command/plugin"
21
+ require "busser/command/setup"
22
+ require "busser/command/suite"
23
+ require "busser/command/test"
25
24
 
26
25
  module Busser
27
26