Project

General

Profile

action #72082

Reduce test runtime, e.g. less reliance on test fixtures or test database instances

Added by okurz 4 months ago. Updated 2 months ago.

Status:
Feedback
Priority:
Low
Assignee:
Category:
Feature requests
Target version:
Start date:
2020-09-18
Due date:
% Done:

0%

Estimated time:
Difficulty:

Description

Motivation

Our tests can run very long which affects feedback cycles. We have many integration tests always initializing a test database with schema. Maybe we can improve by relying less on test fixtures or even completely on test database instances

Acceptance criteria

  • AC1: All tests have been reviewed for their use of fixtures and the test database
  • AC2: Test databases are only instantiated where explicitly needed
  • AC3: Test databases are only initialized with data that is actually needed for specific tests

Suggestions

  • Find all tests that instantiate a test database with fixtures and try instead to use initialization of only necessary data
  • Find all tests that instantiate a test database and try instead to use instantiation of data objects directly instead of using a database
  • Optional: Rework tests to not need a database at all anymore

Related issues

Copied from openQA Project - action #71500: Potential optimization by skipping deployment checks in our tests (all except explicit deployment check tests)Resolved2020-09-18

History

#1 Updated by okurz 4 months ago

  • Copied from action #71500: Potential optimization by skipping deployment checks in our tests (all except explicit deployment check tests) added

#2 Updated by okurz 4 months ago

#3 Updated by cdywan 3 months ago

okurz wrote:

We are down on the use of fixtures in most tests now, and the redundant initialization of the db in Selenium tests is also gone.

That last PR is still an open draft. Are you planning to pursue this further?
Arguably it's a cosmetic fix since it's not removing fixtures but merely adjusting the defaults. So leaving it as-is would make sense to me as well.

#4 Updated by okurz 3 months ago

cdywan wrote:

That last PR is still an open draft. Are you planning to pursue this further?

yeah, you know how it is with "Low" tickets :) Eventually I would still like to have that in.

#5 Updated by okurz 2 months ago

https://github.com/os-autoinst/openQA/pull/3421 is merged meanwhile. I did work on https://github.com/os-autoinst/openQA/pull/3416 but then was annoyed by circleCI failing often (handled in other ticket). I looked into this the past days and continued with tiny steps.

Also available in: Atom PDF