Skip to content

feat: add packages and content packages #310

feat: add packages and content packages

feat: add packages and content packages #310

GitHub Actions / integration-test-results failed Nov 8, 2024 in 0s

3 errors, 1 fail, 36 pass in 6m 34s

 20 files  ±0   20 suites  ±0   6m 34s ⏱️ -2s
 40 tests ±0   36 ✅ ± 0    0 💤 ±0  1 ❌ ± 0  3 🔥 ±0 
803 runs  +1  649 ✅ +17  150 💤 ±0  1 ❌  - 16  3 🔥 ±0 

Results for commit 9adc52d. ± Comparison against earlier commit 44e3bbc.

Annotations

Check failure on line 0 in integration.tests.posit.connect.test_jobs.TestJobs

See this annotation in the file changed.

@github-actions github-actions / integration-test-results

1 out of 20 runs with error: test_find_by (integration.tests.posit.connect.test_jobs.TestJobs)

artifacts/2023.10.0 - Integration Test Report/2023.10.0.xml [took 4s]
Raw output
failed on teardown with "requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http://connect:3939/__api__/v1/content/78ea7e72-e74b-4d11-9c00-7bf0d9c77cf2"
self = <Response [500]>, kwargs = {}

    def json(self, **kwargs):
        r"""Returns the json-encoded content of a response, if any.
    
        :param \*\*kwargs: Optional arguments that ``json.loads`` takes.
        :raises requests.exceptions.JSONDecodeError: If the response body does not
            contain valid json.
        """
    
        if not self.encoding and self.content and len(self.content) > 3:
            # No encoding set. JSON RFC 4627 section 3 states we should expect
            # UTF-8, -16 or -32. Detect which one to use; If the detection or
            # decoding fails, fall back to `self.text` (using charset_normalizer to make
            # a best guess).
            encoding = guess_json_utf(self.content)
            if encoding is not None:
                try:
                    return complexjson.loads(self.content.decode(encoding), **kwargs)
                except UnicodeDecodeError:
                    # Wrong UTF codec detected; usually because it's not UTF-8
                    # but some other 8-bit codec.  This is an RFC violation,
                    # and the server didn't bother to tell us what codec *was*
                    # used.
                    pass
                except JSONDecodeError as e:
                    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
    
        try:
>           return complexjson.loads(self.text, **kwargs)

../.venv/lib/python3.13/site-packages/requests/models.py:974: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/local/lib/python3.13/json/__init__.py:346: in loads
    return _default_decoder.decode(s)
/usr/local/lib/python3.13/json/decoder.py:344: in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <json.decoder.JSONDecoder object at 0x7fc177b71400>, s = '', idx = 0

    def raw_decode(self, s, idx=0):
        """Decode a JSON document from ``s`` (a ``str`` beginning with
        a JSON document) and return a 2-tuple of the Python
        representation and the index in ``s`` where the document ended.
    
        This can be used to decode a JSON document from a string that may
        have extraneous data at the end.
    
        """
        try:
            obj, end = self.scan_once(s, idx)
        except StopIteration as err:
>           raise JSONDecodeError("Expecting value", s, err.value) from None
E           json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

/usr/local/lib/python3.13/json/decoder.py:362: JSONDecodeError

During handling of the above exception, another exception occurred:

response = <Response [500]>, args = ()
kwargs = {'cert': None, 'proxies': OrderedDict(), 'stream': False, 'timeout': None, ...}

    def handle_errors(response: Response, *args, **kwargs) -> Response:
        if response.status_code >= 400:
            try:
>               data = response.json()

../src/posit/connect/hooks.py:12: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Response [500]>, kwargs = {}

    def json(self, **kwargs):
        r"""Returns the json-encoded content of a response, if any.
    
        :param \*\*kwargs: Optional arguments that ``json.loads`` takes.
        :raises requests.exceptions.JSONDecodeError: If the response body does not
            contain valid json.
        """
    
        if not self.encoding and self.content and len(self.content) > 3:
            # No encoding set. JSON RFC 4627 section 3 states we should expect
            # UTF-8, -16 or -32. Detect which one to use; If the detection or
            # decoding fails, fall back to `self.text` (using charset_normalizer to make
            # a best guess).
            encoding = guess_json_utf(self.content)
            if encoding is not None:
                try:
                    return complexjson.loads(self.content.decode(encoding), **kwargs)
                except UnicodeDecodeError:
                    # Wrong UTF codec detected; usually because it's not UTF-8
                    # but some other 8-bit codec.  This is an RFC violation,
                    # and the server didn't bother to tell us what codec *was*
                    # used.
                    pass
                except JSONDecodeError as e:
                    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
    
        try:
            return complexjson.loads(self.text, **kwargs)
        except JSONDecodeError as e:
            # Catch JSON-related errors and raise as requests.JSONDecodeError
            # This aliases json.JSONDecodeError and simplejson.JSONDecodeError
>           raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
E           requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

../.venv/lib/python3.13/site-packages/requests/models.py:978: JSONDecodeError

During handling of the above exception, another exception occurred:

cls = <class 'connect.test_jobs.TestJobs'>

    @classmethod
    def teardown_class(cls):
>       cls.content.delete()

tests/posit/connect/test_jobs.py:23: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../src/posit/connect/content.py:61: in delete
    self.params.session.delete(url)
../.venv/lib/python3.13/site-packages/requests/sessions.py:671: in delete
    return self.request("DELETE", url, **kwargs)
../.venv/lib/python3.13/site-packages/requests/sessions.py:589: in request
    resp = self.send(prep, **send_kwargs)
../.venv/lib/python3.13/site-packages/requests/sessions.py:710: in send
    r = dispatch_hook("response", hooks, r, **kwargs)
../.venv/lib/python3.13/site-packages/requests/hooks.py:30: in dispatch_hook
    _hook_data = hook(hook_data, **kwargs)
../src/posit/connect/hooks.py:21: in handle_errors
    response.raise_for_status()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Response [500]>

    def raise_for_status(self):
        """Raises :class:`HTTPError`, if one occurred."""
    
        http_error_msg = ""
        if isinstance(self.reason, bytes):
            # We attempt to decode utf-8 first because some servers
            # choose to localize their reason strings. If the string
            # isn't utf-8, we fall back to iso-8859-1 for all other
            # encodings. (See PR #3538)
            try:
                reason = self.reason.decode("utf-8")
            except UnicodeDecodeError:
                reason = self.reason.decode("iso-8859-1")
        else:
            reason = self.reason
    
        if 400 <= self.status_code < 500:
            http_error_msg = (
                f"{self.status_code} Client Error: {reason} for url: {self.url}"
            )
    
        elif 500 <= self.status_code < 600:
            http_error_msg = (
                f"{self.status_code} Server Error: {reason} for url: {self.url}"
            )
    
        if http_error_msg:
>           raise HTTPError(http_error_msg, response=self)
E           requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http://connect:3939/__api__/v1/content/78ea7e72-e74b-4d11-9c00-7bf0d9c77cf2

../.venv/lib/python3.13/site-packages/requests/models.py:1024: HTTPError

Check warning on line 0 in integration.tests.posit.connect.test_users.TestUserContent

See this annotation in the file changed.

@github-actions github-actions / integration-test-results

1 out of 20 runs failed: test_count (integration.tests.posit.connect.test_users.TestUserContent)

artifacts/2023.10.0 - Integration Test Report/2023.10.0.xml [took 0s]
Raw output
AssertionError: assert 2 == 1
 +  where 2 = count()
 +    where count = <posit.connect.content.Content object at 0x7fc17644df30>.count
 +      where <posit.connect.content.Content object at 0x7fc17644df30> = {'email': '', 'username': '__bootstrap_admin__', 'first_name': '', 'last_name': '', 'user_role': 'administrator', 'cre...tive_time': '2024-11-08T16:00:26Z', 'confirmed': True, 'locked': False, 'guid': 'c536a8f7-e63e-469b-8dd3-31d11c8f36f9'}.content
 +        where {'email': '', 'username': '__bootstrap_admin__', 'first_name': '', 'last_name': '', 'user_role': 'administrator', 'cre...tive_time': '2024-11-08T16:00:26Z', 'confirmed': True, 'locked': False, 'guid': 'c536a8f7-e63e-469b-8dd3-31d11c8f36f9'} = <connect.test_users.TestUserContent object at 0x7fc1767aca50>.me
self = <connect.test_users.TestUserContent object at 0x7fc1767aca50>

    def test_count(self):
>       assert self.me.content.count() == 1
E       AssertionError: assert 2 == 1
E        +  where 2 = count()
E        +    where count = <posit.connect.content.Content object at 0x7fc17644df30>.count
E        +      where <posit.connect.content.Content object at 0x7fc17644df30> = {'email': '', 'username': '__bootstrap_admin__', 'first_name': '', 'last_name': '', 'user_role': 'administrator', 'cre...tive_time': '2024-11-08T16:00:26Z', 'confirmed': True, 'locked': False, 'guid': 'c536a8f7-e63e-469b-8dd3-31d11c8f36f9'}.content
E        +        where {'email': '', 'username': '__bootstrap_admin__', 'first_name': '', 'last_name': '', 'user_role': 'administrator', 'cre...tive_time': '2024-11-08T16:00:26Z', 'confirmed': True, 'locked': False, 'guid': 'c536a8f7-e63e-469b-8dd3-31d11c8f36f9'} = <connect.test_users.TestUserContent object at 0x7fc1767aca50>.me

tests/posit/connect/test_users.py:70: AssertionError

Check failure on line 0 in integration.tests.posit.connect.test_users.TestUserContent

See this annotation in the file changed.

@github-actions github-actions / integration-test-results

1 out of 20 runs with error: test_multiple_users (integration.tests.posit.connect.test_users.TestUserContent)

artifacts/2023.10.0 - Integration Test Report/2023.10.0.xml [took 0s]
Raw output
failed on teardown with "AssertionError: assert 1 == 0
 +  where 1 = count()
 +    where count = <posit.connect.content.Content object at 0x7fc17678caf0>.count
 +      where <posit.connect.content.Content object at 0x7fc17678caf0> = {'email': '', 'username': '__bootstrap_admin__', 'first_name': '', 'last_name': '', 'user_role': 'administrator', 'cre...tive_time': '2024-11-08T16:00:26Z', 'confirmed': True, 'locked': False, 'guid': 'c536a8f7-e63e-469b-8dd3-31d11c8f36f9'}.content
 +        where {'email': '', 'username': '__bootstrap_admin__', 'first_name': '', 'last_name': '', 'user_role': 'administrator', 'cre...tive_time': '2024-11-08T16:00:26Z', 'confirmed': True, 'locked': False, 'guid': 'c536a8f7-e63e-469b-8dd3-31d11c8f36f9'} = <class 'connect.test_users.TestUserContent'>.me"
cls = <class 'connect.test_users.TestUserContent'>

    @classmethod
    def teardown_class(cls):
        assert cls.content.delete() is None
>       assert cls.me.content.count() == 0
E       AssertionError: assert 1 == 0
E        +  where 1 = count()
E        +    where count = <posit.connect.content.Content object at 0x7fc17678caf0>.count
E        +      where <posit.connect.content.Content object at 0x7fc17678caf0> = {'email': '', 'username': '__bootstrap_admin__', 'first_name': '', 'last_name': '', 'user_role': 'administrator', 'cre...tive_time': '2024-11-08T16:00:26Z', 'confirmed': True, 'locked': False, 'guid': 'c536a8f7-e63e-469b-8dd3-31d11c8f36f9'}.content
E        +        where {'email': '', 'username': '__bootstrap_admin__', 'first_name': '', 'last_name': '', 'user_role': 'administrator', 'cre...tive_time': '2024-11-08T16:00:26Z', 'confirmed': True, 'locked': False, 'guid': 'c536a8f7-e63e-469b-8dd3-31d11c8f36f9'} = <class 'connect.test_users.TestUserContent'>.me

tests/posit/connect/test_users.py:67: AssertionError

Check failure on line 0 in integration.tests.posit.connect.test_vanities.TestVanities

See this annotation in the file changed.

@github-actions github-actions / integration-test-results

1 out of 20 runs with error: test_destroy (integration.tests.posit.connect.test_vanities.TestVanities)

artifacts/2023.10.0 - Integration Test Report/2023.10.0.xml [took 0s]
Raw output
failed on teardown with "AssertionError: assert 1 == 0
 +  where 1 = count()
 +    where count = <posit.connect.content.Content object at 0x7fc1766774d0>.count
 +      where <posit.connect.content.Content object at 0x7fc1766774d0> = <posit.connect.client.Client object at 0x7fc1768bfd50>.content
 +        where <posit.connect.client.Client object at 0x7fc1768bfd50> = <class 'connect.test_vanities.TestVanities'>.client"
cls = <class 'connect.test_vanities.TestVanities'>

    @classmethod
    def teardown_class(cls):
>       assert cls.client.content.count() == 0
E       AssertionError: assert 1 == 0
E        +  where 1 = count()
E        +    where count = <posit.connect.content.Content object at 0x7fc1766774d0>.count
E        +      where <posit.connect.content.Content object at 0x7fc1766774d0> = <posit.connect.client.Client object at 0x7fc1768bfd50>.content
E        +        where <posit.connect.client.Client object at 0x7fc1768bfd50> = <class 'connect.test_vanities.TestVanities'>.client

tests/posit/connect/test_vanities.py:11: AssertionError