ruby-cute 0.12 → 0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitlab-ci.yml +36 -0
- data/debian/changelog +12 -0
- data/lib/cute/g5k_api.rb +7 -1
- data/lib/cute/version.rb +1 -1
- data/spec/g5k_api_spec.rb +12 -10
- data/spec/spec_helper.rb +9 -6
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d49efb970f8f16ed726038af0c0b7ff4a784ef6224b9f9c93be5da2b9e45ab54
|
4
|
+
data.tar.gz: f852b0ef02f3e9c57d9ce9575cd3fa0ff9ce6992773068699f7e5de0851ecad7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15dba2fa27ca9cb7c6f486d0580f9b872ec912e410557f3eb41f7bcc8f28625c6b841730e2b3d0c72858dc6c6e06aaf1f18e8d0f3a2a5fb7cbeb66742c3650f6
|
7
|
+
data.tar.gz: d7096e3d2730da5099159bbfc8869628d91e7e1f7583b5ba9a8c7db56ca5a02998342aa8aabcefe598939de10b64fb78d5b7aefac1eec608b287b4d7323911f3
|
data/.gitlab-ci.yml
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# This is important to avoid stale artifacts in the build directory
|
2
|
+
variables:
|
3
|
+
GIT_STRATEGY: clone
|
4
|
+
|
5
|
+
# Another stage is needed for the deployment (so that files are already generated by the previous job)
|
6
|
+
stages:
|
7
|
+
- build
|
8
|
+
- deploy
|
9
|
+
|
10
|
+
build:
|
11
|
+
stage: build
|
12
|
+
tags:
|
13
|
+
- grid5000-docker
|
14
|
+
image: debian:stretch
|
15
|
+
script:
|
16
|
+
- apt-get update && apt-get -y --no-install-recommends install devscripts build-essential equivs
|
17
|
+
- mk-build-deps -ir -t 'apt-get -y --no-install-recommends'
|
18
|
+
- dpkg-buildpackage
|
19
|
+
- cp ../*deb . # needed to upload it as artifact
|
20
|
+
except:
|
21
|
+
- tags
|
22
|
+
artifacts: # generate artifacts for files we want to publish
|
23
|
+
paths:
|
24
|
+
- ./*.deb
|
25
|
+
expire_in: '1 day'
|
26
|
+
|
27
|
+
push-package:
|
28
|
+
stage: deploy
|
29
|
+
# tags must be 'packages' so that we use the runner on packages.grid5000.fr
|
30
|
+
tags:
|
31
|
+
- grid5000-packages
|
32
|
+
only:
|
33
|
+
- master
|
34
|
+
when: manual
|
35
|
+
script:
|
36
|
+
- g5k-deploy-files --only-if-tag --debian --directory deb/ruby-cute
|
data/debian/changelog
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
ruby-cute (0.13) unstable; urgency=medium
|
2
|
+
|
3
|
+
* New release.
|
4
|
+
|
5
|
+
-- Lucas Nussbaum <lucas@debian.org> Mon, 23 Mar 2020 21:03:21 +0100
|
6
|
+
|
7
|
+
ruby-cute (0.12) unstable; urgency=medium
|
8
|
+
|
9
|
+
* New release.
|
10
|
+
|
11
|
+
-- Lucas Nussbaum <lucas@debian.org> Thu, 24 Jan 2019 21:09:55 +0100
|
12
|
+
|
1
13
|
ruby-cute (0.11) unstable; urgency=medium
|
2
14
|
|
3
15
|
* New release.
|
data/lib/cute/g5k_api.rb
CHANGED
@@ -239,6 +239,12 @@ module Cute
|
|
239
239
|
# @return [Hash] the HTTP response
|
240
240
|
# @param path [String] this complements the URI to address to a specific resource
|
241
241
|
def get_json(path)
|
242
|
+
return G5KJSON.parse(get_raw(path))
|
243
|
+
end
|
244
|
+
|
245
|
+
# @return [String] the HTTP response
|
246
|
+
# @param path [String] this complements the URI to address to a specific resource
|
247
|
+
def get_raw(path)
|
242
248
|
retries = 0
|
243
249
|
begin
|
244
250
|
r = resource(path).get(:content_type => "application/json",
|
@@ -253,7 +259,7 @@ module Cute
|
|
253
259
|
end
|
254
260
|
handle_exception(e)
|
255
261
|
end
|
256
|
-
return
|
262
|
+
return r
|
257
263
|
end
|
258
264
|
|
259
265
|
# Creates a resource on the server
|
data/lib/cute/version.rb
CHANGED
data/spec/g5k_api_spec.rb
CHANGED
@@ -69,12 +69,14 @@ describe Cute::G5K::API do
|
|
69
69
|
expect(subject.get_deployments(@rand_site)).to be_an_instance_of(Cute::G5K::G5KArray)
|
70
70
|
end
|
71
71
|
|
72
|
+
=begin
|
72
73
|
it "raises an authentication error" do
|
73
74
|
expect{Cute::G5K::API.new(:user => "fake", :pass => "fake") }.to raise_error
|
74
75
|
end
|
76
|
+
=end
|
75
77
|
|
76
|
-
it "raises a
|
77
|
-
expect{subject.get_jobs("
|
78
|
+
it "raises a not found error" do
|
79
|
+
expect{subject.get_jobs("not-found")}.to raise_error(Cute::G5K::NotFound)
|
78
80
|
end
|
79
81
|
|
80
82
|
it "raises a bad request error" do
|
@@ -86,10 +88,10 @@ describe Cute::G5K::API do
|
|
86
88
|
expect{subject.reserve(:site => @rand_site, :resources =>"nodes=1",:keys => "~/jobkey_nonexisting")}.to raise_error(Cute::G5K::BadRequest)
|
87
89
|
end
|
88
90
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
91
|
+
# it "raises an exception at deploying" do
|
92
|
+
# expect{ subject.reserve(:site => @rand_site, :nodes => 1, :env => "nonsense")}.to raise_error(Cute::G5K::RequestFailed)
|
93
|
+
# end
|
94
|
+
#
|
93
95
|
it "raises argument errors" do
|
94
96
|
job = Cute::G5K::G5KJSON.new
|
95
97
|
expect {subject.deploy(:env => "env")}.to raise_error(ArgumentError)
|
@@ -185,10 +187,10 @@ describe Cute::G5K::API do
|
|
185
187
|
end
|
186
188
|
|
187
189
|
|
188
|
-
it "submits a job and then deploy" do
|
189
|
-
expect(subject.reserve(:site => @rand_site, :env => @env)).to have_key("deploy")
|
190
|
-
end
|
191
|
-
|
190
|
+
# it "submits a job and then deploy" do
|
191
|
+
# expect(subject.reserve(:site => @rand_site, :env => @env)).to have_key("deploy")
|
192
|
+
# end
|
193
|
+
#
|
192
194
|
|
193
195
|
it "returns the same information" do
|
194
196
|
#low level REST access
|
data/spec/spec_helper.rb
CHANGED
@@ -46,33 +46,36 @@ RSpec.configure do |config|
|
|
46
46
|
# uri_sites = Addressable::Template.new "https://{user}:{password}@api.grid5000.fr/{version}/sites"
|
47
47
|
config.before(:each) do
|
48
48
|
|
49
|
+
stub_request(:any,/^https:\/\/api.grid5000.fr\/.*/).
|
50
|
+
to_return(:status => 200, :body => g5k_media_type.to_json, :headers => {})
|
51
|
+
|
49
52
|
stub_request(:any,/^https:\/\/.*\:.*@api.grid5000.fr\/.*/).
|
50
53
|
to_return(:status => 200, :body => g5k_media_type.to_json, :headers => {})
|
51
54
|
|
52
55
|
stub_request(:any,/^https:\/\/fake:fake@api.grid5000.fr\.*/).
|
53
56
|
to_return(:status => 401)
|
54
57
|
|
55
|
-
stub_request(:any,/^https
|
58
|
+
stub_request(:any,/^https:\/\/(.*\:.*@)?api.grid5000.fr\/.*\/sites\/not-found\/.*/).
|
56
59
|
to_return(:status => 404)
|
57
60
|
|
58
|
-
stub_request(:any,/^https
|
61
|
+
stub_request(:any,/^https:\/\/(.*\:.*@)?api.grid5000.fr\/.*\/sites\/tmpfail\/.*/).
|
59
62
|
to_return(:status => 503).
|
60
63
|
to_return(:status => 200, :body => g5k_media_type.to_json, :headers => {})
|
61
64
|
|
62
|
-
stub_request(:get,/^https
|
65
|
+
stub_request(:get,/^https:\/\/(.*\:.*@)?api.grid5000.fr\/.*\/sites\/.*vlans$/).
|
63
66
|
to_return(:status => 200, :body => {'total' => 3, 'items' => [{'type' => "kavlan-local"},{'type' => "kvlan"}]}.to_json)
|
64
67
|
|
65
68
|
# to_return(:status => 200, :body => {:total => 3, :items => [{:type => "kavlan-local"},{:type => "kavlan"}]})
|
66
69
|
|
67
|
-
stub_request(:post, /^https
|
70
|
+
stub_request(:post, /^https:\/\/(.*\:.*@)?api.grid5000.fr\/.*/).
|
68
71
|
with(:body => hash_including("resources" => "/slash_22=1+{nonsense},walltime=01:00")).
|
69
72
|
to_return(:status => 400, :body => "Oarsub failed: please verify your request syntax")
|
70
73
|
|
71
|
-
stub_request(:post, /^https
|
74
|
+
stub_request(:post, /^https:\/\/(.*\:.*@)?api.grid5000.fr\/.*/).
|
72
75
|
with(:body => hash_including("import-job-key-from-file" => [ File.expand_path("~/jobkey_nonexisting") ])).
|
73
76
|
to_return(:status => 400, :body => "Oarsub failed: please verify your request syntax")
|
74
77
|
|
75
|
-
stub_request(:post, /^https
|
78
|
+
stub_request(:post, /^https:\/\/(.*\:.*@)?api.grid5000.fr\/.*/).
|
76
79
|
with(:body => hash_including("environment" => "nonsense")).
|
77
80
|
to_return(:status => 500, :body => "Invalid environment specification")
|
78
81
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-cute
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.13'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Algorille team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -174,6 +174,7 @@ extra_rdoc_files:
|
|
174
174
|
- LICENSE
|
175
175
|
files:
|
176
176
|
- ".gitignore"
|
177
|
+
- ".gitlab-ci.yml"
|
177
178
|
- ".yardopts"
|
178
179
|
- Gemfile
|
179
180
|
- LICENSE
|
@@ -235,7 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
235
236
|
version: 1.3.6
|
236
237
|
requirements: []
|
237
238
|
rubyforge_project:
|
238
|
-
rubygems_version: 2.
|
239
|
+
rubygems_version: 2.7.6.2
|
239
240
|
signing_key:
|
240
241
|
specification_version: 4
|
241
242
|
summary: Critically Useful Tools for Experiments
|