diff --git a/LICENSE b/LICENSE index dd5ef89846..d645695673 100644 --- a/LICENSE +++ b/LICENSE @@ -1,22 +1,202 @@ -The MIT License (MIT) -Copyright (c) 2015 BlazeMeter + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. + 1. Definitions. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/MANIFEST.in b/MANIFEST.in index 65642f224f..e34549936a 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1,3 @@ include bzt/10-base.json +include LICENSE +include NOTICE \ No newline at end of file diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000000..71915b7601 --- /dev/null +++ b/NOTICE @@ -0,0 +1,15 @@ +Codename: Taurus + +Copyright 2015 BlazeMeter Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. \ No newline at end of file diff --git a/README.md b/README.md index d997c4db61..4f2c4db44a 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Test automation running smoothly ## Purpose -A tool to hide the complexity of tests under automation-friendly convenience wrapper. More info about its features available [here](docs/Features.md). +A tool to hide the complexity of tests under automation-friendly convenience wrapper. More info about its features available [here](docs/Features.md). Project is licensed under Apache 2.0 License. ![CLI dashboard and BlazeMeter Report](cli-bza.png) diff --git a/bzt/__init__.py b/bzt/__init__.py index 724f0a6d34..0cfb0ee375 100644 --- a/bzt/__init__.py +++ b/bzt/__init__.py @@ -1,5 +1,17 @@ """ -Some meta-info and simple classes +Copyright 2015 BlazeMeter Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. """ version = "0.1.8" diff --git a/bzt/cli.py b/bzt/cli.py index 70dde15942..fce7f76ee2 100755 --- a/bzt/cli.py +++ b/bzt/cli.py @@ -1,6 +1,20 @@ #! /usr/bin/env python """ CLI tool wrapper to run Engine using command-line interface + +Copyright 2015 BlazeMeter Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. """ from logging import Formatter, FileHandler from optparse import OptionParser, BadOptionError, Option diff --git a/bzt/engine.py b/bzt/engine.py index e558a5ad3f..8a0db1ab72 100644 --- a/bzt/engine.py +++ b/bzt/engine.py @@ -1,4 +1,20 @@ -""" Main BZT classes """ +""" +Main BZT classes + +Copyright 2015 BlazeMeter Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" import ConfigParser from UserDict import DictMixin from collections import namedtuple diff --git a/bzt/modules/__init__.py b/bzt/modules/__init__.py index e767f777cd..ab657ed05a 100644 --- a/bzt/modules/__init__.py +++ b/bzt/modules/__init__.py @@ -1,5 +1,19 @@ """ Modules package holds EngineModule implementations + +Copyright 2015 BlazeMeter Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. """ diff --git a/bzt/modules/aggregator.py b/bzt/modules/aggregator.py index 2afcdb8a4c..1f719df80c 100644 --- a/bzt/modules/aggregator.py +++ b/bzt/modules/aggregator.py @@ -1,4 +1,20 @@ -""" Aggregating results into DataPoints """ +""" +Aggregating results into DataPoints + +Copyright 2015 BlazeMeter Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" from collections import Counter import copy import logging diff --git a/bzt/modules/blazemeter.py b/bzt/modules/blazemeter.py index 167819e8b7..075a52575a 100644 --- a/bzt/modules/blazemeter.py +++ b/bzt/modules/blazemeter.py @@ -1,5 +1,19 @@ """ Module for reporting into http://www.blazemeter.com/ service + +Copyright 2015 BlazeMeter Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. """ import json import logging @@ -220,7 +234,7 @@ def start_online(self, test_id): if self.token: self.results_url = self.address + '/app/#reports/%s' % self.active_session_id else: - self.test_id=resp['result']['session']['testId'] + self.test_id = resp['result']['session']['testId'] self.results_url = resp['result']['publicTokenUrl'] return self.results_url diff --git a/bzt/modules/console.py b/bzt/modules/console.py index 493a6e4907..aa20203c48 100644 --- a/bzt/modules/console.py +++ b/bzt/modules/console.py @@ -1,5 +1,20 @@ # coding=utf-8 """ +Copyright 2015 BlazeMeter Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" +""" Console reporting for CLI usage """ import re diff --git a/bzt/modules/gatling.py b/bzt/modules/gatling.py index ffe7124e2d..1e8166d8ff 100644 --- a/bzt/modules/gatling.py +++ b/bzt/modules/gatling.py @@ -1,5 +1,19 @@ """ Module holds all stuff regarding Gatling tool usage + +Copyright 2015 BlazeMeter Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. """ import os import re @@ -16,6 +30,7 @@ from bzt.utils import shell_exec from bzt.utils import unzip, download_progress_hook + exe_suffix = ".bat" if platform.system() == 'Windows' else ".sh" @@ -189,13 +204,13 @@ def __install_gatling(self, gatling_path): download_link = download_link.format(version=version) self.log.info("Downloading %s", download_link) # TODO: check archive checksum/hash before unzip and run - + try: downloader.retrieve(download_link, gatling_zip_path, download_progress_hook) except BaseException as e: self.log.error("Error while downloading %s", download_link) raise e - + self.log.info("Unzipping %s", gatling_zip_path) unzip(gatling_zip_path, dest, 'gatling-charts-highcharts-bundle-' + version) os.remove(gatling_zip_path) diff --git a/bzt/modules/grinder.py b/bzt/modules/grinder.py index 7b52e38975..f9695b74f9 100644 --- a/bzt/modules/grinder.py +++ b/bzt/modules/grinder.py @@ -1,26 +1,41 @@ """ Module holds all stuff regarding Grinder tool usage + +Copyright 2015 BlazeMeter Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. """ import os import time import signal - -from bzt.engine import ScenarioExecutor, Scenario -from bzt.modules.aggregator import ConsolidatingAggregator, ResultsReader -from bzt.utils import shell_exec import subprocess from subprocess import CalledProcessError import traceback import urllib + +from bzt.engine import ScenarioExecutor, Scenario +from bzt.modules.aggregator import ConsolidatingAggregator, ResultsReader +from bzt.utils import shell_exec from bzt.utils import unzip, download_progress_hook + class GrinderExecutor(ScenarioExecutor): """ Grinder executor module """ DOWNLOAD_LINK = "http://switch.dl.sourceforge.net/project/grinder/The%20Grinder%203/{version}/grinder-{version}-binary.zip" VERSION = "3.11" - + def __init__(self): super(GrinderExecutor, self).__init__() self.script = None @@ -98,8 +113,8 @@ def prepare(self): """ scenario = self.get_scenario() # TODO: install the tool if missing, just like JMeter - - + + self.__check_grinder() if Scenario.SCRIPT in scenario: @@ -129,14 +144,14 @@ def startup(self): """ Should start the tool as fast as possible. """ - #cmdline = "java -classpath " + os.path.dirname(__file__) - #cmdline += os.path.pathsep + os.path.realpath(self.settings.get("path")) - #cmdline += os.path.sep + "lib" + os.path.sep + "grinder.jar" - #cmdline += " net.grinder.Grinder " + self.properties_file - + # cmdline = "java -classpath " + os.path.dirname(__file__) + # cmdline += os.path.pathsep + os.path.realpath(self.settings.get("path")) + # cmdline += os.path.sep + "lib" + os.path.sep + "grinder.jar" + # cmdline += " net.grinder.Grinder " + self.properties_file + cmdline = "java -classpath " + self.settings.get("path") cmdline += " net.grinder.Grinder " + self.properties_file - + self.start_time = time.time() out = self.engine.create_artifact("grinder-stdout", ".log") err = self.engine.create_artifact("grinder-stderr", ".log") @@ -214,17 +229,17 @@ def __scenario_from_requests(self): def __grinder(self, grinder_full_path): """Check if grinder installed""" - #java -classpath /home/user/Downloads/grinder-3.11/lib/grinder.jar net.grinder.Grinder --help - #CHECK ERRORLEVEL TO BE SURE + # java -classpath /home/user/Downloads/grinder-3.11/lib/grinder.jar net.grinder.Grinder --help + # CHECK ERRORLEVEL TO BE SURE self.log.debug("Trying grinder: %s", grinder_full_path) grinder_launch_command = ["java", "-classpath", grinder_full_path, "net.grinder.Grinder"] - #print "grinder_launch command:", grinder_launch_command + # print "grinder_launch command:", grinder_launch_command grinder_subprocess = subprocess.Popen(grinder_launch_command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) _process_output = grinder_subprocess.communicate()[0] - + if grinder_subprocess.returncode != 0: raise CalledProcessError(grinder_subprocess.returncode, " ".join(grinder_launch_command)) - #grinder_subprocess = subprocess.check_output(["java -classpath " + grinder_full_path + "grinder.jar net.grinder.Grinder", '--help'], stderr=subprocess.STDOUT) + # grinder_subprocess = subprocess.check_output(["java -classpath " + grinder_full_path + "grinder.jar net.grinder.Grinder", '--help'], stderr=subprocess.STDOUT) self.log.debug("grinder check: %s", _process_output) def __check_grinder(self): @@ -233,23 +248,23 @@ def __check_grinder(self): """ grinder_path = self.settings.get("path", "~/grinder-taurus/lib/grinder.jar") grinder_path = os.path.abspath(os.path.expanduser(grinder_path)) - + try: self.__grinder(grinder_path) return except (OSError, CalledProcessError), exc: self.log.debug("Failed to run grinder: %s", traceback.format_exc(exc)) - + try: jout = subprocess.check_output(["java", '-version'], stderr=subprocess.STDOUT) self.log.debug("Java check: %s", jout) except BaseException, exc: self.log.warn("Failed to run java: %s", traceback.format_exc(exc)) raise RuntimeError("The 'java' is not operable or not available. Consider installing it") - + self.settings['path'] = self.__install_grinder(grinder_path) self.__grinder(self.settings['path']) - + def __install_grinder(self, grinder_path): """ Installs Grinder. @@ -257,32 +272,32 @@ def __install_grinder(self, grinder_path): "download-link":"http://blah-{version}.zip" "version":"1.2.3" """ - + dest = os.path.dirname(os.path.dirname(os.path.expanduser(grinder_path))) if not dest: dest = os.path.expanduser("~/grinder-taurus") dest = os.path.abspath(dest) grinder_full_path = dest + os.path.sep + "lib" + os.path.sep + "grinder.jar" - #grinder_full_path - /home/username/grinder-taurus/grinder-3.11/lib/grinder.jar + # grinder_full_path - /home/username/grinder-taurus/grinder-3.11/lib/grinder.jar try: self.__grinder(grinder_full_path) return grinder_full_path except CalledProcessError: self.log.info("Will try to install grinder into %s", dest) - + downloader = urllib.FancyURLopener() grinder_zip_path = self.engine.create_artifact("grinder-dist", ".zip") version = self.settings.get("version", GrinderExecutor.VERSION) download_link = self.settings.get("download-link", GrinderExecutor.DOWNLOAD_LINK) download_link = download_link.format(version=version) self.log.info("Downloading %s", download_link) - + try: downloader.retrieve(download_link, grinder_zip_path, download_progress_hook) except BaseException as e: self.log.error("Error while downloading %s", download_link) raise e - + self.log.info("Unzipping %s", grinder_zip_path) unzip(grinder_zip_path, dest, 'grinder-' + version) os.remove(grinder_zip_path) diff --git a/bzt/modules/jmeter.py b/bzt/modules/jmeter.py index fc83ab15f6..7a3feecbf0 100644 --- a/bzt/modules/jmeter.py +++ b/bzt/modules/jmeter.py @@ -1,5 +1,19 @@ """ Module holds all stuff regarding JMeter tool usage + +Copyright 2015 BlazeMeter Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. """ from collections import Counter from lxml import etree diff --git a/bzt/modules/loadosophia.py b/bzt/modules/loadosophia.py index 8f9598198e..fbfe11593b 100644 --- a/bzt/modules/loadosophia.py +++ b/bzt/modules/loadosophia.py @@ -1,5 +1,19 @@ """ Module for reporting into http://loadosophia.org/ service + +Copyright 2015 BlazeMeter Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. """ import cookielib import gzip diff --git a/bzt/modules/passfail.py b/bzt/modules/passfail.py index 31374a396d..b21d6bc70a 100644 --- a/bzt/modules/passfail.py +++ b/bzt/modules/passfail.py @@ -1,5 +1,19 @@ """ Test failure criteria and auto-stopping + +Copyright 2015 BlazeMeter Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. """ import fnmatch import logging diff --git a/bzt/modules/provisioning.py b/bzt/modules/provisioning.py index 95a522e7d1..2ccfa00169 100644 --- a/bzt/modules/provisioning.py +++ b/bzt/modules/provisioning.py @@ -1,7 +1,21 @@ """ Implementations for `Provisioning` classes + +Copyright 2015 BlazeMeter Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. """ -# TODO: allow sequential executions? +# NOTE: allow sequential executions? Nah... from bzt.engine import Provisioning diff --git a/bzt/modules/reporting.py b/bzt/modules/reporting.py index 651cbd0194..bdfb1fb8e4 100644 --- a/bzt/modules/reporting.py +++ b/bzt/modules/reporting.py @@ -1,4 +1,20 @@ -""" Basics of reporting capabilities """ +""" +Basics of reporting capabilities + +Copyright 2015 BlazeMeter Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" from bzt.modules.aggregator import DataPoint, KPISet diff --git a/bzt/utils.py b/bzt/utils.py index 4872eaabf9..19c540fc30 100644 --- a/bzt/utils.py +++ b/bzt/utils.py @@ -1,5 +1,19 @@ """ Every project needs its trash heap of miscellaneous functions and classes + +Copyright 2015 BlazeMeter Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. """ from collections import defaultdict, Counter import csv diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 8948641a8f..c091c68c77 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -1,6 +1,7 @@ # Rules for Contributing 1. All contributions goes through pull requests 1.1 Most of pyling warnings should be fixed before accepting pull request + 1.2 All new files must contain Apache License header (unit test files may not have it) 2. All changes must be covered with unit tests 3. All changes must be reflected in [Changelog](Changelog) 4. All changes must be properly documented diff --git a/setup.py b/setup.py index 9acd9e6ba1..153a5c2cdf 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,22 @@ +""" +Copyright 2015 BlazeMeter Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +""" import os import shutil import sys + from setuptools import setup from setuptools.command.install import install