Skip to content

Commit

Permalink
Change the development base_address to be localhost.
Browse files Browse the repository at this point in the history
Most developers are likely to develop by pointing their browsers
at localhost, rather than 0.0.0.0. This commit sets the
base_address to use the name "localhost" by default for new
developers.
  • Loading branch information
bowlofeggs committed Sep 27, 2016
1 parent 779fb62 commit 0fd5901
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 17 deletions.
30 changes: 16 additions & 14 deletions bodhi/tests/server/functional/test_updates.py
Expand Up @@ -18,6 +18,7 @@
import textwrap
import time
import mock
import urlparse

from mock import ANY
from nose.tools import eq_
Expand Down Expand Up @@ -433,7 +434,6 @@ def test_list_updates(self):
self.assertEquals(len(body['updates']), 1)

alias = u'FEDORA-%s-a3bbe1a8f2' % YEAR
baseurl = 'http://0.0.0.0:6543'

up = body['updates'][0]
self.assertEquals(up['title'], u'bodhi-2.0-1.fc17')
Expand All @@ -453,7 +453,7 @@ def test_list_updates(self):
self.assertEquals(up['locked'], True)
self.assertEquals(up['alias'], alias)
self.assertEquals(up['karma'], 1)
self.assertEquals(up['url'], '%s/updates/%s' % (baseurl, alias))
self.assertEquals(up['url'], (urlparse.urljoin(config['base_address'], '/updates/%s' % alias)))

def test_list_updates_jsonp(self):
res = self.app.get('/updates/',
Expand Down Expand Up @@ -1765,19 +1765,21 @@ def test_obsoletion(self, publish, *args):

# Check for the comment multiple ways
# Note that caveats above don't support markdown, but comments do.
self.assertEquals(r['comments'][-1]['text'],
u'This update has obsoleted [bodhi-2.0.0-2.fc17]'
'(http://0.0.0.0:6543/updates/FEDORA-2016-033713b73b), '
'and has inherited its bugs and notes.')
expected_comment = (
u'This update has obsoleted [bodhi-2.0.0-2.fc17]({}), '
u'and has inherited its bugs and notes.')
expected_comment = expected_comment.format(
urlparse.urljoin(config['base_address'], '/updates/FEDORA-2016-033713b73b'))
self.assertEquals(r['comments'][-1]['text'], expected_comment)
publish.assert_called_with(
topic='update.request.testing', msg=mock.ANY)

up = self.db.query(Update).filter_by(title=nvr).one()
self.assertEquals(up.status, UpdateStatus.obsolete)
self.assertEquals(up.comments[-1].text,
u'This update has been obsoleted by '
'[bodhi-2.0.0-3.fc17](http://0.0.0.0:6543/'
'updates/FEDORA-2016-53345602d5).')
expected_comment = u'This update has been obsoleted by [bodhi-2.0.0-3.fc17]({}).'
expected_comment = expected_comment.format(
urlparse.urljoin(config['base_address'], '/updates/FEDORA-2016-53345602d5'))
self.assertEquals(up.comments[-1].text, expected_comment)

@mock.patch(**mock_valid_requirements)
@mock.patch('bodhi.server.notifications.publish')
Expand Down Expand Up @@ -1861,10 +1863,10 @@ def test_push_to_stable_for_obsolete_update(self, publish, *args):

up = self.db.query(Update).filter_by(title=nvr).one()
self.assertEquals(up.status, UpdateStatus.obsolete)
self.assertEquals(up.comments[-1].text,
u'This update has been obsoleted by '
'[bodhi-2.0.0-3.fc17](http://0.0.0.0:6543/'
'updates/FEDORA-2016-53345602d5).')
expected_comment = u'This update has been obsoleted by [bodhi-2.0.0-3.fc17]({}).'
expected_comment = expected_comment.format(
urlparse.urljoin(config['base_address'], '/updates/FEDORA-2016-53345602d5'))
self.assertEquals(up.comments[-1].text, expected_comment)

# Check Push to Stable button for obsolete update
id = 'bodhi-2.0.0-2.fc17'
Expand Down
12 changes: 10 additions & 2 deletions bodhi/tests/server/test_masher.py
Expand Up @@ -15,6 +15,7 @@
import os
import mock
import time
import urlparse
import json
import shutil
import unittest
Expand Down Expand Up @@ -781,8 +782,15 @@ def test_absent_gating(self, cmd, publish, *args):
@mock.patch('bodhi.server.bugs.bugtracker.on_qa')
def test_modify_testing_bugs(self, on_qa, modified, *args):
self.masher.consume(self.msg)
on_qa.assert_called_once_with(12345,
u'bodhi-2.0-1.fc17 has been pushed to the Fedora 17 testing repository. If problems still persist, please make note of it in this bug report.\nSee https://fedoraproject.org/wiki/QA:Updates_Testing for\ninstructions on how to install test updates.\nYou can provide feedback for this update here: http://0.0.0.0:6543/updates/FEDORA-2016-a3bbe1a8f2')

expected_message = (
u'bodhi-2.0-1.fc17 has been pushed to the Fedora 17 testing repository. If problems '
u'still persist, please make note of it in this bug report.\nSee '
u'https://fedoraproject.org/wiki/QA:Updates_Testing for\ninstructions on how to '
u'install test updates.\nYou can provide feedback for this update here: {}')
expected_message = expected_message.format(
urlparse.urljoin(config['base_address'], '/updates/FEDORA-2016-a3bbe1a8f2'))
on_qa.assert_called_once_with(12345, expected_message)

@mock.patch(**mock_taskotron_results)
@mock.patch('bodhi.server.consumers.masher.MasherThread.update_comps')
Expand Down
2 changes: 1 addition & 1 deletion development.ini.example
Expand Up @@ -123,7 +123,7 @@ fedora_epel_testing_master_repomd = https://download.fedoraproject.org/pub/epel/

## The base url of this application
## Used as the <base/> tag in the master template.
base_address = http://0.0.0.0:6543/
base_address = http://localhost:6543/
#base_address = https://admin.stg.fedoraproject.org/updates/

## Supported update types
Expand Down

0 comments on commit 0fd5901

Please sign in to comment.