testing

Find commit that broke a test without running every test on every commit

放肆的年华 提交于 2021-02-07 08:17:51
问题 I am trying to find a tool that can solve the following problem: Our entire test suite takes hours to runs which often makes it difficult or at least very time consuming to find out which commit broke a specific test since there may be 50 to 200 commits in between test runs. At any given time there are only very few broken tests, so rerunning only the broken tests is very fast compared to running the entire test suite. Is there a tool, e.g. a continuous integration server, that can rerun

Angular 7 - catching HttpErrorResponse in unit tests

感情迁移 提交于 2021-02-07 08:17:41
问题 i'm currently learning Angular 7 (haven't used any previous version) and encountered something i couldn't fix when writing unit tests for a service. I have a service that gets JSON from REST and parses it into a Class. Referring to the Angular Docs, i wrote a test using HttpClientSpy to simulate a 404 Error. What happens: The Test Fails with the Error Message: "expected data.forEach is not a function to contain '404'" So the Service gets the HttpErrorResponse as Input but tries to parse it

Maven failsafe plugin doesn't run parallel Test

大兔子大兔子 提交于 2021-02-07 07:18:44
问题 I have a Maven POM file and when I provide parallel execution options, I dont see any signs of parallel execution in the logs. And XML debugging is driving me nuts. Any thoughts what is wrong here? <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId

Maven failsafe plugin doesn't run parallel Test

别说谁变了你拦得住时间么 提交于 2021-02-07 07:18:22
问题 I have a Maven POM file and when I provide parallel execution options, I dont see any signs of parallel execution in the logs. And XML debugging is driving me nuts. Any thoughts what is wrong here? <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId

Get name of current test in setup using nose

回眸只為那壹抹淺笑 提交于 2021-02-07 06:56:43
问题 I am currently writing some functional tests using nose. The library I am testing manipulates a directory structure. To get reproducible results, I store a template of a test directory structure and create a copy of that before executing a test (I do that inside the tests setup function). This makes sure that I always have a well defined state at the beginning of the test. Now I have two further requirements: If a test fails, I would like the directory structure it operated on to not be

Disabling AVX2 in CPU for testing purposes

*爱你&永不变心* 提交于 2021-02-07 05:40:42
问题 I've got an application that requires AVX2 to work correctly. A check was implemented to check during application start if CPU has AVX2 instruction. I would like to check if it works correctly, but i only have CPU that has AVX2. Is there a way to temporarly turn it off for testing purposes? Or to somehow emulate other CPU? 回答1: Yes, use an "emulation" (or dynamic recompilation) layer like Intel's Software Development Emulator (SDE), or maybe QEMU. SDE is closed-source freeware, and very handy

Capybara open an html file in my computer

流过昼夜 提交于 2021-02-07 04:26:41
问题 I have an html file in my computer and I want to open that file using Capybara to test it. Could you help me to solve this problem? P/S: That html file is created automatically in my app. I do appreciate any idea helping me to solve this problem. Thanks :) UPDATE: Based on the capybara source code here, I found that I should use Capybara.current_session.driver.visit instead of page.visit. The problem is solved 回答1: I can confirm that the update to the question works (assuming the file is in

Capybara open an html file in my computer

你说的曾经没有我的故事 提交于 2021-02-07 04:26:13
问题 I have an html file in my computer and I want to open that file using Capybara to test it. Could you help me to solve this problem? P/S: That html file is created automatically in my app. I do appreciate any idea helping me to solve this problem. Thanks :) UPDATE: Based on the capybara source code here, I found that I should use Capybara.current_session.driver.visit instead of page.visit. The problem is solved 回答1: I can confirm that the update to the question works (assuming the file is in

In pytest, how can I access the parameters passed to a test?

非 Y 不嫁゛ 提交于 2021-02-07 03:21:54
问题 In pytest, I can pass parameters to test (using fixtures or the decorator @pytest.fixture(params=list-of-params) ). When the tests are done, if a test fails, the parameter that was passed is shown on the results, as in TestCheckoutPage.test_address_edit[True] or False if it was false. How can I access those parameters and add them to a finalizer? request.param doesn't seem to work, even though that is how you would get the parameter when making a fixture: @pytest.fixture(params=[True, False])

How to run tests in a class sequentially in ScalaTest?

荒凉一梦 提交于 2021-02-07 03:01:53
问题 I have a class which extends org.scalatest.junit.JUnitSuite. This class has a couple of tests. I do not want these tests to run in parallel. I know how simple it is with Specs2 (extend the class with Specification and add a single line sequential inside the class) as shown here: How to run specifications sequentially. I do not want to alter the Build file by setting: parallelExecution in Test := false nor I want to use tags to run specific test files sequentially. All I want is a way to make