From 4cdccc677113aa5bf918bb330b2245f0bb75c91d Mon Sep 17 00:00:00 2001 From: Brian Cunnie Date: Sat, 26 Jul 2025 14:00:59 -0700 Subject: [PATCH] Run rspec tests locally, easily We test our four production nameservers using `rspec`, and although that worked fine when we used GitHub actions with a curated Ruby, it didn't always work as well when running locally. With this commit we introduce a Gemfile which has the necessary Ruby dependencies, which make it easer to run the tests locally. --- Gemfile | 6 +++++ Gemfile.lock | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 3 ++- 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 Gemfile create mode 100644 Gemfile.lock diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..2e648d4 --- /dev/null +++ b/Gemfile @@ -0,0 +1,6 @@ +source 'https://rubygems.org' + +ruby '3.4.2' + +gem 'rspec' +gem 'rubocop' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..1344d7d --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,63 @@ +GEM + remote: https://rubygems.org/ + specs: + ast (2.4.3) + diff-lcs (1.6.2) + json (2.13.1) + language_server-protocol (3.17.0.5) + lint_roller (1.1.0) + parallel (1.27.0) + parser (3.3.8.0) + ast (~> 2.4.1) + racc + prism (1.4.0) + racc (1.8.1) + rainbow (3.1.1) + regexp_parser (2.10.0) + rspec (3.13.1) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.5) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.5) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.5) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-support (3.13.4) + rubocop (1.79.0) + json (~> 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.46.0, < 2.0) + ruby-progressbar (~> 1.7) + tsort (>= 0.2.0) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.46.0) + parser (>= 3.3.7.2) + prism (~> 1.4) + ruby-progressbar (1.13.0) + tsort (0.2.0) + unicode-display_width (3.1.4) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) + +PLATFORMS + arm64-darwin-24 + ruby + +DEPENDENCIES + rspec + rubocop + +RUBY VERSION + ruby 3.4.2p28 + +BUNDLED WITH + 2.6.6 diff --git a/README.md b/README.md index cdf55b7..1aee05f 100644 --- a/README.md +++ b/README.md @@ -157,7 +157,8 @@ as ARM64 (AWS Graviton, Apple M1/M2). - `spec/` contains the tests for the production nameservers. To run the tests locally: ```bash - DOMAINS=nip.io,sslip.io rspec --format documentation --color spec + bundle + DOMAINS=nip.io,sslip.io bundle exec rspec --format documentation --color spec ``` - `k8s/document_root_sslip.io/` contains the HTML content of the sslip.io website.