gemnasium / gemnasium-gitlab-service Goto Github PK
View Code? Open in Web Editor NEWProvide support for Gemnasium integration as a Gitlab Service
License: MIT License
Provide support for Gemnasium integration as a Gitlab Service
License: MIT License
$ bundle install
Fetching gem metadata from https://rubygems.org/............
Fetching version metadata from https://rubygems.org/..
Resolving dependencies...
Using rake 10.5.0
Using rugged 0.24.0
Using rspec-core 2.99.2
Using diff-lcs 1.3
Using rspec-mocks 2.99.4
Using public_suffix 2.0.5
Using safe_yaml 1.0.4
Using hashdiff 0.3.5
Using bundler 1.15.1
Using gemnasium-gitlab-service 0.2.6 from source at `.`
Using rspec-expectations 2.99.2
Using addressable 2.5.1
Using crack 0.4.3
Using rspec 2.99.0
Fetching webmock 3.0.1 (was 1.24.6)
Installing webmock 3.0.1 (was 1.24.6)
Bundle complete! 4 Gemfile dependencies, 15 gems now installed.
Bundled gems are installed into ./vendor/bundle.
The latest bundler is 1.15.2, but you are currently running 1.15.1.
To update, run `gem install bundler`
pravi@nishumbha:~/forge/debian/git/pkg-ruby-extras/ruby-gemnasium-gitlab-service$ bundle exec rake spec
/usr/bin/ruby2.3 -S rspec ./spec/gemnasium/gitlab_service/client_spec.rb ./spec/gemnasium/gitlab_service/connection_spec.rb ./spec/gemnasium/gitlab_service/pusher_spec.rb ./spec/gemnasium/gitlab_service_spec.rb
.F.FF...
Failures:
1) Gemnasium::GitlabService::Client upload_files issues a POST request
Failure/Error: client.upload_files(
WebMock::NetConnectNotAllowedError:
Real HTTP connections are disabled. Unregistered request: POST https://api.gemnasium.com/v1/projects/project_slug/dependency_files with body '[{"path":"Gemfile","sha":"sha of Gemfile","content":"Y29udGVudCBvZiBHZW1maWxl\n"},{"path":"Gemfile.lock","sha":"sha of Gemfile.lock","content":"Y29udGVudCBvZiBHZW1maWxlLmxvY2s=\n"}]' with headers {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization'=>'Basic WDpzZWNyZXRfYXBpX2tleQ==', 'Content-Type'=>'application/json', 'User-Agent'=>'Gemnasium Gitlab Service - v0.2.6', 'X-Gms-Branch'=>'branch_name', 'X-Gms-Revision'=>'commit_sha'}
You can stub this request with the following snippet:
stub_request(:post, "https://api.gemnasium.com/v1/projects/project_slug/dependency_files").
with(body: "[{\"path\":\"Gemfile\",\"sha\":\"sha of Gemfile\",\"content\":\"Y29udGVudCBvZiBHZW1maWxl\\n\"},{\"path\":\"Gemfile.lock\",\"sha\":\"sha of Gemfile.lock\",\"content\":\"Y29udGVudCBvZiBHZW1maWxlLmxvY2s=\\n\"}]",
headers: {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization'=>'Basic WDpzZWNyZXRfYXBpX2tleQ==', 'Content-Type'=>'application/json', 'User-Agent'=>'Gemnasium Gitlab Service - v0.2.6', 'X-Gms-Branch'=>'branch_name', 'X-Gms-Revision'=>'commit_sha'}).
to_return(status: 200, body: "", headers: {})
registered request stubs:
stub_request(:post, "https://X:[email protected]/v1/test_path").
with(body: {"foo"=>"bar"},
headers: {'Accept'=>'application/json', 'Content-Type'=>'application/json', 'User-Agent'=>'Gemnasium Gitlab Service - v0.2.6'})
Body diff:
[["~",
"",
[{"path"=>"Gemfile",
"sha"=>"sha of Gemfile",
"content"=>"Y29udGVudCBvZiBHZW1maWxl\n"},
{"path"=>"Gemfile.lock",
"sha"=>"sha of Gemfile.lock",
"content"=>"Y29udGVudCBvZiBHZW1maWxlLmxvY2s=\n"}],
{"foo"=>"bar"}]]
stub_request(:get, "https://X:[email protected]/v1/test_path").
with(headers: {'Accept'=>'application/json', 'Content-Type'=>'application/json', 'User-Agent'=>'Gemnasium Gitlab Service - v0.2.6'})
stub_request(:post, "https://X:[email protected]/v1/projects/project_slug/dependency_files").
with(headers: {'Accept'=>'application/json', 'Content-Type'=>'application/json', 'User-Agent'=>'Gemnasium Gitlab Service - v0.2.6'})
============================================================
# ./lib/gemnasium/gitlab_service/connection.rb:28:in `post'
# ./lib/gemnasium/gitlab_service/client.rb:39:in `request'
# ./lib/gemnasium/gitlab_service/client.rb:22:in `upload_files'
# ./spec/gemnasium/gitlab_service/client_spec.rb:24:in `block (3 levels) in <top (required)>'
2) Gemnasium::GitlabService::Connection get issues a GET request
Failure/Error: before { connection.get('test_path') }
WebMock::NetConnectNotAllowedError:
Real HTTP connections are disabled. Unregistered request: GET https://api.gemnasium.com/v1/test_path with headers {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization'=>'Basic WDpzZWNyZXRfYXBpX2tleQ==', 'Content-Type'=>'application/json', 'User-Agent'=>'Gemnasium Gitlab Service - v0.2.6'}
You can stub this request with the following snippet:
stub_request(:get, "https://api.gemnasium.com/v1/test_path").
with(headers: {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization'=>'Basic WDpzZWNyZXRfYXBpX2tleQ==', 'Content-Type'=>'application/json', 'User-Agent'=>'Gemnasium Gitlab Service - v0.2.6'}).
to_return(status: 200, body: "", headers: {})
registered request stubs:
stub_request(:post, "https://X:[email protected]/v1/test_path").
with(body: {"foo"=>"bar"},
headers: {'Accept'=>'application/json', 'Content-Type'=>'application/json', 'User-Agent'=>'Gemnasium Gitlab Service - v0.2.6'})
stub_request(:get, "https://X:[email protected]/v1/test_path").
with(headers: {'Accept'=>'application/json', 'Content-Type'=>'application/json', 'User-Agent'=>'Gemnasium Gitlab Service - v0.2.6'})
stub_request(:post, "https://X:[email protected]/v1/projects/project_slug/dependency_files").
with(headers: {'Accept'=>'application/json', 'Content-Type'=>'application/json', 'User-Agent'=>'Gemnasium Gitlab Service - v0.2.6'})
============================================================
# ./lib/gemnasium/gitlab_service/connection.rb:34:in `get'
# ./spec/gemnasium/gitlab_service/connection_spec.rb:16:in `block (3 levels) in <top (required)>'
3) Gemnasium::GitlabService::Connection post issues a POST request
Failure/Error: before { connection.post('test_path', { foo: 'bar' }.to_json) }
WebMock::NetConnectNotAllowedError:
Real HTTP connections are disabled. Unregistered request: POST https://api.gemnasium.com/v1/test_path with body '{"foo":"bar"}' with headers {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization'=>'Basic WDpzZWNyZXRfYXBpX2tleQ==', 'Content-Type'=>'application/json', 'User-Agent'=>'Gemnasium Gitlab Service - v0.2.6'}
You can stub this request with the following snippet:
stub_request(:post, "https://api.gemnasium.com/v1/test_path").
with(body: "{\"foo\":\"bar\"}",
headers: {'Accept'=>'application/json', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Authorization'=>'Basic WDpzZWNyZXRfYXBpX2tleQ==', 'Content-Type'=>'application/json', 'User-Agent'=>'Gemnasium Gitlab Service - v0.2.6'}).
to_return(status: 200, body: "", headers: {})
registered request stubs:
stub_request(:post, "https://X:[email protected]/v1/test_path").
with(body: {"foo"=>"bar"},
headers: {'Accept'=>'application/json', 'Content-Type'=>'application/json', 'User-Agent'=>'Gemnasium Gitlab Service - v0.2.6'})
stub_request(:get, "https://X:[email protected]/v1/test_path").
with(headers: {'Accept'=>'application/json', 'Content-Type'=>'application/json', 'User-Agent'=>'Gemnasium Gitlab Service - v0.2.6'})
stub_request(:post, "https://X:[email protected]/v1/projects/project_slug/dependency_files").
with(headers: {'Accept'=>'application/json', 'Content-Type'=>'application/json', 'User-Agent'=>'Gemnasium Gitlab Service - v0.2.6'})
============================================================
# ./lib/gemnasium/gitlab_service/connection.rb:28:in `post'
# ./spec/gemnasium/gitlab_service/connection_spec.rb:25:in `block (3 levels) in <top (required)>'
Finished in 0.02203 seconds
8 examples, 3 failures
Failed examples:
rspec ./spec/gemnasium/gitlab_service/client_spec.rb:30 # Gemnasium::GitlabService::Client upload_files issues a POST request
rspec ./spec/gemnasium/gitlab_service/connection_spec.rb:18 # Gemnasium::GitlabService::Connection get issues a GET request
rspec ./spec/gemnasium/gitlab_service/connection_spec.rb:27 # Gemnasium::GitlabService::Connection post issues a POST request
/usr/bin/ruby2.3 -S rspec ./spec/gemnasium/gitlab_service/client_spec.rb ./spec/gemnasium/gitlab_service/connection_spec.rb ./spec/gemnasium/gitlab_service/pusher_spec.rb ./spec/gemnasium/gitlab_service_spec.rb failed
In debian, we already have webmock 3.0 and would like to run tests with it. Please update the tests to run with webmock 3.0.
The Travis-CI build failed for the 2.0 build and tests.
Is 0.2.4 intended to be the last release supporting ruby 2.0 or was this an oversight?
See https://gitlab.com/gitlab-org/gitlab-ce/issues/4192 for details
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.