Skip to content

Commit 619bf31

Browse files
justin808claude
andcommitted
Address edge cases in validation and error handling
.gitignore validation improvements: - Check multiple unique markers (Lefthook, Testing, Playwright) - Prevents false positives from partial content matches - More robust detection of duplicate entries Port polling improvements: - Fail fast in CI environments when port unavailable - Prevents flaky tests from port conflicts in CI - Local development continues with warning - CI_ENV detection makes behavior environment-aware These changes improve reliability in CI while maintaining flexibility for local development. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 5c00641 commit 619bf31

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

packages/shakacode_demo_common/lib/generators/shakacode_demo_common/install/install_generator.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,14 @@ def display_post_install
170170
private
171171

172172
def gitignore_contains_our_content?
173-
File.exist?('.gitignore') && File.read('.gitignore').include?('# Lefthook')
173+
return false unless File.exist?('.gitignore')
174+
175+
content = File.read('.gitignore')
176+
# Check for multiple unique markers to ensure our full content is present
177+
# This prevents false positives if only partial content exists
178+
content.include?('# Lefthook') &&
179+
content.include?('# Testing') &&
180+
content.include?('# Playwright')
174181
end
175182

176183
def gem_root_path

packages/shakacode_demo_common/lib/shakacode_demo_common/e2e_test_runner.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,12 @@ def run_playwright_tests(env)
7979

8080
def cleanup_between_modes
8181
puts 'Waiting for server to release port...'
82-
port_available? || puts('Warning: Continuing despite port possibly being in use')
82+
return if port_available?
83+
84+
# Port is still in use after timeout - fail fast in CI to prevent flaky tests
85+
raise 'Port still in use after timeout. Failing to prevent flaky tests in CI.' if ENV['CI']
86+
87+
puts 'Warning: Continuing despite port possibly being in use'
8388
end
8489

8590
# Checks if port becomes available within timeout period

0 commit comments

Comments
 (0)