Code Monkey home page Code Monkey logo

sauce_whisk's Issues

Inconsistent ENV usage across languages is problematic

sauce_whisk

ENV['SAUCE_USERNAME'] ||= 'test_user'
ENV['SAUCE_ACCESS_KEY'] ||= 'test_key'

sauce-java

private static final String SAUCE_USER_NAME = "SAUCE_USER_NAME";
private static final String SAUCE_API_KEY = "SAUCE_API_KEY";

I think Sauce should have a standard naming convention for the ENV vars instead of different values for each project.

undefined method `browser' for nil:NilClass for @driver

We have set up our specs based on this example, yet we run into this error as soon as we have more than a single spec:

Failure/Error: SauceWhisk::Jobs.change_status(@driver.browser.session_id, !example.exception)
NoMethodError: undefined method `browser' for nil:NilClass

our sauce_spec_helper.rb has the following (ie the same stuff as the example with the addition of a flag we use specifically for Travis):

config.after(:each, skip: do_not_run_on_sauce?) do |example|
  SauceWhisk::Jobs.change_status(@driver.browser.session_id, !example.exception)
  @driver.quit
end

Any idea on what could be causing this?

Failing tests using rspec command

Are the tests passing for you on master? I exported a sauce user and key yet they're still failing.

$ rspec
PSYCH: 2.0.5
........................F....................F........F..FF..F...............................F...F..FF.F.

Delete assets deleting job instead

I contributed the code for the Asset deletion, however at the time I had named the method asset_delete as opposed delete or rest_delete due to a collision I was seeing. It looks like an alias was created, but unfortunately it looks like it deletes the entire job and not the assets.

SauceWhisk::Assets.rest_delete "459887345

If I look at the url that's invoked by the above, it's trying to delete the asset:

https://saucelabs.com/rest/v1/dfranko/jobs/459887345

I'd be happy to fix this, I just don't know what the correct way of doing so would be.

Rake install executes twice

$ rake install
sauce_whisk 0.0.12 built to pkg/sauce_whisk-0.0.12.gem.
sauce_whisk 0.0.12 built to pkg/sauce_whisk-0.0.12.gem.
sauce_whisk (0.0.12) installed.
sauce_whisk (0.0.12) installed.

The problem is require "bundler/gem_tasks" must not be in the Rakefile or the install task is defined and executed twice.

Rake test does nothing

Nothing happens when rake test is executed. Have these tests ever run via Rake?

$ bundle install
$ rake test

Improve error handling for job fetch

When calling SauceWhisk::Jobs.fetch job_id an error occurs in initialize of lib/sauce_whisk/jobs.rb:100. I dug into it and nil was being passed in as the parameters to initialize. This was initiated from the self.fetch on line 46 of same file. When I stepped through it I found that the get job_id was failing with RestClient::ResourceNotFound Exception: 404 Resource Not Found. I was able to discern the job_id I was passing into fetch was incorrect, but there could be better error handling around RestClient exceptions.

Compatibility with Ruby 3.2.2

There seems to be a bug with the sauce_whisk gem against Ruby 3.2.2. When I tried it out it crashes like so...
/usr/local/rvm/gems/ruby-3.2.2/gems/sauce_whisk-0.3.2/lib/sauce_whisk.rb:144:in block in load_options_from_yaml': undefined method exists?' for File:Class (NoMethodError)

if File.exists? path

This article suggests it's a problem with backwards compatibility in Ruby 3.2
https://stackoverflow.com/questions/14351272/undefined-method-exists-for-fileclass-nomethoderror

ArgumentError when creating empty job via SauceWhisk::Job.new job_id

Attempting to create a new 'empty' job, per the documentation,

job = SauceWhisk::Job.new job_id

results in the following error:

 ArgumentError:
  invalid range "m-d" in string transliteration
  # /usr/local/rvm/gems/ruby-1.9.3-p194/gems/sauce_whisk-0.0.10/lib/sauce_whisk/jobs.rb:80:in `delete'
  # /usr/local/rvm/gems/ruby-1.9.3-p194/gems/sauce_whisk-0.0.10/lib/sauce_whisk/jobs.rb:80:in `initialize'

service_status takes a "long time" to respond

I'm not exactly sure what the expectation is for the response time for the service status, but this seems too long to me. Perhaps there's a better method for me to use to check if the service is up?

2.0.0-p195 :019 > 10.times do
2.0.0-p195 :020 >     start = Time.now
2.0.0-p195 :021?>   puts SauceWhisk::Sauce.service_status
2.0.0-p195 :022?>   puts "Duration : #{Time.now - start}"
2.0.0-p195 :023?>   sleep 10
2.0.0-p195 :024?>   end

{:wait_time=>3.7078734363502575, :service_operational=>true, :status_message=>"Basic service status checks passed."}
Duration : 5.853709
{:wait_time=>3.144050104384134, :service_operational=>true, :status_message=>"Basic service status checks passed."}
Duration : 11.758652
{:wait_time=>3.6678224687933425, :service_operational=>true, :status_message=>"Basic service status checks passed."}
Duration : 11.537582
{:wait_time=>2.587360594795539, :service_operational=>true, :status_message=>"Basic service status checks passed."}
Duration : 27.473724
{:wait_time=>5.043506921555702, :service_operational=>true, :status_message=>"Basic service status checks passed."}
Duration : 15.525515
{:wait_time=>5.559947299077733, :service_operational=>true, :status_message=>"Basic service status checks passed."}
Duration : 17.325829
{:wait_time=>6.0932642487046635, :service_operational=>true, :status_message=>"Basic service status checks passed."}
Duration : 6.790501
{:wait_time=>6.3870112657388995, :service_operational=>true, :status_message=>"Basic service status checks passed."}
Duration : 8.320454
{:wait_time=>6.376744186046512, :service_operational=>true, :status_message=>"Basic service status checks passed."}
Duration : 20.616669
{:wait_time=>6.577963917525773, :service_operational=>true, :status_message=>"Basic service status checks passed."}
Duration : 3.925932

Allow for usage of ondemand.yml

Let the REST API use ondemand.yml to configure its auth values.

This will prevent the sauce:spec task from freaking out when users are using ondemand.

Jobs.fetch is returning a 400 Bad request, sometimes

SauceWhisk::Jobs.fetch job_id

is returning this
RestClient::BadRequest: 400 Bad Request
from /Users/malugus/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rest-client-1.6.7/lib/restclient/abstract_response.rb:48:in `return!'

This works after a bit, if Sauce API is not reliable you should add an implicit retry loop.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.