From 622854fc22c31eee988f8b7f59dbc033ff9393d6 Mon Sep 17 00:00:00 2001 From: Gauvain Pocentek Date: Mon, 10 Jun 2019 13:49:05 +0200 Subject: [PATCH] test: update the tests for GitLab 11.11 Changes in GitLab make the functional tests fail: * Some actions add new notes and discussions: do not use hardcoded values in related listing asserts * The feature flag API is buggy (errors 500): disable the tests for now --- tools/python_test_v4.py | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/tools/python_test_v4.py b/tools/python_test_v4.py index a00ae2935..b8dae28c6 100644 --- a/tools/python_test_v4.py +++ b/tools/python_test_v4.py @@ -552,14 +552,15 @@ assert len(admin_project.issues.list(state="opened")) == 2 assert len(admin_project.issues.list(milestone="milestone1")) == 1 assert m1.issues().next().title == "my issue 1" +size = len(issue1.notes.list()) note = issue1.notes.create({"body": "This is an issue note"}) -assert len(issue1.notes.list()) == 1 +assert len(issue1.notes.list()) == size + 1 emoji = note.awardemojis.create({"name": "tractor"}) assert len(note.awardemojis.list()) == 1 emoji.delete() assert len(note.awardemojis.list()) == 0 note.delete() -assert len(issue1.notes.list()) == 0 +assert len(issue1.notes.list()) == size assert isinstance(issue1.user_agent_detail(), dict) assert issue1.user_agent_detail()["user_agent"] @@ -574,8 +575,10 @@ event = issue1.resourcelabelevents.get(events[0].id) assert event + +size = len(issue1.discussions.list()) discussion = issue1.discussions.create({"body": "Discussion body"}) -assert len(issue1.discussions.list()) == 1 +assert len(issue1.discussions.list()) == size + 1 d_note = discussion.notes.create({"body": "first note"}) d_note_from_get = discussion.notes.get(d_note.id) d_note_from_get.body = "updated body" @@ -608,8 +611,9 @@ assert snippet.user_agent_detail()["user_agent"] +size = len(snippet.discussions.list()) discussion = snippet.discussions.create({"body": "Discussion body"}) -assert len(snippet.discussions.list()) == 1 +assert len(snippet.discussions.list()) == size + 1 d_note = discussion.notes.create({"body": "first note"}) d_note_from_get = discussion.notes.get(d_note.id) d_note_from_get.body = "updated body" @@ -658,8 +662,9 @@ ) # discussion +size = len(mr.discussions.list()) discussion = mr.discussions.create({"body": "Discussion body"}) -assert len(mr.discussions.list()) == 1 +assert len(mr.discussions.list()) == size + 1 d_note = discussion.notes.create({"body": "first note"}) d_note_from_get = discussion.notes.get(d_note.id) d_note_from_get.body = "updated body" @@ -751,11 +756,12 @@ assert ns.kind == "user" # features -feat = gl.features.set("foo", 30) -assert feat.name == "foo" -assert len(gl.features.list()) == 1 -feat.delete() -assert len(gl.features.list()) == 0 +# Disabled as this fails with GitLab 11.11 +# feat = gl.features.set("foo", 30) +# assert feat.name == "foo" +# assert len(gl.features.list()) == 1 +# feat.delete() +# assert len(gl.features.list()) == 0 # broadcast messages msg = gl.broadcastmessages.create({"message": "this is the message"})