Skip to content

Commit

Permalink
Disable runbot tests
Browse files Browse the repository at this point in the history
The server is not accessible for jsonrpc calls.
  • Loading branch information
kmagusiak committed Dec 30, 2023
1 parent 257758e commit e1605ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
pip install -r requirements.txt
- name: Run pytest
run: |
pytest --doctest-modules
pytest --doctest-modules -m "not runbot"
- name: Run mypy
run: |
mypy --install-types --non-interactive .
38 changes: 4 additions & 34 deletions tests/runbot/conftest.py
Original file line number Diff line number Diff line change
@@ -1,51 +1,21 @@
import logging
import re
import os

import pytest
import requests

import odoo_connect


@pytest.fixture(scope='session')
def connect_params():
runbot_url = 'https://runbot.odoo.com/'
runbot_page = requests.get(runbot_url)
odoo_url = "http://localhost:8069/"
# runbot is no longer accessible for jsonrpc,
# try to get the server from the environment
odoo_url = os.environ.get("ODOO_URL", "http://localhost:8069/")
version = "unknown"
# we don't use (yet) any XML parsing to keep dependencies simple
# find one of the following and select a URL
# - bundle href (row and name of the branch)
# - link to a sign-in action (avoid documentation and take only stable versions)
for m in re.finditer(
r'href="/runbot/(bundle)[^<]+<b>([^<]*)</b>'
r'|<a class="[^"]*fa-(sign-in)[^"]*" href="([^"]*)"',
runbot_page.text,
):
if m.group(1) == 'bundle':
version = m.group(2)
elif (
re.match(r'^\d+\.\d$', version)
and m.group(3) == 'sign-in'
and 'build/html' not in m.group(4)
):
odoo_url = m.group(4)
if odoo_url.startswith('/'):
# relative path, will redirect to server, find it
odoo_url = odoo_connect.odoo_rpc.urljoin(runbot_url, odoo_url)
resp = requests.head(odoo_url)
if resp.is_redirect:
odoo_url = resp.next.url
else:
odoo_url = odoo_url.replace('http://', 'https://')
break
logging.info("Using odoo server %s: %s", version, odoo_url)

return {
'url': odoo_url,
'username': 'admin',
'password': 'admin',
'check_connection': False,
}


Expand Down

0 comments on commit e1605ae

Please sign in to comment.