Skip to content

Commit e6d30fd

Browse files
authored
Merge pull request #574 from chadlwilson/tests-without-bundler-hack
Correct running of integration tests
2 parents 9a6e555 + a938153 commit e6d30fd

101 files changed

Lines changed: 214 additions & 7717 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 2
7+
indent_style = space
8+
insert_final_newline = false
9+
max_line_length = 120
10+
tab_width = 2
11+
12+
[*.java]
13+
indent_size = 4
14+
tab_width = 4

.github/workflows/ci.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,11 @@ jobs:
2121
matrix:
2222
java-version: [8, 21]
2323
ruby-version: [jruby-9.4, jruby-10]
24-
bundler-version: [2.6.3, 2.7.1]
2524
task: ['', integration]
2625
exclude:
2726
# JRuby 10 requires Java 21 minimum
2827
- ruby-version: jruby-10
2928
java-version: 8
30-
# Bundler 2.7.1 requires Ruby 3.2
31-
- ruby-version: jruby-9.4
32-
bundler-version: 2.7.1
3329

3430
fail-fast: false
3531

@@ -44,7 +40,7 @@ jobs:
4440
- name: Set up java ${{ matrix.java-version }}
4541
uses: actions/setup-java@v3
4642
with:
47-
distribution: zulu
43+
distribution: temurin
4844
java-version: ${{ matrix.java-version }}
4945

5046
- name: Set up ${{ matrix.ruby-version }}
@@ -55,11 +51,8 @@ jobs:
5551
- name: Remove jruby-launcher # not sure where this is coming from but causes some specs to fail
5652
run: gem uninstall -a jruby-launcher
5753

58-
- name: Remove jruby-launcher # not sure where this is coming from but causes some specs to fail
59-
run: gem install bundler -v ${{ matrix.bundler-version }}
60-
6154
- name: Install dependencies
62-
run: bundle _${{ matrix.bundler-version }}_ install --jobs=3 --retry=3
55+
run: bundle install
6356

6457
- name: Run tests
65-
run: bundle _${{ matrix.bundler-version }}_ exec rake ${{ matrix.task }}
58+
run: bundle exec rake ${{ matrix.task }}

.gitignore

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,21 @@ coverage*
22
pkg
33
doc
44
.bundle
5+
vendor/
56
nbproject
6-
**/target/*
7-
!**/target/.keep
7+
target/
8+
out/
89
Gemfile.lock
910
.idea
1011
warbler.iml
1112
warbler.iws
1213
warbler.ipr
1314
warbler-*.gem
15+
.polyglot.Mavenfile
16+
pom.warbler.gemspec.xml
1417
log
1518
integration/**/*.iml
1619
build.log
1720
.ruby-version
1821
.rspec_status
19-
/integration/rails7_test/src/main/ruby/db/*.sqlite3*
22+
*.sqlite3-*

Mavenfile

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,35 @@ repository( :url => 'https://central.sonatype.com/repository/maven-snapshots/',
1616
snapshots 'true'
1717
end
1818

19-
properties( 'jruby.plugins.version' => '3.0.6',
20-
'jruby.version' => '9.4.13.0',
21-
'jetty.version' => '8.1.16.v20140903',
22-
'bundler.version' => '2.6.3')
19+
properties(
20+
'project.build.sourceEncoding' => 'UTF-8',
21+
'jruby.plugins.version' => '3.0.6',
22+
'jetty.version' => '9.4.58.v20250814',
23+
)
2324

2425
# dependencies needed for compilation
2526
scope :provided do
2627
jar 'org.jruby:jruby', '${jruby.version}'
2728
jar 'org.eclipse.jetty:jetty-webapp', '${jetty.version}'
2829
end
2930

30-
plugin :compiler, '3.1', :source => '8', :target => '8'
31+
plugin :compiler, '3.14.1', :release => '8'
32+
plugin :resources, '3.3.1'
33+
plugin :jar, '2.6'
34+
plugin :install, '3.1.4'
3135

3236
gem 'bundler', '${bundler.version}'
3337
gem 'jruby-jars', '${jruby.version}'
3438

35-
plugin :invoker, '1.8' do
39+
plugin :invoker, '3.9.1' do
3640
execute_goals( :install, :run,
3741
:id => 'integration-test',
3842
:properties => { 'warbler.version' => '${project.version}',
3943
'jruby.version' => '${jruby.version}',
4044
'jetty.version' => '${jetty.version}',
4145
'bundler.version' => '${bundler.version}',
42-
'jruby.plugins.version' => '${jruby.plugins.version}' },
46+
'jruby.plugins.version' => '${jruby.plugins.version}',
47+
'style.color' => 'always' },
4348

4449
:goals => ['verify'],
4550
:projectsDirectory => 'integration',

Rakefile

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,8 @@
66
# See the file LICENSE.txt for details.
77
#++
88

9-
begin
10-
require 'bundler'
11-
rescue LoadError
12-
warn "\nPlease `gem install bundler' and run `bundle install' to ensure you have all dependencies.\n\n"
13-
else
14-
require 'bundler/gem_helper'
15-
Bundler::GemHelper.install_tasks :dir => File.dirname(__FILE__)
16-
end
9+
require 'bundler/gem_helper'
10+
Bundler::GemHelper.install_tasks :dir => File.dirname(__FILE__)
1711

1812
require 'rake/clean'
1913
CLEAN << "pkg" << "doc" << Dir['integration/**/target']
@@ -31,10 +25,9 @@ mvn = Maven::Ruby::Maven.new
3125
mvn << "-Djruby.version=#{JRUBY_VERSION}"
3226
mvn << "-Dbundler.version=#{Bundler::VERSION}"
3327
mvn << '--no-transfer-progress'
28+
mvn << '--color=always'
3429

35-
if defined?(JRUBY_VERSION) && !JRUBY_VERSION.start_with?('9.0')
36-
mvn.inherit_jruby_version
37-
end
30+
mvn.inherit_jruby_version
3831

3932
desc 'compile java sources and build jar'
4033
task :jar do

integration/pom.xml

Lines changed: 72 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@
1010
<properties>
1111
<jruby.plugins.version>3.0.6</jruby.plugins.version>
1212
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13-
<jruby.version>${jruby.version}</jruby.version>
14-
<warbler.version>2.0.4</warbler.version>
15-
<bundler.version>${bundler.version}</bundler.version>
1613
<gem.home>${basedir}/../../pkg/rubygems</gem.home>
1714
<gem.path>${basedir}/../../pkg/rubygems</gem.path>
15+
16+
<!-- Default versions, overridden from parent when running tests acros env -->
17+
<warbler.version>2.0.5</warbler.version>
18+
<jruby.version>9.4.14.0</jruby.version>
19+
<bundler.version>2.6.3</bundler.version>
20+
<jetty.version>9.4.58.v20250814</jetty.version>
1821
</properties>
1922

2023
<repositories>
@@ -44,15 +47,15 @@
4447
<type>gem</type>
4548
</dependency>
4649
<dependency>
47-
<groupId>junit</groupId>
48-
<artifactId>junit</artifactId>
49-
<version>4.13.1</version>
50+
<groupId>org.junit.jupiter</groupId>
51+
<artifactId>junit-jupiter</artifactId>
52+
<version>5.14.0</version>
5053
<scope>test</scope>
5154
</dependency>
5255
<dependency>
5356
<groupId>org.hamcrest</groupId>
54-
<artifactId>hamcrest-all</artifactId>
55-
<version>1.3</version>
57+
<artifactId>hamcrest</artifactId>
58+
<version>3.0</version>
5659
<scope>test</scope>
5760
</dependency>
5861
</dependencies>
@@ -72,10 +75,57 @@
7275
</resource>
7376
</resources>
7477
<plugins>
78+
<plugin>
79+
<groupId>org.apache.maven.plugins</groupId>
80+
<artifactId>maven-clean-plugin</artifactId>
81+
<version>3.5.0</version>
82+
</plugin>
83+
<plugin>
84+
<groupId>org.apache.maven.plugins</groupId>
85+
<artifactId>maven-enforcer-plugin</artifactId>
86+
<version>3.6.2</version>
87+
<executions>
88+
<execution>
89+
<id>enforce-maven</id>
90+
<goals>
91+
<goal>enforce</goal>
92+
</goals>
93+
<configuration>
94+
<rules>
95+
<requireMavenVersion>
96+
<version>3.6.3</version>
97+
</requireMavenVersion>
98+
</rules>
99+
</configuration>
100+
</execution>
101+
</executions>
102+
</plugin>
103+
<plugin>
104+
<groupId>org.apache.maven.plugins</groupId>
105+
<artifactId>maven-compiler-plugin</artifactId>
106+
<version>3.14.1</version>
107+
<configuration>
108+
<release>8</release>
109+
</configuration>
110+
</plugin>
111+
<plugin>
112+
<groupId>org.apache.maven.plugins</groupId>
113+
<artifactId>maven-jar-plugin</artifactId>
114+
<version>3.4.2</version>
115+
<executions>
116+
<execution>
117+
<id>default-jar</id>
118+
<phase>none</phase>
119+
</execution>
120+
</executions>
121+
</plugin>
75122
<plugin>
76123
<groupId>org.apache.maven.plugins</groupId>
77124
<artifactId>maven-failsafe-plugin</artifactId>
78-
<version>2.9</version>
125+
<version>3.5.4</version>
126+
<configuration>
127+
<failIfNoTests>true</failIfNoTests>
128+
</configuration>
79129
<executions>
80130
<execution>
81131
<goals>
@@ -99,41 +149,26 @@
99149
<pluginManagement>
100150
<plugins>
101151
<plugin>
102-
<groupId>org.apache.maven.plugins</groupId>
103-
<artifactId>maven-compiler-plugin</artifactId>
104-
<configuration>
105-
<source>8</source>
106-
<target>8</target>
107-
</configuration>
108-
</plugin>
109-
<plugin>
110-
<groupId>org.mortbay.jetty</groupId>
152+
<groupId>org.eclipse.jetty</groupId>
111153
<artifactId>jetty-maven-plugin</artifactId>
112154
<version>${jetty.version}</version>
113155
<configuration>
114156
<webAppConfig>
115157
<contextPath>/</contextPath>
116-
<configurationClasses>
117-
<configurationClass>org.eclipse.jetty.webapp.WebXmlConfiguration</configurationClass>
118-
<configurationClass>org.eclipse.jetty.webapp.WebInfConfiguration</configurationClass>
119-
<configurationClass>org.eclipse.jetty.webapp.TagLibConfiguration</configurationClass>
120-
<configurationClass>org.eclipse.jetty.webapp.MetaInfConfiguration</configurationClass>
121-
<configurationClass>org.eclipse.jetty.webapp.FragmentConfiguration</configurationClass>
122-
<configurationClass>org.eclipse.jetty.webapp.JettyWebXmlConfiguration</configurationClass>
123-
<!-- intentionally no AnnotationConfiguration -->
124-
</configurationClasses>
125158
</webAppConfig>
126159
<stopPort>9966</stopPort>
127160
<stopKey>warbler_stop</stopKey>
128161
<scanIntervalSeconds>0</scanIntervalSeconds>
129162
<daemon>true</daemon>
163+
<supportedPackagings>jar</supportedPackagings>
130164
</configuration>
131165
<executions>
132166
<execution>
133167
<id>start-jetty</id>
134168
<phase>pre-integration-test</phase>
135169
<goals>
136-
<goal>run-war</goal>
170+
<!-- Change to run-war to interactively play with the server without running tests -->
171+
<goal>deploy-war</goal>
137172
</goals>
138173
</execution>
139174
<execution>
@@ -148,7 +183,7 @@
148183
<plugin>
149184
<groupId>org.codehaus.mojo</groupId>
150185
<artifactId>exec-maven-plugin</artifactId>
151-
<version>1.2.1</version>
186+
<version>3.6.1</version>
152187
</plugin>
153188
<plugin>
154189
<groupId>org.jruby.maven</groupId>
@@ -175,6 +210,14 @@
175210
</execution>
176211
</executions>
177212
</plugin>
213+
<plugin>
214+
<groupId>org.codehaus.mojo</groupId>
215+
<artifactId>versions-maven-plugin</artifactId>
216+
<version>2.19.1</version>
217+
<configuration>
218+
<ignoredVersions>.*-(alpha|beta|M)[-0-9]+</ignoredVersions>
219+
</configuration>
220+
</plugin>
178221
</plugins>
179222
</pluginManagement>
180223
</build>

integration/rails7_test/pom.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
</parent>
1010

1111
<artifactId>rails7_test</artifactId>
12-
<packaging>pom</packaging>
13-
1412
<name>rails7_test</name>
1513

1614
<build>
@@ -30,7 +28,7 @@
3028
</executions>
3129
</plugin>
3230
<plugin>
33-
<groupId>org.mortbay.jetty</groupId>
31+
<groupId>org.eclipse.jetty</groupId>
3432
<artifactId>jetty-maven-plugin</artifactId>
3533
<executions>
3634
<execution>
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
source 'https://rubygems.org'
22

3-
gem 'rails', '7.1.5.1'
4-
5-
gem 'puma'
3+
gem 'rails', '~> 7.1.0'
4+
gem 'rack', '~> 2.2.19'
65

76
gem 'activerecord-jdbcsqlite3-adapter', '~> 71.0'
8-
9-
gem 'jbuilder'

integration/rails7_test/src/main/ruby/config/environments/development.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
# Enable server timing
1818
config.server_timing = true
1919

20+
# Workaround https://github.com/jruby/jruby-rack/issues/329
21+
config.logger = ActiveSupport::Logger.new(STDOUT)
22+
2023
# Enable/disable caching. By default caching is disabled.
2124
# Run rails dev:cache to toggle caching.
2225
if Rails.root.join("tmp/caching-dev.txt").exist?
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
Warbler::Config.new do |config|
22
config.autodeploy_dir = "../../../target"
33
config.jar_name = "rails7_test-1.0"
4+
5+
config.webxml.rails.env = 'development'
46
end

0 commit comments

Comments
 (0)