Skip to content

Integration tests parallelism - part 1#209

Merged
carole-lavillonniere merged 3 commits intomainfrom
drg-665-parallelize-integration-tests
Apr 29, 2026
Merged

Integration tests parallelism - part 1#209
carole-lavillonniere merged 3 commits intomainfrom
drg-665-parallelize-integration-tests

Conversation

@carole-lavillonniere
Copy link
Copy Markdown
Collaborator

@carole-lavillonniere carole-lavillonniere commented Apr 28, 2026

Summary

First pass at parallelizing the integration test suite, only addresses the low-hanging fruits. Docker-dependent tests are left serial for a follow-up since they share container name, ports and the host's Docker daemon.
Execution time goes from about 12min to 7min.

towards DRG-665

Changes

  • t.Parallel() added to tests that are safe to run concurrently
  • Isolate some tests from the developer's real config, changed values of HOME / XDG_CONFIG_HOME
  • Drop redundant ContainerStop calls before ContainerRemove(Force: true) in cleanup because Force-remove already SIGKILLs; an explicit stop first would add the default 10s SIGTERM grace period for nothing.

@carole-lavillonniere carole-lavillonniere force-pushed the drg-665-parallelize-integration-tests branch from fde6b55 to 2122f33 Compare April 28, 2026 09:11
@carole-lavillonniere carole-lavillonniere marked this pull request as ready for review April 29, 2026 14:01
@carole-lavillonniere carole-lavillonniere changed the title Integration tests parallelism Integration tests parallelism - part 1 Apr 29, 2026
Copy link
Copy Markdown
Contributor

@anisaoshafi anisaoshafi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great improvement already 12 -> 7 min 🏃🏼‍♀️

// writeAwsConfig writes a minimal aws-only config so tests don't inherit the
// developer's real ~/.config/lstk/config.toml (which may target a different
// emulator / running container).
func writeAwsConfig(t *testing.T) string {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for fixing this 🙏🏼

@carole-lavillonniere carole-lavillonniere merged commit 71fd22b into main Apr 29, 2026
8 checks passed
@carole-lavillonniere carole-lavillonniere deleted the drg-665-parallelize-integration-tests branch April 29, 2026 14:39
Comment on lines +21 to +28
appData := filepath.Join(tmpHome, "AppData", "Roaming")
e = env.Without("HOME", "XDG_CONFIG_HOME", "APPDATA", "USERPROFILE", "HOMEDRIVE", "HOMEPATH").
With(env.Home, tmpHome).
With("USERPROFILE", tmpHome).
With("APPDATA", appData)
logPath = filepath.Join(appData, "lstk", "lstk.log")
} else {
require.NoError(t, os.MkdirAll(filepath.Join(tmpHome, ".config"), 0755))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, a bit late, but noticed we have this func testEnvWithHome that could probably be reused since it already handles the env for different OS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants