qat-reporter-xray-sa 1.1.0 → 1.1.2
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: 2f1fd926983f54d7e570e8837ab363969f1077e1dbbfc2e7becf77361fa1348f
|
4
|
+
data.tar.gz: 9590f1b3387a0e77f061a61f11f4c5ea717ab13fa7333a356979afdb93c70d5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5270326092bb629829c040af4e7f7910ee8b3342c0a61e8a7c3493590d519609da938eb4007f635934188890b0d31f0904fe8ee8a99b8b7e6d5d491474beeea4
|
7
|
+
data.tar.gz: 19d03854dfbc761f9c77b5bcd5d72164a32cc6ed8c2a9c59b769b001022729f0b15f172ae91e8b96a134476fb1c58da3b368fdee1e27732e718accd2d3d47f03
|
@@ -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,14 +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
|
-
@default_cloud_api_url_graphql = QAT::Reporter::Xray::Config.xray_default_api_url_graphql
|
21
19
|
@cloud_xray_api_credentials = QAT::Reporter::Xray::Config.cloud_xray_api_credentials
|
22
20
|
end
|
23
21
|
|
@@ -38,6 +36,10 @@ module QAT
|
|
38
36
|
}.merge(headers)
|
39
37
|
end
|
40
38
|
|
39
|
+
def cloud_graphql_headers
|
40
|
+
auth_headers
|
41
|
+
end
|
42
|
+
|
41
43
|
private
|
42
44
|
|
43
45
|
# 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.2
|
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
|