mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-18 10:14:24 +00:00
fix: docsgpt up --adopt recreates every container
Compose keeps containers whose configuration did not change, so after a takeover Redis and Postgres still carried the other folder's working directory label, and the next `docsgpt up` asked for --adopt again.
This commit is contained in:
1 parent
0bd0afc1f8
commit
c7af5f873a
2 files changed
+22
-6
No files matched your search
@@ -185,6 +185,17 @@ class TestUpAgain:
|
||||
assert docker.calls == []
|
||||
assert _run(["up", "--yes", "--adopt", "--dir", str(tmp_path)], _context(docker)) == 0
|
||||
|
||||
def test_adopting_recreates_every_container(self, tmp_path):
|
||||
"""Compose keeps unchanged containers, and with them the old folder's label; the next up would ask again."""
|
||||
docker = FakeDocker(project_dirs={"/srv/old-docsgpt"})
|
||||
assert _run(["up", "--yes", "--adopt", "--dir", str(tmp_path)], _context(docker)) == 0
|
||||
assert docker.calls == [(tmp_path, ["up", "-d", "--remove-orphans", "--force-recreate"])]
|
||||
|
||||
def test_containers_from_this_folder_are_not_recreated(self, tmp_path):
|
||||
docker = FakeDocker(project_dirs={str(tmp_path)})
|
||||
assert _run(["up", "--yes", "--dir", str(tmp_path)], _context(docker)) == 0
|
||||
assert docker.calls == [(tmp_path, ["up", "-d", "--remove-orphans"])]
|
||||
|
||||
def test_consent_can_be_given_at_the_prompt(self, tmp_path):
|
||||
docker = FakeDocker(project_dirs={"/srv/old-docsgpt"})
|
||||
prompter = FakePrompter([True, "local", "docsgpt"])
|
||||
|
||||
Reference in new issue
Block a user