Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] runbot_travis2docker: Url freezed because there are not db=all #152

Merged
merged 1 commit into from
Mar 27, 2018
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 10 additions & 0 deletions runbot_travis2docker/models/runbot_branch.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,13 @@ def force_weblate(self):
'branch_id': record.id,
'name': record.branch_name,
'uses_weblate': True})

def _get_branch_quickconnect_url(self, fqdn, dest):
self.ensure_one()
res = super(RunbotBranch, self)._get_branch_quickconnect_url(
fqdn, dest)
if self.repo_id.is_travis2docker_build:
dbname = "db=%s-all&" % dest
res[self.id] = (
res[self.id].replace(dbname, "").replace("?debug=1", ""))
return res
13 changes: 13 additions & 0 deletions runbot_travis2docker/tests/test_runbot_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,16 @@ def test_extra_args(self):
self.assertIn('--name=hola', cmd)
self.assertIn('8072:8073', cmd)
self.assertIn('80', cmd)

def test_quick_connect(self):
repo = self.env.ref('runbot_travis2docker.runbot_repo_demo1')
self.env['ir.config_parameter'].sudo().set_param(
"runbot.runbot_max_age", 365*10)
self.branch_obj.search([('repo_id', '=', repo.id)]).unlink()
self.build_obj.search([('repo_id', '=', repo.id)]).unlink()
repo._update(repo)
build = self.build_obj.search([('repo_id', '=', repo.id)], limit=1)
url = build.branch_id._get_branch_quickconnect_url(
build.domain, build.dest)[build.branch_id.id]
self.assertNotIn('debug', url)
self.assertNotIn('-all', url)