Skip to content

Commit c07b77a

Browse files
omarqureshiclaude
andcommitted
fix(ruby): always regenerate runtime-test fixtures before rspec
The `test` script guarded regeneration with `test -d ./lib || generate.sh`, so it only rebuilt the generated bindings when lib/ was absent. lib/ is gitignored generated output; when it was present but stale — built by an older pacmak/rosetta — the specs silently ran against months-old bindings and reported phantom failures (17, in a suite that is actually green). Drop the guard so `yarn test` regenerates unconditionally. generate.sh is only a few seconds and already `rm -rf lib` first, so this is cheap and eliminates the stale-fixture failure mode. A comment in generate.sh warns against reinstating the guard. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 208c432 commit c07b77a

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

packages/@jsii/ruby-runtime-test/generate.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#!/usr/bin/env bash
22
# Generate the Ruby bindings for the jsii-calc fixture assemblies into ./lib,
33
# where spec/spec_helper.rb expects to find them. Invoked by `yarn build`.
4+
#
5+
# `yarn test` runs this every time, unconditionally — do NOT reintroduce a
6+
# `test -d ./lib || ...` guard. lib/ is gitignored generated output; when it is
7+
# present but stale (built by an older pacmak/rosetta) such a guard silently
8+
# runs the specs against months-old bindings and reports phantom failures. This
9+
# script is only a few seconds, so always regenerating is the safe default.
410
set -euo pipefail
511

612
genRoot="./lib"

packages/@jsii/ruby-runtime-test/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
"scripts": {
2424
"build": "bash ./generate.sh",
25-
"test": "bash -c '{ test -d ./lib || bash ./generate.sh; } && bundle install --quiet && bundle exec rspec --require ./spec/compliance_formatter.rb --format ComplianceFormatter --format progress'"
25+
"test": "bash -c 'bash ./generate.sh && bundle install --quiet && bundle exec rspec --require ./spec/compliance_formatter.rb --format ComplianceFormatter --format progress'"
2626
},
2727
"devDependencies": {
2828
"@jsii/ruby-runtime": "^0.0.0",

0 commit comments

Comments
 (0)