Blazemeter / taurus

@@ -218,9 +218,24 @@
Loading
218 218
        bm_settings.update(module.settings)
219 219
        module.settings = bm_settings
220 220
221 -
    def prepare(self):
221 +
    def _validate_passfail(self):
222 222
        reporting = self.engine.config.get(Reporter.REP)
223 +
        validate_passfail = any(reporter.get('module') == 'passfail' for reporter in reporting)
224 +
        if validate_passfail:
225 +
            if self.router._test.started_passfail_validation():
226 +
                timeout = 100
227 +
                for i in range(timeout):
228 +
                    if self.router._test.get_passfail_validation():
229 +
                        return
230 +
                    self.log.warning(f"Unsuccessful Passfail validation attempt [{i + 1}]. Retrying...")
231 +
                    if not i % 10:
232 +
                        self.log.warning("Please keep in mind that validation can take time.")
233 +
                    sleep(1)
234 +
                self.log.error("Unable get Passfail validation!")
235 +
            else:
236 +
                self.log.error("Unable to validate Passfail configuration!")
223 237
238 +
    def prepare(self):
224 239
        CloudProvisioning.merge_with_blazemeter_config(self)
225 240
        CloudProvisioning.configure_client(self)
226 241
        self._workspaces = self.user.accounts().workspaces()
@@ -237,9 +252,6 @@
Loading
237 252
        is_execution_empty = not self.engine.config.get("execution")
238 253
        self.launch_existing_test = self.settings.get("launch-existing-test", is_execution_empty, force_set=True)
239 254
240 -
        if not self.launch_existing_test:
241 -
            self._filter_reporting()
242 -
243 255
        finder = ProjectFinder(self.parameters, self.settings, self.user, self._workspaces, self.log)
244 256
        finder.default_test_name = "Taurus Cloud Test"
245 257
@@ -267,19 +279,21 @@
Loading
267 279
268 280
            res_files = self.get_rfiles()
269 281
            files_for_cloud = self._fix_filenames(res_files)
270 -
282 +
            self._filter_reporting("blazemeter")    # must not be sent to cloud
271 283
            config_for_cloud = self.prepare_cloud_config()
272 284
            config_for_cloud.dump(self.engine.create_artifact("cloud", ""))
273 285
            del_files = self.settings.get("delete-test-files", True)
274 286
            self.router.resolve_test(config_for_cloud, files_for_cloud, del_files)
275 287
276 288
        self.router.sanitize_test()
289 +
        self._validate_passfail()
277 290
278 291
        self.report_name = self.settings.get("report-name", self.report_name)
279 292
        if self.report_name == 'ask' and sys.stdin.isatty():
280 293
            self.report_name = input("Please enter report-name: ")
281 294
282 295
        self.widget = self.get_widget()
296 +
        self._filter_reporting("passfail")  # must be sent to claud for conversion
283 297
284 298
        if self.engine.is_functional_mode():
285 299
            self.results_reader = FunctionalBZAReader(self.log)
@@ -289,22 +303,6 @@
Loading
289 303
            self.results_reader.log = self.log
290 304
            self.engine.aggregator.add_underling(self.results_reader)
291 305
292 -
        validate_passfail = any(reporter.get('module') == 'passfail' for reporter in reporting)
293 -
294 -
        if validate_passfail:
295 -
            if self.router._test.started_passfail_validation():
296 -
                timeout = 100
297 -
                for i in range(timeout):
298 -
                    if self.router._test.get_passfail_validation():
299 -
                        return
300 -
                    self.log.warning(f"Unsuccessful Passfail validation attempt [{i+1}]. Retrying...")
301 -
                    if not i % 10:
302 -
                        self.log.warning("Please keep in mind that validation can take time.")
303 -
                    sleep(1)
304 -
                self.log.error("Unable get Passfail validation!")
305 -
            else:
306 -
                self.log.error("Unable to validate Passfail configuration!")
307 -
308 306
    @staticmethod
309 307
    def _get_other_modules(config):
310 308
        used_classes = LocalClient.__name__, BlazeMeterUploader.__name__
@@ -388,14 +386,14 @@
Loading
388 386
            self.log.warning("Dumping available locations instead of running the test:\n%s", table.table)
389 387
            raise NormalShutdown("Done listing locations")
390 388
391 -
    def _filter_reporting(self):
389 +
    def _filter_reporting(self, mod_name):
392 390
        reporting = self.engine.config.get(Reporter.REP, [])
393 391
        new_reporting = []
394 392
        for index, reporter in enumerate(reporting):
395 393
            exc = TaurusConfigError("'module' attribute not found in %s" % reporter)
396 394
            cls = reporter.get('module', exc)
397 -
            if cls == "blazemeter":
398 -
                self.log.warning("Explicit blazemeter reporting is skipped for cloud")
395 +
            if cls == mod_name:
396 +
                self.log.debug(f"Remove {mod_name} for Cloud provisioning: {reporter}")
399 397
            else:
400 398
                new_reporting.append(reporter)
401 399
Files Coverage
bzt 90.15%
Project Totals (69 files) 90.15%
9330.2
TRAVIS_PYTHON_VERSION=3.8
TRAVIS_OS_NAME=linux
1
codecov:
2
  notify:
3
    require_ci_to_pass: yes
4

5
coverage:
6
  round: up
7

8
ignore:
9
  - bzt/resources
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading