Skip to content

Commit b46ece7

Browse files
committed
Add Conductor workspace support with local test configuration
- Add rails_helper.local.rb pattern for environment-specific settings - Create example template for Conductor SSL workarounds - Update .gitignore to exclude local config files - Add CONDUCTOR_SETUP.md with comprehensive setup guide This allows developers to easily configure SSL verification bypass and other Conductor-specific settings without committing them to git. The pattern is reusable for any environment-specific test configuration.
1 parent f5e244f commit b46ece7

File tree

4 files changed

+197
-0
lines changed

4 files changed

+197
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,6 @@ ssr-generated
8080
# Playwright test artifacts (from cypress-on-rails gem)
8181
/spec/dummy/e2e/playwright-report/
8282
/spec/dummy/test-results/
83+
84+
# Local test configuration (Conductor workspaces, etc.)
85+
/spec/dummy/spec/rails_helper.local.rb

CONDUCTOR_SETUP.md

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
# Conductor Workspace Setup Guide
2+
3+
This guide helps you set up and run tests in a Conductor workspace for the React on Rails project.
4+
5+
## Quick Start
6+
7+
1. **Install dependencies:**
8+
9+
```bash
10+
bundle install
11+
cd spec/dummy
12+
bundle install
13+
yarn install
14+
cd ../..
15+
```
16+
17+
2. **Set up local test configuration (for SSL issues):**
18+
19+
```bash
20+
cd spec/dummy/spec
21+
cp rails_helper.local.rb.example rails_helper.local.rb
22+
# Edit rails_helper.local.rb and uncomment the Conductor configuration
23+
```
24+
25+
3. **Run tests:**
26+
27+
```bash
28+
cd spec/dummy
29+
bundle exec rspec './spec/system/integration_spec.rb:312'
30+
```
31+
32+
## Common Issues
33+
34+
### SSL Certificate Verification Errors
35+
36+
**Symptom:**
37+
38+
```
39+
OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=error:
40+
certificate verify failed (unable to get certificate CRL)
41+
```
42+
43+
**Solution:**
44+
45+
Create `spec/dummy/spec/rails_helper.local.rb` with the following content:
46+
47+
```ruby
48+
# frozen_string_literal: true
49+
50+
# Conductor workspace configuration
51+
require "webdrivers"
52+
Webdrivers.cache_time = 86_400 * 365 # Disable auto-updates
53+
54+
require "openssl"
55+
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
56+
```
57+
58+
**Note:** This file is gitignored and won't be committed. It's safe to use in isolated Conductor workspaces.
59+
60+
### Capybara/Rack Compatibility Issues
61+
62+
**Symptom:**
63+
64+
```
65+
NameError: uninitialized constant Rack::Handler
66+
```
67+
68+
**Solution:**
69+
This was fixed by upgrading Capybara to 3.40.0. Run `bundle update capybara` in `spec/dummy/`.
70+
71+
## Environment Details
72+
73+
### What's Different in Conductor Workspaces?
74+
75+
- Each workspace is an isolated clone of the repository
76+
- SSL certificate verification may fail due to sandbox restrictions
77+
- Network access may be throttled or restricted
78+
- Some system-level operations may behave differently
79+
80+
### Local Configuration Pattern
81+
82+
The project uses a local configuration pattern for environment-specific settings:
83+
84+
- `rails_helper.rb` - Main configuration (committed to git)
85+
- `rails_helper.local.rb` - Local overrides (gitignored)
86+
- `rails_helper.local.rb.example` - Template for local config (committed)
87+
88+
This allows developers to customize their test environment without affecting others.
89+
90+
## Running Different Test Suites
91+
92+
```bash
93+
# Single test
94+
bundle exec rspec './spec/system/integration_spec.rb:312'
95+
96+
# All system tests
97+
bundle exec rspec spec/system/
98+
99+
# All specs in spec/dummy
100+
bundle exec rspec
101+
102+
# With documentation format
103+
bundle exec rspec --format documentation
104+
```
105+
106+
## Debugging Tests
107+
108+
### View Browser Actions
109+
110+
Tests run headless by default. To see the browser:
111+
112+
1. Edit `spec/dummy/spec/support/capybara_setup.rb`
113+
2. Change `selenium_chrome_headless` to `selenium_chrome`
114+
115+
### Screenshots on Failure
116+
117+
Failed tests automatically save screenshots to:
118+
119+
```
120+
spec/dummy/tmp/capybara/failures_*.png
121+
```
122+
123+
### Console Logging
124+
125+
JavaScript errors and console output are captured in test failures.
126+
127+
## Additional Resources
128+
129+
- [Main React on Rails README](../../README.md)
130+
- [Testing Documentation](../../docs/basics/testing.md)
131+
- [Conductor Documentation](https://conductor.build)
132+
133+
## Troubleshooting
134+
135+
### Tests Timing Out
136+
137+
Increase timeout in `spec/dummy/spec/support/capybara_setup.rb`:
138+
139+
```ruby
140+
Capybara.default_max_wait_time = 10 # seconds
141+
```
142+
143+
### Webdriver Version Mismatches
144+
145+
Update chromedriver:
146+
147+
```bash
148+
# Let webdrivers download the latest
149+
rm -rf ~/.webdrivers
150+
```
151+
152+
### Port Conflicts
153+
154+
If port 5017 is in use, kill the process:
155+
156+
```bash
157+
lsof -ti:5017 | xargs kill -9
158+
```
159+
160+
## Getting Help
161+
162+
- **GitHub Issues**: [react_on_rails/issues](https://github.com/shakacode/react_on_rails/issues)
163+
- **Conductor Support**: [[email protected]](mailto:[email protected])
164+
- **Community Forum**: [forum.shakacode.com](https://forum.shakacode.com)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# frozen_string_literal: true
2+
3+
# Example local test configuration file
4+
# Copy this to rails_helper.local.rb to enable environment-specific settings
5+
# The .local.rb file is gitignored and won't be committed
6+
7+
# ==============================================================================
8+
# Conductor Workspace Configuration
9+
# ==============================================================================
10+
# If you're using Conductor workspaces and experiencing SSL certificate issues
11+
# with webdrivers, uncomment the following lines:
12+
13+
# require "webdrivers"
14+
# Webdrivers.cache_time = 86_400 * 365 # Cache for 1 year (disable auto-updates)
15+
#
16+
# require "openssl"
17+
# OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
18+
#
19+
# WARNING: Disabling SSL verification is a security risk.
20+
# Only use this in isolated test environments like Conductor workspaces.
21+
22+
# ==============================================================================
23+
# Other Environment-Specific Settings
24+
# ==============================================================================
25+
# Add your own environment-specific test configuration here

spec/dummy/spec/rails_helper.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
require "capybara/rails"
1616
require "capybara-screenshot/rspec"
1717

18+
# Load local test configuration if it exists (for Conductor workspaces, etc.)
19+
# This file is gitignored and can contain environment-specific workarounds
20+
local_config = File.expand_path("rails_helper.local.rb", __dir__)
21+
require local_config if File.exist?(local_config)
22+
1823
# Add additional requires below this line. Rails is not loaded until this point!
1924

2025
# Requires supporting ruby files with custom matchers and macros, etc, in

0 commit comments

Comments
 (0)