Permalink
Browse files

Add script to test against latest PyPi packages

  • Loading branch information...
1 parent 3a662c5 commit 2ff7d98b3eecdc25cdbcc806ca5aacfa600d2789 myint committed May 20, 2012
Showing with 51 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +50 −0 test/acid_pypi.bash
View
@@ -8,3 +8,4 @@ htmlcov
.tox
*.class
coverage.xml
+test/pypi_tmp/
View
@@ -0,0 +1,50 @@
+#!/bin/bash
+#
+# Run acid test against latest packages on PyPi.
+
+# Check all packages released in the last $LAST_HOURS hours
+LAST_HOURS=100
+
+# Assume we are running from the correct directory
+ACID="$PWD/acid.py"
+TMP_DIR="$PWD/pypi_tmp"
+mkdir "$TMP_DIR"
+
+for package in $(yolk -C "$LAST_HOURS" | grep -v '^ ' | sed 's/ .*//')
+do
+ echo
+ echo "$package"
+
+ mkdir "$TMP_DIR/$package"
+ if [ $? -ne 0 ]
+ then
+ echo 'Skipping already checked package'
+ continue;
+ fi
+
+ cd "$TMP_DIR/$package"
+
+ yolk --fetch-package="$package"
+ if [ $? -ne 0 ]
+ then
+ echo 'ERROR: yolk failed'
+ continue;
+ fi
+
+ tar xf "$package"*.tar.gz
+ if [ $? -ne 0 ]
+ then
+ unzip "$package"*.zip
+ if [ $? -ne 0 ]
+ then
+ echo 'ERROR: Both untar and unzip failed'
+ continue;
+ fi
+ fi
+
+ "$ACID" "$TMP_DIR/$package"
+ if [ $? -ne 0 ]
+ then
+ break;
+ fi
+done

0 comments on commit 2ff7d98

Please sign in to comment.