Skip to content

Commit 6a11461

Browse files
Merge branch 'master' into justin808/fix-shared-store-tests
2 parents e4bc3e2 + 2d94bc4 commit 6a11461

File tree

14 files changed

+475
-77
lines changed

14 files changed

+475
-77
lines changed

SWITCHING_CI_CONFIGS.md

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,24 +53,53 @@ The project runs tests against two configurations:
5353

5454
## Prerequisites
5555

56-
You must have a version manager like [mise](https://mise.jdx.dev/) (recommended) or [asdf](https://asdf-vm.com/) installed to manage Ruby and Node versions.
56+
You must have a version manager installed to manage Ruby and Node versions. The script supports:
57+
58+
- **[mise](https://mise.jdx.dev/)** - Recommended, modern, manages both Ruby and Node
59+
- **[asdf](https://asdf-vm.com/)** - Legacy option, manages both Ruby and Node
60+
- **[rvm](https://rvm.io/) + [nvm](https://github.com/nvm-sh/nvm)** - Separate managers for Ruby and Node
61+
62+
### Option 1: mise (Recommended)
5763

5864
```bash
59-
# Install mise (recommended, modern alternative to asdf)
65+
# Install mise
6066
brew install mise
6167
echo 'eval "$(mise activate zsh)"' >> ~/.zshrc
6268
source ~/.zshrc
6369

64-
# OR install asdf (legacy option)
70+
# mise automatically reads from .tool-versions
71+
```
72+
73+
### Option 2: asdf
74+
75+
```bash
76+
# Install asdf
6577
brew install asdf
6678
echo -e "\n. $(brew --prefix asdf)/libexec/asdf.sh" >> ~/.zshrc
6779
source ~/.zshrc
6880

69-
# Install plugins (only needed for asdf, mise reads from mise.toml)
81+
# Install plugins
7082
asdf plugin add ruby
7183
asdf plugin add nodejs
7284
```
7385

86+
### Option 3: rvm + nvm
87+
88+
```bash
89+
# Install rvm for Ruby
90+
\curl -sSL https://get.rvm.io | bash -s stable
91+
source ~/.rvm/scripts/rvm
92+
93+
# Install nvm for Node
94+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
95+
# Add to shell config (the installer usually does this automatically)
96+
```
97+
98+
**Important Notes:**
99+
100+
- If you only have rvm (no nvm) or only nvm (no rvm), the script will detect this and provide helpful error messages guiding you to install the missing manager or switch to mise/asdf.
101+
- **Do not mix version managers** (e.g., don't install both mise and rvm). The script prioritizes mise > asdf > rvm+nvm, so mise/asdf will always take precedence. Using multiple managers can cause confusion about which versions are active.
102+
74103
## Detailed Usage
75104

76105
### 1. Check Current Configuration
@@ -107,7 +136,9 @@ This will:
107136
```bash
108137
# Reload your shell to pick up new Ruby/Node versions
109138
cd <project-root>
110-
mise current # or: asdf current
139+
mise current # For mise users
140+
# asdf current # For asdf users
141+
# rvm current && nvm current # For rvm+nvm users
111142

112143
# Build and test
113144
rake node_package
@@ -137,7 +168,9 @@ This will:
137168
```bash
138169
# Reload your shell to pick up new Ruby/Node versions
139170
cd <project-root>
140-
mise current # or: asdf current
171+
mise current # For mise users
172+
# asdf current # For asdf users
173+
# rvm current && nvm current # For rvm+nvm users
141174

142175
# Build and test
143176
rake node_package
@@ -243,6 +276,22 @@ asdf reshim ruby
243276
asdf reshim nodejs
244277
```
245278

279+
**For rvm + nvm:**
280+
281+
```bash
282+
# Install and use specific Ruby version
283+
rvm install 3.2.8 # or 3.4.3
284+
rvm use 3.2.8
285+
286+
# Install and use specific Node version
287+
nvm install 20.18.1 # or 22.12.0
288+
nvm use 20.18.1
289+
290+
# Verify versions
291+
ruby --version
292+
node --version
293+
```
294+
246295
### Yarn install fails
247296

248297
If you get package resolution errors:

bin/ci-run-failed-specs

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,15 @@ else
105105
if [[ "$line" =~ rspec[[:space:]]+(\./spec/[^[:space:]]+) ]]; then
106106
spec="${BASH_REMATCH[1]}"
107107
SPECS+=("$spec")
108+
# Also handle bare spec paths like "spec/foo.rb[1:2:3]" or "./spec/foo.rb[1:2:3]"
109+
# Strip trailing % and whitespace
110+
elif [[ "$line" =~ (\.?/?spec/[^[:space:]%]+) ]]; then
111+
spec="${BASH_REMATCH[1]}"
112+
# Normalize to ./spec/ format
113+
if [[ ! "$spec" =~ ^\. ]]; then
114+
spec="./$spec"
115+
fi
116+
SPECS+=("$spec")
108117
fi
109118
done
110119
fi
@@ -153,9 +162,24 @@ echo ""
153162

154163
# Confirm (read from /dev/tty to handle piped input)
155164
if [ -t 0 ]; then
165+
# stdin is a TTY, read directly
156166
read -p "Run these specs now? [Y/n] " -n 1 -r REPLY
157167
else
158-
read -p "Run these specs now? [Y/n] " -n 1 -r REPLY < /dev/tty
168+
# stdin is not a TTY (piped input), try /dev/tty
169+
# Check if we can actually open /dev/tty by attempting to use it in a subshell
170+
set +e # Temporarily disable errexit for the check
171+
(exec 0</dev/tty) 2>/dev/null
172+
TTY_CHECK=$?
173+
set -e # Re-enable errexit
174+
175+
if [ $TTY_CHECK -eq 0 ]; then
176+
# Successfully opened /dev/tty, use it for confirmation
177+
read -p "Run these specs now? [Y/n] " -n 1 -r REPLY < /dev/tty
178+
else
179+
# Cannot open /dev/tty, auto-confirm
180+
echo "Run these specs now? [Y/n] Y (auto-confirmed, TTY unavailable)"
181+
REPLY="Y"
182+
fi
159183
fi
160184
echo
161185
if [[ ! "${REPLY}" =~ ^[Yy]$ ]] && [[ ! -z "${REPLY}" ]]; then

0 commit comments

Comments
 (0)