Skip to content

Commit 8ceec3d

Browse files
authored
Merge pull request #158 from rubycdp/fix-build
Fix build
2 parents 4857f30 + 434388d commit 8ceec3d

File tree

8 files changed

+45
-60
lines changed

8 files changed

+45
-60
lines changed

.circleci/config.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

gemfiles/websocket-driver-0.6.x.gemfile renamed to .github/gemfiles/websocket-driver-0.6.x.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ source "https://rubygems.org"
44

55
gem "websocket-driver", "~> 0.6.5"
66

7-
gemspec path: "../"
7+
gemspec path: "../../"

gemfiles/websocket-driver-0.7.x.gemfile renamed to .github/gemfiles/websocket-driver-0.7.x.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ source "https://rubygems.org"
44

55
gem "websocket-driver", "~> 0.7.1"
66

7-
gemspec path: "../"
7+
gemspec path: "../../"

.github/workflows/tests.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Tests
2+
on: [push]
3+
4+
jobs:
5+
tests:
6+
name: Tests
7+
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
gemfile: [websocket-driver-0.6.x, websocket-driver-0.7.x]
12+
ruby: [2.5, 2.6, 2.7]
13+
14+
runs-on: ubuntu-latest
15+
env:
16+
FERRUM_PROCESS_TIMEOUT: 20
17+
BUNDLE_GEMFILE: .github/gemfiles/${{ matrix.gemfile }}.gemfile
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v2
21+
22+
- name: Setup Ruby
23+
uses: ruby/setup-ruby@v1
24+
with:
25+
ruby-version: ${{ matrix.ruby }}
26+
bundler-cache: true
27+
28+
- run: mkdir -p /tmp/ferrum
29+
30+
- name: Run tests
31+
run: bundle exec rake
32+
33+
- name: Archive artifacts
34+
uses: actions/upload-artifact@v2
35+
if: ${{ failure() }}
36+
with:
37+
name: footprints
38+
path: /tmp/ferrum/

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Ferrum - high-level API to control Chrome in Ruby
22

3-
[![CircleCI](https://circleci.com/gh/rubycdp/ferrum.svg?style=shield)](https://circleci.com/gh/rubycdp/ferrum)
4-
53
<img align="right"
64
width="320" height="241"
75
alt="Ferrum logo"

lib/ferrum/browser/process.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Browser
1616
class Process
1717
KILL_TIMEOUT = 2
1818
WAIT_KILLED = 0.05
19-
PROCESS_TIMEOUT = ENV.fetch("FERRUM_PROCESS_TIMEOUT", 2).to_i
19+
PROCESS_TIMEOUT = ENV.fetch("FERRUM_PROCESS_TIMEOUT", 10).to_i
2020

2121
attr_reader :host, :port, :ws_url, :pid, :command,
2222
:default_user_agent, :browser_version, :protocol_version,

spec/browser_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ module Ferrum
5757
path = "#{PROJECT_ROOT}/spec/support/no_chrome"
5858

5959
expect {
60-
Browser.new(browser_path: path)
60+
Browser.new(browser_path: path, process_timeout: 2)
6161
}.to raise_error(
6262
Ferrum::ProcessTimeoutError,
6363
"Browser did not produce websocket url within 2 seconds"

spec/spec_helper.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,10 @@ def save_exception_aftifacts(browser, meta)
6767
timestamp = "#{time_now.strftime("%Y-%m-%d-%H-%M-%S.")}#{"%03d" % (time_now.usec/1000).to_i}"
6868

6969
screenshot_name = "screenshot-#{filename}-#{line_number}-#{timestamp}.png"
70-
screenshot_path = "#{ENV["CIRCLE_ARTIFACTS"]}/screenshots/#{screenshot_name}"
70+
screenshot_path = "/tmp/ferrum/#{screenshot_name}"
7171
browser.screenshot(path: screenshot_path, full: true)
7272

73-
log_name = "ferrum-#{filename}-#{line_number}-#{timestamp}.txt"
74-
log_path = "#{ENV["CIRCLE_ARTIFACTS"]}/logs/#{log_name}"
75-
File.open(log_path, "wb") { |file| file.write(FERRUM_LOGGER.string) }
73+
log_name = "logfile-#{filename}-#{line_number}-#{timestamp}.txt"
74+
File.open("/tmp/ferrum/#{log_name}", "wb") { |file| file.write(FERRUM_LOGGER.string) }
7675
end
7776
end

0 commit comments

Comments
 (0)