Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

test(functional): bump GitLab docker image to 15.2.0-ee.0#2194

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nejch merged 3 commits intomainfromjlvillal/update-gitlab
Jul 29, 2022
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletiondocs/api-objects.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -11,7 +11,6 @@ API examples
gl_objects/emojis
gl_objects/badges
gl_objects/branches
gl_objects/clusters
gl_objects/messages
gl_objects/ci_lint
gl_objects/commits
Expand DownExpand Up@@ -63,3 +62,4 @@ API examples
gl_objects/variables
gl_objects/sidekiq
gl_objects/wikis
gl_objects/clusters
11 changes: 8 additions & 3 deletionsdocs/gl_objects/clusters.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
############
Clusters
############
#####################
Clusters (DEPRECATED)
#####################

.. warning::
Cluster support was deprecated in GitLab 14.5 and disabled by default as of
GitLab 15.0


Reference
---------
Expand Down
2 changes: 1 addition & 1 deletiondocs/gl_objects/topics.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,7 +30,7 @@ Get a specific topic by its ID::

Create a new topic::

topic = gl.topics.create({"name": "my-topic"})
topic = gl.topics.create({"name": "my-topic", "title": "my title"})

Update a topic::

Expand Down
5 changes: 4 additions & 1 deletiongitlab/v4/objects/topics.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -19,7 +19,10 @@ class TopicManager(CRUDMixin, RESTManager):
_path="/topics"
_obj_cls=Topic
_create_attrs=RequiredOptional(
required=("name",),optional=("avatar","description")
# NOTE: The `title` field was added and is required in GitLab 15.0 or
# newer. But not present before that.
required=("name",),
optional=("avatar","description","title"),
)
_update_attrs=RequiredOptional(optional=("avatar","description","name"))
_types= {"avatar":types.ImageAttribute}
Expand Down
44 changes: 0 additions & 44 deletionstests/functional/api/test_clusters.py
View file
Open in desktop

This file was deleted.

11 changes: 9 additions & 2 deletionstests/functional/api/test_topics.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,11 +4,18 @@
"""


deftest_topics(gl):
deftest_topics(gl,gitlab_version):
assertnotgl.topics.list()

topic=gl.topics.create({"name":"my-topic","description":"My Topic"})
create_dict= {"name":"my-topic","description":"My Topic"}
ifgitlab_version.major>=15:
create_dict["title"]="my topic title"
topic=gl.topics.create(
{"name":"my-topic","title":"my topic title","description":"My Topic"}
)
asserttopic.name=="my-topic"
ifgitlab_version.major>=15:
asserttopic.title=="my topic title"
Comment on lines +10 to +18
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

FWIW I don't think we need to test multiple major versions as tests get complicated quickly, but I agree it'll be helpful having version checks when developing new features.

assertgl.topics.list()

topic.description="My Updated Topic"
Expand Down
19 changes: 19 additions & 0 deletionstests/functional/conftest.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
import dataclasses
import logging
import tempfile
import time
Expand All@@ -12,6 +13,24 @@
from tests.functional import helpers


@dataclasses.dataclass
class GitlabVersion:
major: int
minor: int
patch: str
revision: str

def __post_init__(self):
self.major, self.minor = int(self.major), int(self.minor)


@pytest.fixture(scope="session")
def gitlab_version(gl) -> GitlabVersion:
version, revision = gl.version()
major, minor, patch = version.split(".")
return GitlabVersion(major=major, minor=minor, patch=patch, revision=revision)


@pytest.fixture(scope="session")
def fixture_dir(test_dir):
return test_dir / "functional" / "fixtures"
Expand Down
2 changes: 1 addition & 1 deletiontests/functional/fixtures/.env
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
GITLAB_IMAGE=gitlab/gitlab-ee
GITLAB_TAG=14.9.2-ee.0
GITLAB_TAG=15.2.0-ee.0
5 changes: 4 additions & 1 deletiontests/unit/objects/test_topics.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,10 +8,12 @@
from gitlab.v4.objects import Topic

name = "GitLab"
topic_title = "topic title"
new_name = "gitlab-test"
topic_content = {
"id": 1,
"name": name,
"title": topic_title,
"description": "GitLab is an open source end-to-end software development platform.",
"total_projects_count": 1000,
"avatar_url": "http://www.gravatar.com/avatar/a0d477b3ea21970ce6ffcbb817b0b435?s=80&d=identicon",
Expand DownExpand Up@@ -102,9 +104,10 @@ def test_get_topic(gl, resp_get_topic):


def test_create_topic(gl, resp_create_topic):
topic = gl.topics.create({"name": name})
topic = gl.topics.create({"name": name, "title": topic_title})
assert isinstance(topic, Topic)
assert topic.name == name
assert topic.title == topic_title


def test_update_topic(gl, resp_update_topic):
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp