Skip to content
Snippets Groups Projects
  • Allen Porter's avatar
    d45501a1
    Use shared envTest for unit tests · d45501a1
    Allen Porter authored
    
    Speed up unit tests by using a shared envTest. This requires each
    test to use its own namespace to avoid clobbering objects for
    other tests. Tests previously took around 8 seconds each, and now
    the initial test takes 2 seconds with follow up tests taking less
    than a second each.
    
    Also update existing tests that use a fixed namespace to use a
    generated namespace.
    
    Share gold file template function with yaml files.
    
    Remove the testClusterMode, and instead rely on MainTest to do
    the appropriate test setup and rootArgs flag setup. Move the
    rootArg flag setup out of NewTestEnvKubeManager to avoid
    side effects.
    
    A follow up change can be to push the individual setups
    from NewTestEnvKubeManager() into their respective TestMain since
    the harness share little code.
    
    Signed-off-by: default avatarAllen Porter <allen@thebends.org>
    d45501a1
    History
    Use shared envTest for unit tests
    Allen Porter authored
    
    Speed up unit tests by using a shared envTest. This requires each
    test to use its own namespace to avoid clobbering objects for
    other tests. Tests previously took around 8 seconds each, and now
    the initial test takes 2 seconds with follow up tests taking less
    than a second each.
    
    Also update existing tests that use a fixed namespace to use a
    generated namespace.
    
    Share gold file template function with yaml files.
    
    Remove the testClusterMode, and instead rely on MainTest to do
    the appropriate test setup and rootArgs flag setup. Move the
    rootArg flag setup out of NewTestEnvKubeManager to avoid
    side effects.
    
    A follow up change can be to push the individual setups
    from NewTestEnvKubeManager() into their respective TestMain since
    the harness share little code.
    
    Signed-off-by: default avatarAllen Porter <allen@thebends.org>
After you've reviewed these contribution guidelines, you'll be all set to contribute to this project.