fastlane-plugin-test_report 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 87a3953157074566d1e54629314654237874083338ea65e2b68a67f290c4b94d
4
+ data.tar.gz: bd38cdb3d5a563907d2c06122439e6828aa68630ed2f87a23d9e95196874fc2c
5
+ SHA512:
6
+ metadata.gz: b8fe2235fa6cbce222608144437e58fa37b22cbd346f274610963a75f5d8e3b830b66f9216d8c1558161ef9a6e22d9ae5770decc630a4956072b7a0144d15bf7
7
+ data.tar.gz: 0dfc16a57825bdf38520605a4657d35388157b9cfb1e31cadaa5d447bdcc3fc2cc968b534ee6b1f5e6f1a674420854dbda66a9786d4bb4fb4a9806c6734a86ed
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Teclib'
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,89 @@
1
+ # Test Report plugin for Fastlane
2
+
3
+ ![Teclib' Banner](https://user-images.githubusercontent.com/29282308/31669540-abed67a8-b355-11e7-98e2-0ad190f37088.png)
4
+
5
+ [![License MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/TECLIB/fastlane-plugin-test_report/blob/develop/LICENSE.md)
6
+ [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-test_report)
7
+ [![Telegram Community](https://img.shields.io/badge/Telegram-Community-blue.svg)](https://t.me/flyvemdm)
8
+ [![IRC Chat](https://img.shields.io/badge/IRC-%23flyvemdm-green.svg)](http://webchat.freenode.net/?channels=flyve-mdm)
9
+ [![Follow twitter](https://img.shields.io/badge/Twitter-Teclib%27-940CA5.svg)](https://twitter.com/teclib)
10
+ [![Project Status: Active](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)
11
+ [![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
12
+
13
+ ## Table of Contents
14
+
15
+ * [Synopsis](#synopsis)
16
+ * [Build Status](#build-status)
17
+ * [Installation](#installation)
18
+ * [Examples](#examples)
19
+ * [Documentation](#documentation)
20
+ * [Versioning](#versioning)
21
+ * [Contact](#contact)
22
+ * [Professional Services](#professional-services)
23
+ * [Contribute](#contribute)
24
+ * [Copying](#copying)
25
+
26
+ ## Synopsis
27
+
28
+ Create a customized HTML for iOS test reports from an XML file.
29
+
30
+ ## Build Status
31
+
32
+ |**LTS**|**Bleeding Edge**|
33
+ |:---:|:---:|
34
+ |[![Circle CI build](https://circleci.com/gh/TECLIB/fastlane-plugin-test_report/tree/master.svg?style=svg)](https://circleci.com/gh/TECLIB/fastlane-plugin-test_report/tree/master)|[![Circle CI build](https://circleci.com/gh/TECLIB/fastlane-plugin-test_report/tree/develop.svg?style=svg)](https://circleci.com/gh/TECLIB/fastlane-plugin-test_report/tree/develop)|
35
+
36
+ ## Installation
37
+
38
+ This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-test_report`, add it to your project by running:
39
+
40
+ ```bash
41
+ fastlane add_plugin test_report
42
+ ```
43
+
44
+ Or add in your Pluginfile, and then run bundle install
45
+
46
+ ```gem 'fastlane-plugin-test_report'```
47
+
48
+ ## Examples
49
+
50
+ Check these repositories:
51
+
52
+ * [Flyve MDM iOS Inventory Agent](https://github.com/flyve-mdm/ios-inventory-agent)
53
+ * [Flyve MDM iOS MDM Agent](https://github.com/flyve-mdm/ios-mdm-agent)
54
+ * [Flyve MDM iOS MDM Dashboard](https://github.com/flyve-mdm/ios-mdm-dashboard)
55
+ * [Flyve MDM iOS Inventory Library](https://github.com/flyve-mdm/ios-inventory-library)
56
+
57
+ ## Documentation
58
+
59
+ We maintain a detailed documentation on the project site, check the [How-tos](https://teclib.github.io/fastlane-plugin-test_report/howtos/) and [Development](https://teclib.github.io/fastlane-plugin-test_report/) section.
60
+
61
+ ## Versioning
62
+
63
+ In order to provide transparency on our release cycle and to maintain backward compatibility, this project is maintained under [the Semantic Versioning guidelines](http://semver.org/). We are committed to following and complying with the rules, the best we can.
64
+
65
+ See [the tags section of our GitHub project](https://github.com/TECLIB/fastlane-plugin-test_report/releases) for changelogs for each release version. Release announcement posts on [the official Teclib' blog](http://www.teclib-edition.com/en/communities/blog-posts/) contain summaries of the most noteworthy changes made in each release.
66
+
67
+ ## Contact
68
+
69
+ For notices about major changes and general discussion of development, subscribe to the [/r/flyvemdm](http://www.reddit.com/r/flyvemdm) subreddit.
70
+ You can also chat with us via IRC in [#flyve-mdm on freenode](http://webchat.freenode.net/?channels=flyve-mdm) if you get stuck, and [@flyvemdm on Telegram](https://t.me/flyvemdm).
71
+
72
+ ## Professional Services
73
+
74
+ The Teclib' services are available through our [Partner's Network](http://www.teclib-edition.com/en/partners/). We provide special training, bug fixes with editor subscription, contributions for new features, and more.
75
+
76
+ Obtain a personalized service experience, associated with benefits and opportunities.
77
+
78
+ ## Contribute
79
+
80
+ Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our
81
+ guidelines for [contributing](https://github.com/TECLIB/fastlane-plugin-test_report/blob/develop/.github/CONTRIBUTING.md) and then check out one of our issues in the [Issues Dashboard](https://github.com/TECLIB/fastlane-plugin-test_report/issues).
82
+
83
+ ## Copying
84
+
85
+ * **Name**: [Flyve MDM](https://flyve-mdm.com/) is a registered trademark of [Teclib'](http://www.teclib-edition.com/en/).
86
+ * **Name**: [GLPI](http://glpi-project.org/) is a registered trademark of [Teclib'](http://www.teclib-edition.com/en/).
87
+ * **Code**: you can redistribute it and/or modify
88
+ it under the terms of the [MIT](https://opensource.org/licenses/MIT).
89
+ * **Documentation**: released under Attribution 4.0 International ([CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)).
@@ -0,0 +1,16 @@
1
+ require 'fastlane/plugin/test_report/version'
2
+
3
+ module Fastlane
4
+ module TestReport
5
+ # Return all .rb files inside the "actions" and "helper" directory
6
+ def self.all_classes
7
+ Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
8
+ end
9
+ end
10
+ end
11
+
12
+ # By default we want to import all available actions and helpers
13
+ # A plugin can contain any number of actions and plugins
14
+ Fastlane::TestReport.all_classes.each do |current|
15
+ require current
16
+ end
@@ -0,0 +1,127 @@
1
+ require 'fastlane/action'
2
+ require_relative '../helper/test_report_helper'
3
+ require "erb"
4
+ require "rexml/document"
5
+
6
+ module Fastlane
7
+ module Actions
8
+ class TestReportAction < Action
9
+ def self.run(params)
10
+ UI.message("The test_report plugin is working!")
11
+
12
+ include REXML
13
+
14
+ file = File.new(File.expand_path(params[:report_path]))
15
+ doc = Document.new(file)
16
+
17
+ if params[:template_path].nil?
18
+ template = '---
19
+ layout: testReport
20
+ ---
21
+
22
+ <div class="total row">
23
+ <h2 class="col-sm-18">Test Results</h2>
24
+ <h2 class="col-sm-6 text-right"><%= doc.root.attributes["tests"] %> tests</h2>
25
+ </div>
26
+ <div>
27
+ <% i = 0 %>
28
+ <% doc.elements.each("testsuites/testsuite") do |name| %>
29
+ <% i = i + 1 %>
30
+ <% if name.attributes["failures"] == "0" %>
31
+ <div class="test-suite row test-suite--passing" onclick="changeDisplay(<%= "\'#test-#{i}\'"%>)">
32
+ <% else %>
33
+ <div class="test-suite row test-suite--failing" onclick="changeDisplay(<%= "\'#test-#{i}\'"%>)">
34
+ <% end %>
35
+ <h4 class="col-sm-20"><%= name.attributes["name"] %></h4>
36
+ <h4 class="col-sm-4 text-right"><%= name.attributes["tests"] %> tests</h4>
37
+ </div>
38
+ <!-- Failing or passing class -->
39
+ <div id="<%= "test-#{i}"%>">
40
+
41
+ <% doc.elements.each("testsuites/testsuite/testcase") do |test| %>
42
+ <% if test.attributes["classname"] == name.attributes["name"] %>
43
+
44
+ <% if test.attributes["time"] == nil %>
45
+ <div class="test-case--failing row">
46
+ <div class="col-sm-16">
47
+ <p><%= test.attributes["name"] %></p>
48
+ </div>
49
+ <div class="col-sm-4">
50
+ <p><%= test.elements["failure"].attributes["message"] %></p>
51
+ </div>
52
+ <div class="col-sm-4 text-right">
53
+ <p><%= test.elements["failure"].text %></p>
54
+ </div>
55
+ </div>
56
+ <% else %>
57
+ <div class="test-case--passing row">
58
+ <div class="col-sm-20">
59
+ <p><%= test.attributes["name"] %></p>
60
+ </div>
61
+ <div class="col-sm-4 text-right">
62
+ <p><%= test.attributes["time"] %></p>
63
+ </div>
64
+ </div>
65
+ <% end %>
66
+ <% end %>
67
+ <% end %>
68
+ </div>
69
+ <% end %>
70
+
71
+ </div>'
72
+ else
73
+ template = File.read(params[:template_path])
74
+ end
75
+
76
+ result = ERB.new(template).result(binding())
77
+
78
+ open(File.join(params[:output_dir], '/index.html'), 'w') do |f|
79
+ f.puts(result)
80
+ end
81
+ end
82
+
83
+ def self.description
84
+ "Create customized HTML template for test reports"
85
+ end
86
+
87
+ def self.authors
88
+ ["Naylin Medina"]
89
+ end
90
+
91
+ def self.return_value
92
+ # If your method provides a return value, you can describe here what it does
93
+ end
94
+
95
+ def self.details
96
+ # Optional:
97
+ "Create HTML for test reports"
98
+ end
99
+
100
+ def self.available_options
101
+ [
102
+ FastlaneCore::ConfigItem.new(key: :report_path,
103
+ env_name: "TEST_REPORT_PATH",
104
+ description: "Path to the test report",
105
+ optional: false),
106
+ FastlaneCore::ConfigItem.new(key: :output_dir,
107
+ env_name: "OUTPUT_DIR",
108
+ description: "Output path for file",
109
+ optional: false),
110
+ FastlaneCore::ConfigItem.new(key: :template_path,
111
+ env_name: "TEMPLATE_PATH",
112
+ description: "Path to the template",
113
+ type: String,
114
+ optional: true)
115
+ ]
116
+ end
117
+
118
+ def self.is_supported?(platform)
119
+ # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
120
+ # See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
121
+ #
122
+ # [:ios, :mac, :android].include?(platform)
123
+ true
124
+ end
125
+ end
126
+ end
127
+ end
@@ -0,0 +1,16 @@
1
+ require 'fastlane_core/ui/ui'
2
+
3
+ module Fastlane
4
+ UI = FastlaneCore::UI unless Fastlane.const_defined?("UI")
5
+
6
+ module Helper
7
+ class TestReportHelper
8
+ # class methods that you define here become available in your action
9
+ # as `Helper::TestReportHelper.your_method`
10
+ #
11
+ def self.show_message
12
+ UI.message("Hello from the test_report plugin helper!")
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,5 @@
1
+ module Fastlane
2
+ module TestReport
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,175 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fastlane-plugin-test_report
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Naylin Medina
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-11-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: pry
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec_junit_formatter
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '='
88
+ - !ruby/object:Gem::Version
89
+ version: 0.49.1
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '='
95
+ - !ruby/object:Gem::Version
96
+ version: 0.49.1
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop-require_tools
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: simplecov
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: fastlane
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: 2.105.2
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: 2.105.2
139
+ description:
140
+ email: nmedina@teclib.com
141
+ executables: []
142
+ extensions: []
143
+ extra_rdoc_files: []
144
+ files:
145
+ - LICENSE.md
146
+ - README.md
147
+ - lib/fastlane/plugin/test_report.rb
148
+ - lib/fastlane/plugin/test_report/actions/test_report_action.rb
149
+ - lib/fastlane/plugin/test_report/helper/test_report_helper.rb
150
+ - lib/fastlane/plugin/test_report/version.rb
151
+ homepage: https://github.com/TECLIB/fastlane-plugin-test_report
152
+ licenses:
153
+ - MIT
154
+ metadata: {}
155
+ post_install_message:
156
+ rdoc_options: []
157
+ require_paths:
158
+ - lib
159
+ required_ruby_version: !ruby/object:Gem::Requirement
160
+ requirements:
161
+ - - ">="
162
+ - !ruby/object:Gem::Version
163
+ version: '0'
164
+ required_rubygems_version: !ruby/object:Gem::Requirement
165
+ requirements:
166
+ - - ">="
167
+ - !ruby/object:Gem::Version
168
+ version: '0'
169
+ requirements: []
170
+ rubyforge_project:
171
+ rubygems_version: 2.7.7
172
+ signing_key:
173
+ specification_version: 4
174
+ summary: "customized template for iOS test reports\e"
175
+ test_files: []