Skip to content
Snippets Groups Projects
Select Git revision
  • eju/gitaly/6506/6640/prepare-offloading
  • qmnguyen0711/add-go-1.24-to-test-matrix
  • qmnguyen0711/backfill-missing-fsync-when-writing-manifest
  • 6628-persistent-routing-table
  • qmnguyen0711/integrate-etcd-raft-with-transactions-v2
  • feat/repo-assignment-migration
  • master default protected
  • kn-fix-migration-context
  • sh-limit-praefect-connection-age
  • ec/raft-snapshotting-streaming
  • activate-bundle-uri-generation
  • jc/my-branch
  • mbayar/bump-minimum-go-version
  • 6270-restore-partition
  • jliu/bump-module-version-to-v17
  • mb-fix-crypto-vuln
  • 17-7-stable protected
  • 17-8-stable protected
  • 17-9-stable protected
  • gitaly-renovate-tools/golangci-lint/golang.org-x-tools-0.x
  • v17.7.6 protected
  • v17.8.4 protected
  • v17.9.1 protected
  • v17.8.3 protected
  • v17.7.5 protected
  • v17.9.0 protected
  • v17.9.0-rc42 protected
  • v17.6.5 protected
  • v17.7.4 protected
  • v17.8.2 protected
  • v17.6.4 protected
  • v17.7.3 protected
  • v17.8.1 protected
  • v17.8.0 protected
  • v17.7.2 protected
  • v17.8.0-rc42 protected
  • v17.5.5 protected
  • v17.6.3 protected
  • v17.7.1 protected
  • v17.7.0 protected
40 results

hooks_test.go

  • Patrick Steinhardt's avatar
    d8b43e95
    testhelper: Unify setup of test suites · d8b43e95
    Patrick Steinhardt authored
    Setup of a test package's main function is quite repetitive: we call a
    separate `testMain()` function such that we can use `defer` calls, this
    function calls `MustHaveNoChildProcess()` and `Configure()`, and then we
    return the result of `m.Run()`. This is almost always exactly the same,
    with some exceptions where we need to have additional setup code.
    
    Unify this code via a single `testhelper.Run()` function which does all
    of this. It allows us greater flexibility in the setup code such that we
    can easily perform additional validation after the tests without having
    to modify all callsites.
    
    Note that this change removes calls to the goleak package in some
    places. These will resurface in a later commit in this patch series,
    where we instead move this call into `testhelper.Run()` such that it is
    executed by default.
    d8b43e95
    History
    testhelper: Unify setup of test suites
    Patrick Steinhardt authored
    Setup of a test package's main function is quite repetitive: we call a
    separate `testMain()` function such that we can use `defer` calls, this
    function calls `MustHaveNoChildProcess()` and `Configure()`, and then we
    return the result of `m.Run()`. This is almost always exactly the same,
    with some exceptions where we need to have additional setup code.
    
    Unify this code via a single `testhelper.Run()` function which does all
    of this. It allows us greater flexibility in the setup code such that we
    can easily perform additional validation after the tests without having
    to modify all callsites.
    
    Note that this change removes calls to the goleak package in some
    places. These will resurface in a later commit in this patch series,
    where we instead move this call into `testhelper.Run()` such that it is
    executed by default.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.