Skip to content
Snippets Groups Projects

Added unit test configuration in gitlab-ci

Merged Duncan Macleod requested to merge duncanmmacleod/gracedb:ci-testing into master
All threads resolved!

This merge adds a unit-test gitlab-CI configuration based on pytest-django.

Edited by Duncan Macleod

Merge request reports

Pipeline #59892 passed with warnings

Pipeline passed with warnings for 62cc6ad3 on duncanmmacleod:ci-testing

Approval is optional

Merged by Tanner PrestegardTanner Prestegard 5 years ago (May 1, 2019 7:54pm UTC)

Merge details

  • Changes merged into master with 62cc6ad3.
  • Deleted the source branch.

Pipeline #59915 passed with warnings

Pipeline passed with warnings for 62cc6ad3 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Duncan Macleod added 3 commits

    added 3 commits

    • e391c4f3 - alerts.tests: updated mocks
    • 2293c813 - alerts.tests: create new {super}event for each test
    • ec869e56 - api.v1: fixed bug in test definitions

    Compare with previous version

  • @duncanmmacleod I'm failing to understand the recent changes:

    • I thought you're supposed to mock something "where it's used"? I haven't seen issues with the current arrangement of mocking alerts.twilio_client.
    • No need to switch from setUpTestData to setUp - we are using MySQL with MyISAM (i.e., non-transactional) so setUpTestData is actually run before each test (see the bottom of this section).
    • Why move the call to super() in setUpClass to the bottom of the method? Doesn't that assume the base classes don't do anything which would change the parameters we are setting in the current class?

    Not trying to be annoying, just want to understand!

  • Duncan Macleod added 1 commit

    added 1 commit

    • 801c447c - ligoauth.tests: fixed missing super() call

    Compare with previous version

  • @tanner.prestegard:

    I thought you're supposed to mock something "where it's used"? I haven't seen issues with the current arrangement of mocking alerts.twilio_client.

    I will revert that change for clarity.

    No need to switch from setUpTestData to setUp - we are using MySQL with MyISAM (i.e., non-transactional) so setUpTestData is actually run before each test (see the bottom of this section).

    Ok, my issue is that I am using mysql=5.7 which requires that the storage_engine reference be updated to default_storage_engine. This will resolve a lot of my issues, I think.

    Why move the call to super() in setUpClass to the bottom of the method? Doesn't that assume the base classes don't do anything which would change the parameters we are setting in the current class?

    For a number of classes the variables created in the new setUpClass are required in the setUpTestData() method, so the super() call (which will include the call to setUpTestData() needs to come after those variables are defined.

    However, given your note above about non-transactional behaviour of django, this might be unnecessary.

  • Duncan Macleod added 2 commits

    added 2 commits

    • e8679567 - alerts.tests: updated mocks
    • 4d755fb6 - config.settings: added note about variable name change

    Compare with previous version

  • Duncan Macleod added 1 commit

    added 1 commit

    Compare with previous version

  • Duncan Macleod added 1 commit

    added 1 commit

    Compare with previous version

  • Duncan Macleod added 1 commit

    added 1 commit

    Compare with previous version

  • Duncan Macleod resolved all discussions

    resolved all discussions

  • Please register or sign in to reply
    Loading