-
Notifications
You must be signed in to change notification settings - Fork 494
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates the deployment process and the version check associated with it
This commit supports steps 1 and 2 in the new workflow: 1. Change the logic in the daemon to check the github api for the latest release that is not a pre release 2. Change travis to mark all releases as pre release 3. When we are ready to stage a release we push a tag to master. Travis builds the packages and releases them 4. We manually check them 5. Remove the pre release mark when we are happy
- Loading branch information
Showing
4 changed files
with
61 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import mock | ||
import requests | ||
from twisted.trial import unittest | ||
|
||
from lbrynet.lbrynet_daemon import LBRYDaemon | ||
|
||
|
||
class MiscTests(unittest.TestCase): | ||
def test_get_lbrynet_version_from_github(self): | ||
response = mock.create_autospec(requests.Response) | ||
# don't need to mock out the entire response from the api | ||
# but at least need 'tag_name' | ||
response.json.return_value = { | ||
"url": "https://api.github.com/repos/lbryio/lbry/releases/3685199", | ||
"assets_url": "https://api.github.com/repos/lbryio/lbry/releases/3685199/assets", | ||
"html_url": "https://github.com/lbryio/lbry/releases/tag/v0.3.8", | ||
"id": 3685199, | ||
"tag_name": "v0.3.8", | ||
"prerelease": False | ||
} | ||
with mock.patch('lbrynet.lbrynet_daemon.LBRYDaemon.requests') as req: | ||
req.get.return_value = response | ||
self.assertEqual('0.3.8', LBRYDaemon.get_lbrynet_version_from_github()) | ||
|
||
def test_error_is_thrown_if_prerelease(self): | ||
response = mock.create_autospec(requests.Response) | ||
response.json.return_value = { | ||
"tag_name": "v0.3.8", | ||
"prerelease": True | ||
} | ||
with mock.patch('lbrynet.lbrynet_daemon.LBRYDaemon.requests') as req: | ||
req.get.return_value = response | ||
with self.assertRaises(Exception): | ||
LBRYDaemon.get_lbrynet_version_from_github() | ||
|
||
def test_error_is_thrown_when_version_cant_be_parsed(self): | ||
with self.assertRaises(Exception): | ||
LBRYDaemon.get_version_from_tag('garbage') |