From 65cb02a016ceeb500b5ba9cc4464c38c9d9dbfb3 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Mon, 2 Aug 2021 14:12:57 -0700 Subject: [PATCH] Improve repo rename functional testing This tests that we can rename both the project and the org the project lives in. Should just add a bit more robustness to our testing. Change-Id: I0914e864c787b1dba175e0fabf6ab2648a554d16 --- playbooks/test-review.yaml | 8 ++++---- playbooks/zuul/test_gerrit_renames.yaml | 2 +- playbooks/zuul/test_gitea_renames.yaml | 2 +- testinfra/test_gitea.py | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/playbooks/test-review.yaml b/playbooks/test-review.yaml index ba1a168072..052edb8d28 100644 --- a/playbooks/test-review.yaml +++ b/playbooks/test-review.yaml @@ -153,13 +153,13 @@ - name: Create project project in Gerrit uri: - url: http://localhost:8081/a/projects/y%2Ftest-project + url: http://localhost:8081/a/projects/y%2Ftestproject method: PUT user: admin password: secret status_code: 201 - - name: Create initial commit and change in test-project + - name: Create initial commit and change in testproject shell: executable: /bin/sh chdir: "{{ project_tmp.stdout }}" @@ -171,11 +171,11 @@ [gerrit] host=localhost port=29418 - project=y/test-project + project=y/testproject EOF git add .gitreview git commit -m "Initial commit" - git remote add gerrit http://admin:secret@localhost:8081/y/test-project + git remote add gerrit http://admin:secret@localhost:8081/y/testproject git push -f --set-upstream gerrit +HEAD:master curl -Lo .git/hooks/commit-msg http://localhost:8081/tools/hooks/commit-msg diff --git a/playbooks/zuul/test_gerrit_renames.yaml b/playbooks/zuul/test_gerrit_renames.yaml index 1d1a7b5403..b5faabdc3e 100644 --- a/playbooks/zuul/test_gerrit_renames.yaml +++ b/playbooks/zuul/test_gerrit_renames.yaml @@ -1,5 +1,5 @@ repos: - - old: y/test-project + - old: y/testproject new: x/test-project gerrit_groups: - old: CI-tools diff --git a/playbooks/zuul/test_gitea_renames.yaml b/playbooks/zuul/test_gitea_renames.yaml index 71039f039a..85858d8b29 100644 --- a/playbooks/zuul/test_gitea_renames.yaml +++ b/playbooks/zuul/test_gitea_renames.yaml @@ -1,6 +1,6 @@ repos: - old: openstack/diskimage-builder - new: opendev/diskimage-builder + new: opendev/disk-image-builder gerrit_groups: - old: CI-tools new: CI-tools-updated diff --git a/testinfra/test_gitea.py b/testinfra/test_gitea.py index da2a418445..d05bc9981d 100644 --- a/testinfra/test_gitea.py +++ b/testinfra/test_gitea.py @@ -66,7 +66,7 @@ def test_project_clone(host): # Note this tests the result of a project rename in gitea as well. cmd = host.run( 'GIT_SSL_NO_VERIFY=1 ' - 'git clone https://localhost:3081/opendev/diskimage-builder ' - '/tmp/diskimage-builder') - assert "Cloning into '/tmp/diskimage-builder'..." in cmd.stderr + 'git clone https://localhost:3081/opendev/disk-image-builder ' + '/tmp/disk-image-builder') + assert "Cloning into '/tmp/disk-image-builder'..." in cmd.stderr assert cmd.succeeded