qat-reporter-xray-sa 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42cc4ff05122b7c099ffa5aa7acef04781df4874d9abd8b1c36a034fcfdaf129
|
4
|
+
data.tar.gz: ba7b357de9ab827e2b438ecc10572f94ca7c753c470a2db9f337f0e1a86558c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5dc6ba3a819823f69fe6ed430be3d247628c57455e93fbea6f259240e085a19e81972a8a65303f32ba4454dff091ce4523e1015e1c4732d283be0839756b5c1
|
7
|
+
data.tar.gz: 7b1eaef7dd6a6cf0923ee25d2eafdbad4e853dbecd75a6db58e4deeb107df4f0bac53e8eab7c1a6376219380fac338cf138b04da5f6546a89612d1fbe1be341b
|
@@ -7,12 +7,11 @@ module QAT
|
|
7
7
|
module Config
|
8
8
|
class << self
|
9
9
|
|
10
|
-
attr_accessor :project_key, :jira_url, :xray_default_api_url, :
|
10
|
+
attr_accessor :project_key, :jira_url, :xray_default_api_url, :login_credentials, :publisher, :jira_type,
|
11
11
|
:cloud_xray_api_credentials, :xray_test_environment, :xray_test_version, :xray_test_revision, :xray_export_test_keys, :xray_export_test_filter
|
12
12
|
|
13
13
|
# Default xray API url (Jira Cloud)
|
14
14
|
DEFAULT_XRAY_URL = 'https://xray.cloud.getxray.app'
|
15
|
-
DEFAULT_XRAY_GRAPHQL = 'https://xray.cloud.getxray.app/api/v2/graphql'
|
16
15
|
|
17
16
|
# Returns the xray instanced type (hosted or cloud)
|
18
17
|
def jira_type
|
@@ -29,11 +28,6 @@ module QAT
|
|
29
28
|
DEFAULT_XRAY_URL
|
30
29
|
end
|
31
30
|
|
32
|
-
# Returns the default xray jira url for cloud api graphql
|
33
|
-
def xray_default_api_url_graphql
|
34
|
-
DEFAULT_XRAY_GRAPHQL
|
35
|
-
end
|
36
|
-
|
37
31
|
# Returns the login credentials array could -> [username, password, apiToken]
|
38
32
|
def login_credentials
|
39
33
|
@login_credentials
|
@@ -10,13 +10,12 @@ module QAT
|
|
10
10
|
module Publisher
|
11
11
|
# QAT::Reporter::Xray::Publisher::Base integrator class
|
12
12
|
class Base
|
13
|
-
attr_reader :base_url, :default_headers, :login_credentials, :default_cloud_api_url, :
|
13
|
+
attr_reader :base_url, :default_headers, :login_credentials, :default_cloud_api_url, :cloud_xray_api_credentials
|
14
14
|
|
15
15
|
# Initializes Xray Publisher url and login information
|
16
16
|
def initialize
|
17
17
|
@base_url = QAT::Reporter::Xray::Config.jira_url
|
18
18
|
@login_credentials = QAT::Reporter::Xray::Config.login_credentials
|
19
|
-
@default_cloud_api_url = QAT::Reporter::Xray::Config.xray_default_api_url
|
20
19
|
@default_cloud_api_url_graphql = QAT::Reporter::Xray::Config.xray_default_api_url_graphql
|
21
20
|
@cloud_xray_api_credentials = QAT::Reporter::Xray::Config.cloud_xray_api_credentials
|
22
21
|
end
|
@@ -38,6 +37,10 @@ module QAT
|
|
38
37
|
}.merge(headers)
|
39
38
|
end
|
40
39
|
|
40
|
+
def cloud_graphql_headers
|
41
|
+
auth_headers
|
42
|
+
end
|
43
|
+
|
41
44
|
private
|
42
45
|
|
43
46
|
# Authentication header for xray, Basic authentication done with: username, password
|
@@ -7,11 +7,6 @@ module QAT
|
|
7
7
|
module Publisher
|
8
8
|
# QAT::Reporter::Xray::Publisher::Cloud integrator class
|
9
9
|
class Cloud < Base
|
10
|
-
|
11
|
-
def get_test_execution_graphql(issue)
|
12
|
-
Graphql.get_test_execution(issue, auth_headers, default_cloud_api_url_graphql)
|
13
|
-
end
|
14
|
-
|
15
10
|
def get_jira_issue(issue_key)
|
16
11
|
headers = { 'Content-Type': 'application/json' }.merge(auth_headers)
|
17
12
|
Client.new(base_url).get("/rest/api/3/issue/#{issue_key}", headers)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qat-reporter-xray-sa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- QAT
|
@@ -127,7 +127,6 @@ files:
|
|
127
127
|
- lib/qat/reporter/xray/publisher.rb
|
128
128
|
- lib/qat/reporter/xray/publisher/base.rb
|
129
129
|
- lib/qat/reporter/xray/publisher/cloud.rb
|
130
|
-
- lib/qat/reporter/xray/publisher/graphql.rb
|
131
130
|
- lib/qat/reporter/xray/publisher/hosted.rb
|
132
131
|
- lib/qat/reporter/xray/tasks.rb
|
133
132
|
- lib/qat/reporter/xray/tasks/tests.rb
|
@@ -1,58 +0,0 @@
|
|
1
|
-
require_relative 'base'
|
2
|
-
require "graphql/client"
|
3
|
-
require "graphql/client/http"
|
4
|
-
|
5
|
-
module QAT
|
6
|
-
module Reporter
|
7
|
-
class Xray
|
8
|
-
module Publisher
|
9
|
-
|
10
|
-
module Graphql
|
11
|
-
# Configure GraphQL endpoint using the basic HTTP network adapter.
|
12
|
-
HTTP = GraphQL::Client::HTTP.new(@url) do
|
13
|
-
def headers(context)
|
14
|
-
@headers
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
# Fetch latest schema on init, this will make a network request
|
19
|
-
GraphQL::Client.dump_schema(Graph::HTTP, "schema.json")
|
20
|
-
Schema = GraphQL::Client.load_schema('schema.json')
|
21
|
-
|
22
|
-
# However, it's smart to dump this to a JSON file and load from disk
|
23
|
-
#
|
24
|
-
# Run it from a script or rake task
|
25
|
-
# GraphQL::Client.dump_schema(SWAPI::HTTP, "path/to/schema.json")
|
26
|
-
#
|
27
|
-
# Schema = GraphQL::Client.load_schema("path/to/schema.json")
|
28
|
-
|
29
|
-
Client = GraphQL::Client.new(schema: Schema, execute: HTTP)
|
30
|
-
|
31
|
-
TestExecution = Graph::Client.parse <<-GRAPHQL
|
32
|
-
{
|
33
|
-
getTestExecution(issueId: "#{@issue}") {
|
34
|
-
issueId
|
35
|
-
tests(limit: 100) {
|
36
|
-
total
|
37
|
-
start
|
38
|
-
limit
|
39
|
-
results {
|
40
|
-
issueId
|
41
|
-
testType {
|
42
|
-
name
|
43
|
-
}
|
44
|
-
}
|
45
|
-
}
|
46
|
-
}
|
47
|
-
}
|
48
|
-
GRAPHQL
|
49
|
-
|
50
|
-
def self.get_test_execution(issue, headers, url)
|
51
|
-
@issue, @headers, @url = issue, headers, url
|
52
|
-
Graph::Client.query(TestExecution)
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|