superbot-cloud 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/superbot/cloud/cli/organization_based_command.rb +1 -1
- data/lib/superbot/cloud/cli/root_command.rb +3 -1
- data/lib/superbot/cloud/cli/run_command.rb +35 -0
- data/lib/superbot/cloud/cli/test_command.rb +0 -2
- data/lib/superbot/cloud/version.rb +1 -1
- metadata +3 -3
- data/lib/superbot/cloud/cli/test/schedule_command.rb +0 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a1469bbea349e78d1dfc801d79bf15cfbd6ee7f7e5c9186f4433d85ece35051
|
4
|
+
data.tar.gz: 97aae27dcf1278549a478b0f616d80a5defc246e784f5c07695f6e9757b6ccac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b41044817474b987b21587405ebedca97ed100f88deb225fae7dbca4824f630c41cebeda9470abe19ac8f8faafc382b0c2dcf8e5b5969282055e52b2b8c10445
|
7
|
+
data.tar.gz: e368ee9d65b37ec5f6cc01328002fba36801855c94671ac0f868923a3851f5ed59ac4ef830ef34fcc37f6abb817cff2d40a04c35c9794c33416a9eb6f162469f
|
data/Gemfile.lock
CHANGED
@@ -4,7 +4,7 @@ module Superbot
|
|
4
4
|
module Cloud
|
5
5
|
module CLI
|
6
6
|
class OrganizationBasedCommand < LoginRequiredCommand
|
7
|
-
option ["--org"], "ORGANIZATION", "
|
7
|
+
option ["--org"], "ORGANIZATION", "Name of organization to take action on", required: true, attribute_name: :organization
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
@@ -10,6 +10,7 @@ require_relative 'organization_command'
|
|
10
10
|
require_relative 'test_command'
|
11
11
|
require_relative 'webdriver_command'
|
12
12
|
require_relative 'member_command'
|
13
|
+
require_relative 'run_command'
|
13
14
|
require_relative 'schedule_command'
|
14
15
|
|
15
16
|
module Superbot
|
@@ -23,7 +24,8 @@ module Superbot
|
|
23
24
|
subcommand ['test'], "Manage your tests", TestCommand
|
24
25
|
subcommand ['webdriver'], "Manage your webdriver sessions", WebdriverCommand
|
25
26
|
subcommand ['member'], "Manage your organization members", MemberCommand
|
26
|
-
subcommand
|
27
|
+
subcommand ['run'], "Schedule a cloud run", RunCommand
|
28
|
+
subcommand ['schedule'], "Manage your schedules", ScheduleCommand
|
27
29
|
|
28
30
|
option ['-v', '--version'], :flag, "Show version information" do
|
29
31
|
puts Superbot::Cloud::VERSION
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Superbot
|
4
|
+
module Cloud
|
5
|
+
module CLI
|
6
|
+
class RunCommand < OrganizationBasedCommand
|
7
|
+
parameter "NAME", "the name of the test to delete", required: true
|
8
|
+
option ['--region'], 'REGION', 'Region for remote webdriver'
|
9
|
+
option ['--when'], 'WHEN', "When to schedule a test (either asap or cron expression)", default: 'asap', attribute_name: :starts_at
|
10
|
+
option ['--bots'], 'BOTS', 'Number of running cloud superbots', default: 1
|
11
|
+
option ['--loop'], 'LOOP_COUNT', 'Number of runs for each bot', default: 1, attribute_name: :loop_count
|
12
|
+
|
13
|
+
def execute
|
14
|
+
schedule_test
|
15
|
+
end
|
16
|
+
|
17
|
+
def schedule_test
|
18
|
+
Superbot::Cloud::Api.request(:schedule_test, params: schedule_params)
|
19
|
+
puts "Cloud run has been scheduled"
|
20
|
+
end
|
21
|
+
|
22
|
+
def schedule_params
|
23
|
+
{
|
24
|
+
test_name: name,
|
25
|
+
region: region,
|
26
|
+
organization_name: organization,
|
27
|
+
parallel: bots,
|
28
|
+
starts_at: starts_at,
|
29
|
+
loop: loop_count
|
30
|
+
}.compact
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -5,7 +5,6 @@ require_relative 'test/list_command'
|
|
5
5
|
require_relative 'test/upload_command'
|
6
6
|
require_relative 'test/download_command'
|
7
7
|
require_relative 'test/delete_command'
|
8
|
-
require_relative 'test/schedule_command'
|
9
8
|
|
10
9
|
module Superbot
|
11
10
|
module Cloud
|
@@ -15,7 +14,6 @@ module Superbot
|
|
15
14
|
subcommand ['upload'], "Upload test to the cloud", Test::UploadCommand
|
16
15
|
subcommand ['download'], "Download test from the cloud", Test::DownloadCommand
|
17
16
|
subcommand ['delete'], "Delete test from the cloud", Test::DeleteCommand
|
18
|
-
subcommand(['schedule'], "Schedule a test", Test::ScheduleCommand) if ENV['SUPERBOT_FEAT_SCHEDULE'] == 'true'
|
19
17
|
end
|
20
18
|
end
|
21
19
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: superbot-cloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Superbots
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multipart-post
|
@@ -148,6 +148,7 @@ files:
|
|
148
148
|
- lib/superbot/cloud/cli/organization_based_command.rb
|
149
149
|
- lib/superbot/cloud/cli/organization_command.rb
|
150
150
|
- lib/superbot/cloud/cli/root_command.rb
|
151
|
+
- lib/superbot/cloud/cli/run_command.rb
|
151
152
|
- lib/superbot/cloud/cli/schedule/base_command.rb
|
152
153
|
- lib/superbot/cloud/cli/schedule/cancel_command.rb
|
153
154
|
- lib/superbot/cloud/cli/schedule/list_command.rb
|
@@ -156,7 +157,6 @@ files:
|
|
156
157
|
- lib/superbot/cloud/cli/test/delete_command.rb
|
157
158
|
- lib/superbot/cloud/cli/test/download_command.rb
|
158
159
|
- lib/superbot/cloud/cli/test/list_command.rb
|
159
|
-
- lib/superbot/cloud/cli/test/schedule_command.rb
|
160
160
|
- lib/superbot/cloud/cli/test/upload_command.rb
|
161
161
|
- lib/superbot/cloud/cli/test_command.rb
|
162
162
|
- lib/superbot/cloud/cli/validations.rb
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Superbot
|
4
|
-
module Cloud
|
5
|
-
module CLI
|
6
|
-
module Test
|
7
|
-
class ScheduleCommand < BaseCommand
|
8
|
-
parameter "NAME", "the name of the test to delete", required: true
|
9
|
-
option ['--region'], 'REGION', 'Region for remote webdriver'
|
10
|
-
option ['--user-load'], 'USER_LOAD', 'Number of concurrent users'
|
11
|
-
|
12
|
-
def execute
|
13
|
-
schedule_test
|
14
|
-
end
|
15
|
-
|
16
|
-
def schedule_test
|
17
|
-
Superbot::Cloud::Api.request(:schedule_test, params: schedule_params)
|
18
|
-
puts "Tests successfully scheduled"
|
19
|
-
end
|
20
|
-
|
21
|
-
def schedule_params
|
22
|
-
{
|
23
|
-
test_name: name,
|
24
|
-
region: region,
|
25
|
-
organization_name: organization,
|
26
|
-
parallel: user_load
|
27
|
-
}.compact
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|