Permalink
Browse files

Added -alwaysfailure option for ghetto-ci

  • Loading branch information...
1 parent 018a678 commit 0c1bdd228b430b0fcf22ca6243ce407faa525bd1 @miohtama committed Dec 4, 2012
Showing with 36 additions and 21 deletions.
  1. +1 −2 .gitignore
  2. +6 −1 docs/CHANGES.rst
  3. +18 −7 ghettoci/main.py
  4. +11 −11 setup.py
View
@@ -48,8 +48,7 @@ docs/build/*
*.db
*.jar
.vvv
-venv
-venv-py2
+venv*
__pycache__
tests/test-installation-environment
View
@@ -4,8 +4,13 @@ Changelog
0.4.4 (unreleased)
------------------
-- Nothing changed yet.
+- Fixed ghetto-ci running on Python 3 [miohtama]
+- Fixed ghetto-ci not giving help if no command line arguments given [miohtama]
+
+- Buildout installation instructions updated [miohtama]
+
+- ghetto-ci was using bad mimetype on emails [miohtama]
0.4.3 (2012-10-14)
------------------
View
@@ -1,4 +1,5 @@
#! /usr/bin/python3
+# -*- coding: utf-8 -*-
"""
Continuous integration server, ghetto style
@@ -249,8 +250,15 @@
import sys
import subprocess
from smtplib import SMTP_SSL, SMTP
-import urllib
-import urllib2
+
+try:
+ # Py3k
+ from urllib.parse import urlencode
+ from urllib.request import urlopen
+except ImportError:
+ # Bearded imports
+ from urllib import urlencode
+ from urllib2 import urlopen
# Third party
@@ -554,8 +562,8 @@ def send_skype_message(self, msg):
# Construct full URL to sevabot zapier hook
- post_data = urllib.urlencode(payload)
- r = urllib2.urlopen(self.url, post_data)
+ post_data = urlencode(payload)
+ r = urlopen(self.url, post_data)
r.read() # Will abort on non-HTTP 200 answer
def notify(self, subject, output):
@@ -590,6 +598,7 @@ def run_tests(test_command):
receivers=("Notification email receives as comma separated string", "option"),
force=("Run tests regardless if there have been any repository updates", "flag"),
alwaysoutput=("Print test run output regardless whether test status has changed since the last run", "flag"),
+alwaysfailure=("Print test run failure output regardless whether test status has changed since the last run", "flag"),
skypeurl=("Send build status to Skype chat (Sevabot integration)", "option"),
@@ -607,6 +616,7 @@ def main(
receivers=None,
force=False,
alwaysoutput=False,
+ alwaysfailure=False,
skypeurl=None,
repository=None,
statusfile=None,
@@ -674,15 +684,16 @@ def notify(subject, msg):
return 0
# Test run status have changed since last run
- if (test_success != status.test_success) or alwaysoutput:
+ # .. or test failed and we report failures always
+ if ((test_success != status.test_success) or alwaysoutput) or (alwaysfailure and not test_success):
notification_body = NOTIFICATION_BODY_TEMPLATE % dict(commit=commit_id, author=commit_author,
commit_message=commit_message, test_output=output)
if test_success:
- subject = "Test succeed for %s" % testcommand
+ subject = "Test succeed for %s" % testcommand
else:
- subject = "Test fail for %s" % testcommand
+ subject = "Test fail for %s" % testcommand
notify(subject, notification_body)
View
@@ -12,32 +12,32 @@
VERSION = "0.4.3"
-setup(name = "vvv",
+setup(name="vvv",
version=VERSION,
- long_description = LONG_DESCRIPTION,
- description = "A convenience utility for software source code validation and linting",
- author = "Mikko Ohtamaa",
- author_email = "mikko@opensourcehacker.com",
- url = "https://github.com/miohtama/vvv",
- install_requires = ["setuptools",
+ long_description=LONG_DESCRIPTION,
+ description="A convenience utility for software source code validation and linting",
+ author="Mikko Ohtamaa",
+ author_email="mikko@opensourcehacker.com",
+ url="https://github.com/miohtama/vvv",
+ install_requires=["setuptools",
# "PyYAML==3.10",
# "plac==0.9.0",
# "requests==0.11.1",
# "docutils==0.8.1" # TODO: Could be upgraded to 0.9, but not tested
"PyYAML",
"plac",
"requests",
- "docutils", # TODO: Could be upgraded to 0.9, but not tested
+ "docutils",
"Pygments"
],
- packages = find_packages(exclude=["tests"]),
+ packages=find_packages(exclude=["tests"]),
classifiers=[
"Programming Language :: Python",
],
license="GPL3+",
# Don't install as zipped as we want to poke non-py files inside dist archive
- zip_safe = False,
- include_package_data = True,
+ zip_safe=False,
+ include_package_data=True,
entry_points="""
# -*- Entry points: -*-
[vvv]

0 comments on commit 0c1bdd2

Please sign in to comment.