Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: unit tests for DefaultWorkingDirLocker.TryLock() #2159

Merged

Conversation

KevinSnyderCodes
Copy link
Contributor

No description provided.

Kevin Snyder and others added 5 commits March 9, 2022 16:00
In the release notes for v0.13.0: https://github.com/runatlantis/atlantis/blob/master/CHANGELOG.md#features-4

> Running in parallel is only supported if you're using workspaces to separate your projects. Projects in separate directories can not be run in parallel currently.

This commit adds `path` as an argument to `DefaultWorkingDirLocker.TryLock()` and includes `path` in the `workspaceKey` used to check if a project is locked. This should allow projects in separate directories to run in parallel.

To my knowledge, there is no functional reason that projects in separate directories cannot run in parallel.

All calls to `DefaultWorkingDirLocker.TryLock()` have been updated. A new unit test `TestTryLockWithDifferentPaths` has been added to test the behavior of locking two separate directories with the same workspace name.
- Fix expected error message for `TestTryLock()`
- Use `.` as default path for calls to `DefaultWorkingDirLocker.TryLock()`
@KevinSnyderCodes KevinSnyderCodes requested a review from a team as a code owner March 22, 2022 20:49
@jamengual jamengual merged commit 3ffd1c5 into runatlantis:master Mar 22, 2022
krrrr38 pushed a commit to krrrr38/atlantis that referenced this pull request Dec 16, 2022
* fix: add path to DefaultWorkingDirLocker.TryLock()

In the release notes for v0.13.0: https://github.com/runatlantis/atlantis/blob/master/CHANGELOG.md#features-4

> Running in parallel is only supported if you're using workspaces to separate your projects. Projects in separate directories can not be run in parallel currently.

This commit adds `path` as an argument to `DefaultWorkingDirLocker.TryLock()` and includes `path` in the `workspaceKey` used to check if a project is locked. This should allow projects in separate directories to run in parallel.

To my knowledge, there is no functional reason that projects in separate directories cannot run in parallel.

All calls to `DefaultWorkingDirLocker.TryLock()` have been updated. A new unit test `TestTryLockWithDifferentPaths` has been added to test the behavior of locking two separate directories with the same workspace name.

* Add documntation for parallel_plan and parallel_apply options

* Fix working_dir_locker_test.go

- Fix expected error message for `TestTryLock()`
- Use `.` as default path for calls to `DefaultWorkingDirLocker.TryLock()`

Co-authored-by: Kevin Snyder <[email protected]>
Co-authored-by: Kevin Snyder <[email protected]>
Co-authored-by: Kevin Snyder <[email protected]>
Co-authored-by: Kevin Snyder <[email protected]>
Co-authored-by: Rui Chen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants