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

chore(test): remove prefix directory when stop_kong called #12691

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

Water-Melon
Copy link
Contributor

@Water-Melon Water-Melon commented Mar 5, 2024

Summary

This PR cleans up the prefix in the tests.
If the prefix is not cleaned up when stop_kong is called, it could impact subsequent tests, especially when later tests start Kong by a shell command, the Kong instance might be started up with the default servroot prefix.

Checklist

  • The Pull Request has tests
  • A changelog file has been created under changelog/unreleased/kong or skip-changelog label added on PR if changelog is unnecessary. README.md
  • There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE

Issue reference

KAG-3808

@Water-Melon Water-Melon marked this pull request as ready for review March 5, 2024 09:45
@bungle
Copy link
Member

bungle commented Mar 5, 2024

Feels a bit like duplicate of this (which is preferrable solution in my opinion):
#12567

^ we just need to fix tests so that they don't depend on existing prefix, like some test spec files seem to. Feel free to try to get #12567 green (there is a single test failing).

@Water-Melon Water-Melon added the cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee label Mar 5, 2024
@Water-Melon
Copy link
Contributor Author

Water-Melon commented Mar 6, 2024

Feels a bit like duplicate of this (which is preferrable solution in my opinion): #12567

^ we just need to fix tests so that they don't depend on existing prefix, like some test spec files seem to. Feel free to try to get #12567 green (there is a single test failing).

@bungle I left a comment on your PR. I tested the busted event, and it seems that it can only delete one prefix directory. However, for tests related to hybrid mode, they generally start multiple Kong instances, and it seems not to clean them all up.

Also, I think the test code needs to pay attention to cleaning up the runtime environment. Furthermore, if we rely solely on the busted helper for environment cleanup, it could lead to flakiness in local tests but not in CI tests (especially for developers who are unaware of the helper's existence).

If the prefix is not cleaned up when stop_kong is called,
it could impact subsequent tests, especially when later tests
start Kong by a shell command, the Kong instance might
be started up with the default `servroot` prefix.

KAG-3808
@chobits chobits force-pushed the chore/remove_prefix_dir_when_stopped branch from 5b22c1f to e120a2d Compare March 6, 2024 02:07
@bungle
Copy link
Member

bungle commented Mar 6, 2024

@bungle I left a comment on your PR. I tested the busted event, and it seems that it can only delete one prefix directory.

Yes it does, but that is majority (it helps when other test leaks to some other test even when the other test doesn't even do kong start or anything else prefix related, e.g. just config parsing). What about cleaning directory by default with stop or start? Aka make second parameter of stop do_not_cleanup.

Edit: ah, cleanup is the default. And these are just left-overs from local testing or something. Let's merge this then.

@windmgc windmgc merged commit 3dd5bdb into master Mar 7, 2024
27 checks passed
@windmgc windmgc deleted the chore/remove_prefix_dir_when_stopped branch March 7, 2024 03:47
@team-gateway-bot
Copy link
Collaborator

Successfully created cherry-pick PR for master:

@team-gateway-bot
Copy link
Collaborator

Backport failed for release/2.8.x, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release/2.8.x
git worktree add -d .worktree/backport-12691-to-release/2.8.x origin/release/2.8.x
cd .worktree/backport-12691-to-release/2.8.x
git switch --create backport-12691-to-release/2.8.x
git cherry-pick -x 3dd5bdb78ee9aa4b4f602ec241a4b52b1b0ae353

2 similar comments
@team-gateway-bot
Copy link
Collaborator

Backport failed for release/2.8.x, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release/2.8.x
git worktree add -d .worktree/backport-12691-to-release/2.8.x origin/release/2.8.x
cd .worktree/backport-12691-to-release/2.8.x
git switch --create backport-12691-to-release/2.8.x
git cherry-pick -x 3dd5bdb78ee9aa4b4f602ec241a4b52b1b0ae353

@team-gateway-bot
Copy link
Collaborator

Backport failed for release/2.8.x, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release/2.8.x
git worktree add -d .worktree/backport-12691-to-release/2.8.x origin/release/2.8.x
cd .worktree/backport-12691-to-release/2.8.x
git switch --create backport-12691-to-release/2.8.x
git cherry-pick -x 3dd5bdb78ee9aa4b4f602ec241a4b52b1b0ae353

@team-gateway-bot
Copy link
Collaborator

Backport failed for release/3.3.x, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release/3.3.x
git worktree add -d .worktree/backport-12691-to-release/3.3.x origin/release/3.3.x
cd .worktree/backport-12691-to-release/3.3.x
git switch --create backport-12691-to-release/3.3.x
git cherry-pick -x 3dd5bdb78ee9aa4b4f602ec241a4b52b1b0ae353

@team-gateway-bot
Copy link
Collaborator

Backport failed for release/2.8.x, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release/2.8.x
git worktree add -d .worktree/backport-12691-to-release/2.8.x origin/release/2.8.x
cd .worktree/backport-12691-to-release/2.8.x
git switch --create backport-12691-to-release/2.8.x
git cherry-pick -x 3dd5bdb78ee9aa4b4f602ec241a4b52b1b0ae353

1 similar comment
@team-gateway-bot
Copy link
Collaborator

Backport failed for release/2.8.x, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release/2.8.x
git worktree add -d .worktree/backport-12691-to-release/2.8.x origin/release/2.8.x
cd .worktree/backport-12691-to-release/2.8.x
git switch --create backport-12691-to-release/2.8.x
git cherry-pick -x 3dd5bdb78ee9aa4b4f602ec241a4b52b1b0ae353

@team-gateway-bot
Copy link
Collaborator

Backport failed for release/3.3.x, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release/3.3.x
git worktree add -d .worktree/backport-12691-to-release/3.3.x origin/release/3.3.x
cd .worktree/backport-12691-to-release/3.3.x
git switch --create backport-12691-to-release/3.3.x
git cherry-pick -x 3dd5bdb78ee9aa4b4f602ec241a4b52b1b0ae353

@team-gateway-bot
Copy link
Collaborator

Cherry-pick failed for master, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally.

git remote add upstream https://github.com/kong/kong-ee
git fetch upstream master
git worktree add -d .worktree/cherry-pick-12691-to-master-to-upstream upstream/master
cd .worktree/cherry-pick-12691-to-master-to-upstream
git checkout -b cherry-pick-12691-to-master-to-upstream
ancref=$(git merge-base 9566dd94efb80fc3f8d7a7c875603167f528e2e5 e120a2d567052e020cb3084b2bbf9c28b7f01584)
git cherry-pick -x $ancref..e120a2d567052e020cb3084b2bbf9c28b7f01584

@team-gateway-bot
Copy link
Collaborator

Backport failed for release/3.3.x, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release/3.3.x
git worktree add -d .worktree/backport-12691-to-release/3.3.x origin/release/3.3.x
cd .worktree/backport-12691-to-release/3.3.x
git switch --create backport-12691-to-release/3.3.x
git cherry-pick -x 3dd5bdb78ee9aa4b4f602ec241a4b52b1b0ae353

@team-gateway-bot
Copy link
Collaborator

Cherry-pick failed for master, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally.

git remote add upstream https://github.com/kong/kong-ee
git fetch upstream master
git worktree add -d .worktree/cherry-pick-12691-to-master-to-upstream upstream/master
cd .worktree/cherry-pick-12691-to-master-to-upstream
git checkout -b cherry-pick-12691-to-master-to-upstream
ancref=$(git merge-base 9566dd94efb80fc3f8d7a7c875603167f528e2e5 e120a2d567052e020cb3084b2bbf9c28b7f01584)
git cherry-pick -x $ancref..e120a2d567052e020cb3084b2bbf9c28b7f01584

2 similar comments
@team-gateway-bot
Copy link
Collaborator

Cherry-pick failed for master, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally.

git remote add upstream https://github.com/kong/kong-ee
git fetch upstream master
git worktree add -d .worktree/cherry-pick-12691-to-master-to-upstream upstream/master
cd .worktree/cherry-pick-12691-to-master-to-upstream
git checkout -b cherry-pick-12691-to-master-to-upstream
ancref=$(git merge-base 9566dd94efb80fc3f8d7a7c875603167f528e2e5 e120a2d567052e020cb3084b2bbf9c28b7f01584)
git cherry-pick -x $ancref..e120a2d567052e020cb3084b2bbf9c28b7f01584

@team-gateway-bot
Copy link
Collaborator

Cherry-pick failed for master, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally.

git remote add upstream https://github.com/kong/kong-ee
git fetch upstream master
git worktree add -d .worktree/cherry-pick-12691-to-master-to-upstream upstream/master
cd .worktree/cherry-pick-12691-to-master-to-upstream
git checkout -b cherry-pick-12691-to-master-to-upstream
ancref=$(git merge-base 9566dd94efb80fc3f8d7a7c875603167f528e2e5 e120a2d567052e020cb3084b2bbf9c28b7f01584)
git cherry-pick -x $ancref..e120a2d567052e020cb3084b2bbf9c28b7f01584

@team-gateway-bot
Copy link
Collaborator

Backport failed for release/3.4.x, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release/3.4.x
git worktree add -d .worktree/backport-12691-to-release/3.4.x origin/release/3.4.x
cd .worktree/backport-12691-to-release/3.4.x
git switch --create backport-12691-to-release/3.4.x
git cherry-pick -x 3dd5bdb78ee9aa4b4f602ec241a4b52b1b0ae353

@team-gateway-bot
Copy link
Collaborator

You have exceeded a secondary rate limit and have been temporarily blocked from content creation. Please retry your request again later. If you reach out to GitHub Support for help, please include the request ID 63C2:B53AE:2675E8E:472FD70:65EAC963.

@team-gateway-bot
Copy link
Collaborator

Git push to origin failed for release/3.6.x with exitcode 1

1 similar comment
@team-gateway-bot
Copy link
Collaborator

Git push to origin failed for release/3.6.x with exitcode 1

@team-gateway-bot
Copy link
Collaborator

Backport failed for release/3.5.x, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release/3.5.x
git worktree add -d .worktree/backport-12691-to-release/3.5.x origin/release/3.5.x
cd .worktree/backport-12691-to-release/3.5.x
git switch --create backport-12691-to-release/3.5.x
git cherry-pick -x 3dd5bdb78ee9aa4b4f602ec241a4b52b1b0ae353

github-actions bot pushed a commit that referenced this pull request Mar 8, 2024
If the prefix is not cleaned up when stop_kong is called,
it could impact subsequent tests, especially when later tests
start Kong by a shell command, the Kong instance might
be started up with the default `servroot` prefix.

KAG-3808

(cherry picked from commit 3dd5bdb)
@team-gateway-bot
Copy link
Collaborator

Backport failed for release/3.5.x, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release/3.5.x
git worktree add -d .worktree/backport-12691-to-release/3.5.x origin/release/3.5.x
cd .worktree/backport-12691-to-release/3.5.x
git switch --create backport-12691-to-release/3.5.x
git cherry-pick -x 3dd5bdb78ee9aa4b4f602ec241a4b52b1b0ae353

@team-gateway-bot
Copy link
Collaborator

Git push to origin failed for release/3.6.x with exitcode 1

1 similar comment
@team-gateway-bot
Copy link
Collaborator

Git push to origin failed for release/3.6.x with exitcode 1

Water-Melon added a commit that referenced this pull request Mar 8, 2024
If the prefix is not cleaned up when stop_kong is called,
it could impact subsequent tests, especially when later tests
start Kong by a shell command, the Kong instance might
be started up with the default `servroot` prefix.

KAG-3808

(cherry picked from commit 3dd5bdb)
Water-Melon added a commit that referenced this pull request Mar 8, 2024
If the prefix is not cleaned up when stop_kong is called,
it could impact subsequent tests, especially when later tests
start Kong by a shell command, the Kong instance might
be started up with the default `servroot` prefix.

KAG-3808

(cherry picked from commit 3dd5bdb)
Water-Melon added a commit that referenced this pull request Mar 8, 2024
If the prefix is not cleaned up when stop_kong is called,
it could impact subsequent tests, especially when later tests
start Kong by a shell command, the Kong instance might
be started up with the default `servroot` prefix.

KAG-3808

(cherry picked from commit 3dd5bdb)
Water-Melon added a commit that referenced this pull request Mar 8, 2024
If the prefix is not cleaned up when stop_kong is called,
it could impact subsequent tests, especially when later tests
start Kong by a shell command, the Kong instance might
be started up with the default `servroot` prefix.

KAG-3808

(cherry picked from commit 3dd5bdb)
Water-Melon added a commit that referenced this pull request Mar 8, 2024
If the prefix is not cleaned up when stop_kong is called,
it could impact subsequent tests, especially when later tests
start Kong by a shell command, the Kong instance might
be started up with the default `servroot` prefix.

KAG-3808

(cherry picked from commit 3dd5bdb)
ADD-SP pushed a commit that referenced this pull request Mar 12, 2024
* chore(test): remove prefix directory when stop_kong called (#12691)

If the prefix is not cleaned up when stop_kong is called,
it could impact subsequent tests, especially when later tests
start Kong by a shell command, the Kong instance might
be started up with the default `servroot` prefix.

KAG-3808

(cherry picked from commit 3dd5bdb)

* remove prefix directory for 2.8
ADD-SP pushed a commit that referenced this pull request Mar 12, 2024
* chore(test): remove prefix directory when stop_kong called (#12691)

If the prefix is not cleaned up when stop_kong is called,
it could impact subsequent tests, especially when later tests
start Kong by a shell command, the Kong instance might
be started up with the default `servroot` prefix.

KAG-3808

(cherry picked from commit 3dd5bdb)

* remove prefix directory for 3.3
ADD-SP pushed a commit that referenced this pull request Mar 12, 2024
* chore(test): remove prefix directory when stop_kong called (#12691)

If the prefix is not cleaned up when stop_kong is called,
it could impact subsequent tests, especially when later tests
start Kong by a shell command, the Kong instance might
be started up with the default `servroot` prefix.

KAG-3808

(cherry picked from commit 3dd5bdb)

* remove prefix directory for 3.4
ADD-SP pushed a commit that referenced this pull request Mar 12, 2024
* chore(test): remove prefix directory when stop_kong called (#12691)

If the prefix is not cleaned up when stop_kong is called,
it could impact subsequent tests, especially when later tests
start Kong by a shell command, the Kong instance might
be started up with the default `servroot` prefix.

KAG-3808

(cherry picked from commit 3dd5bdb)

* remove prefix directory for 3.5
AndyZhang0707 pushed a commit that referenced this pull request Jun 21, 2024
* chore(test): remove prefix directory when stop_kong called (#12691)

If the prefix is not cleaned up when stop_kong is called,
it could impact subsequent tests, especially when later tests
start Kong by a shell command, the Kong instance might
be started up with the default `servroot` prefix.

KAG-3808

(cherry picked from commit 3dd5bdb)

* remove prefix directory for 2.8
locao pushed a commit that referenced this pull request Jun 22, 2024
Co-authored-by: Zachary Hu <[email protected]>
Co-authored-by: Niklaus Schen <[email protected]>
Co-authored-by: Zhongwei Yao <[email protected]>
Co-authored-by: samugi <[email protected]>
Co-authored-by: Water-Melon <[email protected]>
Co-authored-by: Michael Martin <[email protected]>
Co-authored-by: Kong Team Gateway Bot <[email protected]>
Co-authored-by: Zachary Hu <[email protected]>
Co-authored-by: Qi <[email protected]>
Co-authored-by: Mayo <[email protected]>
Co-authored-by: Wangchong Zhou <[email protected]>
Co-authored-by: Harry <[email protected]>
Co-authored-by: Datong Sun <[email protected]>
Co-authored-by: Vinicius Mignot <[email protected]>
fix directory when stop_kong called (#12713)
fix directory when stop_kong called (#12691)
fix the workflow that comments the docker image on the commit (#12693) (#12711)
fix(ci): replace "cpio" rpm extraction (#13233) (#13263)
fix label-check test (#9717)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee size/L skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants