Skip to content

Commit bf175c0

Browse files
committed
chore: drop cucumber on WIndows
Signed-off-by: Joseph Kato <joseph@jdkato.io>
1 parent 3a59a17 commit bf175c0

5 files changed

Lines changed: 19 additions & 62 deletions

File tree

.github/workflows/test.yml

Lines changed: 8 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ jobs:
7575
shell: bash # use the runner's Git bash for all steps
7676
env:
7777
CGO_ENABLED: "1" # required for the tree-sitter parsers
78-
BUNDLE_GEMFILE: ${{ github.workspace }}/testdata/Gemfile
7978
steps:
8079
- uses: actions/checkout@v5
8180
with:
@@ -85,44 +84,14 @@ jobs:
8584
with:
8685
go-version: "1.25.7"
8786

88-
- uses: ruby/setup-ruby@v1
89-
with:
90-
ruby-version: "3.3"
91-
92-
- uses: actions/setup-node@v4
93-
with:
94-
node-version: "20"
95-
96-
- uses: actions/setup-python@v5
97-
with:
98-
python-version: "3.x"
99-
100-
- uses: actions/setup-java@v4
101-
with:
102-
distribution: temurin
103-
java-version: "17"
104-
105-
- name: Install documentation toolchain
106-
run: |
107-
choco install --no-progress -y xsltproc
108-
# Git ships a non-functional xsltproc; drop it so the choco one wins.
109-
rm -f "/c/Program Files/Git/usr/bin/xsltproc.exe" || true
110-
python -m pip install --upgrade docutils sphinx # rst2html
111-
gem install asciidoctor
112-
npm install -g mdx2vast
113-
curl -fsSL -o dita-ot-3.6.zip \
114-
https://github.com/dita-ot/dita-ot/releases/download/3.6/dita-ot-3.6.zip
115-
unzip -q dita-ot-3.6.zip
116-
echo "$PWD/dita-ot-3.6/bin" >> "$GITHUB_PATH"
117-
118-
- name: Setup (bundle install)
119-
run: cd testdata && bundle install
120-
12187
- name: Build
12288
run: go build -o bin/vale.exe ./cmd/vale
12389

124-
- name: Test
125-
run: |
126-
export PATH="$PWD/bin:$PATH"
127-
go test ./internal/core ./internal/lint ./internal/check ./internal/nlp ./internal/glob ./cmd/vale
128-
cd testdata && cucumber --format progress
90+
# NOTE: The Cucumber suite runs on Linux only. Its aruba -> childprocess ->
91+
# ffi stack can't spawn processes on modern Windows + Ruby 3.x (every step
92+
# fails with `ChildProcess::Error: Unknown error`); AppVeyor only managed
93+
# it on the now-unavailable Ruby 2.4. Windows still covers the build
94+
# (including CGO/tree-sitter) and the Go unit tests -- which is where the
95+
# Windows-specific behavior (path handling, etc.) actually lives.
96+
- name: Test (Go)
97+
run: go test ./internal/core ./internal/lint ./internal/check ./internal/nlp ./internal/glob ./cmd/vale

internal/system/path_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,19 @@ package system
22

33
import (
44
"path/filepath"
5+
"runtime"
56
"testing"
67
)
78

89
func TestDeterminePath(t *testing.T) {
10+
// These cases use Windows-style paths (drive letters, backslash
11+
// separators), and DeterminePath joins with the OS-native separator. They
12+
// only resolve correctly on Windows -- elsewhere `\` isn't a separator, so
13+
// skip rather than fail.
14+
if runtime.GOOS != "windows" {
15+
t.Skip("Windows-only path semantics")
16+
}
17+
918
tests := []struct {
1019
configPath string
1120
keyPath string

testdata/Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@ source 'https://rubygems.org'
22

33
gem 'specific_install', '~> 0.3.8'
44
gem 'cucumber', '~> 6.1.0'
5-
gem 'os', '~> 0.9.6'
65

76
gem "aruba", "~> 1.1.0"

testdata/Gemfile.lock

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ GEM
7474
mime-types-data (3.2024.1203)
7575
minitest (5.25.4)
7676
multi_test (0.1.2)
77-
os (0.9.6)
7877
protobuf-cucumber (3.10.8)
7978
activesupport (>= 3.2)
8079
middleware
@@ -100,7 +99,6 @@ PLATFORMS
10099
DEPENDENCIES
101100
aruba (~> 1.1.0)
102101
cucumber (~> 6.1.0)
103-
os (~> 0.9.6)
104102
specific_install (~> 0.3.8)
105103

106104
BUNDLED WITH

testdata/features/steps.rb

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
1-
require 'os'
2-
31
exe = 'vale'
4-
if OS.windows?
5-
exe += '.exe'
6-
end
72
cmd = (exe + ' --output=line --sort --normalize --relative --no-global')
83

9-
Given(/^on Unix$/) do
10-
pending unless OS.posix?
11-
end
12-
134
When(/^I run command "(.*)"$/) do |c|
145
step %(I cd to "../../fixtures/formats")
156
step %(I run `#{cmd} #{c}`)
@@ -166,19 +157,10 @@
166157

167158
When(/^I run cat "([^\s]+)" "([^\s]+)"$/) do |file, ext|
168159
step %(I cd to "../../fixtures/formats")
169-
if OS.windows?
170-
step %(I run `PowerShell -Command Get-Content #{file} | #{cmd} --ext='#{ext}'`)
171-
else
172-
step %(I run `bash -c 'cat #{file} | #{cmd} --ext="#{ext}"'`)
173-
end
160+
step %(I run `bash -c 'cat #{file} | #{cmd} --ext="#{ext}"'`)
174161
end
175162

176163
When(/^I lint string "(.*)"$/) do |string|
177164
step %(I cd to "../../fixtures/formats")
178-
if OS.windows?
179-
# FIXME: How do we pass a string with spaces on AppVeyor?
180-
step %(I run `#{cmd} "#{string}"`)
181-
else
182-
step %(I run `#{cmd} '#{string}'`)
183-
end
165+
step %(I run `#{cmd} '#{string}'`)
184166
end

0 commit comments

Comments
 (0)