From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/78409 Path: news.gmane.org!not-for-mail From: David Engster Newsgroups: gmane.emacs.gnus.general Subject: Re: Gnus automatic builds Date: Thu, 07 Apr 2011 21:21:46 +0200 Message-ID: <87vcyp27g5.fsf@randomsample.de> References: <8762qs3swu.fsf@ericabrahamsen.net> <87r59fr05z.fsf@lifelogs.com> <87bp0jpcl2.fsf@lifelogs.com> <87vcyr5jzt.fsf@randomsample.de> <87k4f7mclt.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1302204233 24497 80.91.229.12 (7 Apr 2011 19:23:53 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 7 Apr 2011 19:23:53 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M26712@lists.math.uh.edu Thu Apr 07 21:23:50 2011 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q7uo1-00011X-I9 for ding-account@gmane.org; Thu, 07 Apr 2011 21:23:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1Q7umw-0000k4-Ne; Thu, 07 Apr 2011 14:22:42 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Q7umt-0000jq-Rz for ding@lists.math.uh.edu; Thu, 07 Apr 2011 14:22:39 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1Q7ums-0004kt-Ai for ding@lists.math.uh.edu; Thu, 07 Apr 2011 14:22:39 -0500 Original-Received: from v3-1008.vxen.de ([79.140.41.8]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1Q7umq-00056m-JR for ding@gnus.org; Thu, 07 Apr 2011 21:22:36 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=randomsample.de; s=a; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:To:From; bh=w7J0Ek6Zevj6+AGyE5Z9/HVW/RVfSGb/BKMhqH2Z9Ys=; b=tUCDy7bwBhztpXVH9WQfUnyf3nUHhlP6LDJHTjLg+zmE+H2Q04wF6gZ5udOy5IuG8eGN4kG/fbeJVGyzJKfvh7H8E/79sTW8hvou5kMUKboeVLAYh995s3/DazQ3BDU6; Original-Received: from dslc-082-082-176-159.pools.arcor-ip.net ([82.82.176.159] helo=spaten) by v3-1008.vxen.de with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1Q7ump-0007Cf-Ce for ding@gnus.org; Thu, 07 Apr 2011 21:22:35 +0200 In-Reply-To: <87k4f7mclt.fsf@lifelogs.com> (Ted Zlatanov's message of "Wed, 6 Apr 2011 13:57:50 -0500") User-Agent: Gnus/5.110016 (No Gnus v0.16) Emacs/24.0.50 (gnu/linux) Mail-Copies-To: never Mail-Followup-To: ding@gnus.org X-Spam-Score: -2.0 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:78409 Archived-At: --=-=-= Content-Type: text/plain Ted Zlatanov writes: > OK. I'm OK with just the blamelist for failed builds, though I would > always add Katsumi Yamaoka, Lars, and me to it. OK, will do. Lars and Katsumi, if you're reading this, please let me know if this is OK. >>> Also does it run the ERT tests? I think it should, maybe as a separate >>> target. The registry.el and gnus-registry.el ERT tests write files to >>> the filesystem (using `make-temp-file') but otherwise there are no side >>> effects. > > DE> Not yet. I think we should use another Makefile rule for that. I'll see > DE> to it that I add something, probably 'make check', which will then > DE> depend on many smaller rules which run specific tests (like the registry > DE> tests). > > Up to you, however you want to do it. I've now added a new rule 'check' which will run the whole test suite. I think it's a good thing to have a rule for every test in lisp/Makefile, since during development one often has to run single tests and not the whole suite. I've now started with "test-registry". Problem is: ERT does not run under Emacs 22, nor under XEmacs. So only Emacs 23 and 24 will currently run the tests. Maybe someone will port ERT to XEmacs, then we can add that any time. I've also written a little test for NNTP connections; I've attached it to this mail. It also shows how one can test "real" Gnus functionality in batch mode on the buildbot server. It will connect news.gmane.org, get gmane.discuss, retrieve a single article from it (via message-id) and exit Gnus. The problem with these kinds of tests is that they depend on an external server. I added a simple check so that those test will only run if a ping to news.gmane.org succeeds, but still, the server might have other problems, which will lead to a failing test. So a failed NNTP test might not necessarily mean the last commit actually broke something, but a look in the logs should clear that up. The reason I did not commit gnustest-nntp.el yet is that I don't know where it should live. I'm hesitant to add it to gnus/lisp, because maybe we should have a dedicated directory for tests? We could also put other files in there we'll need for testing (some dummy mails for populating an IMAP folder, for instance). Suggestions? -David --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=gnustest-nntp.el Content-Transfer-Encoding: quoted-printable ;;; gnustest-nntp.el --- NNTP testing for Gnus ;; Copyright (C) 2011 Free Software Foundation, Inc. ;; Author: David Engster ;; This file is NOT part of GNU Emacs. ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ;; Boston, MA 02110-1301, USA. ;;; Commentary: ;;; Code: (require 'ert) (require 'net-utils) (defvar gnustest-nntp-server "news.gmane.org" "NNTP server used for testing.") (defun gnustest-ping-host (host) "Ping HOST once and return non-nil if successful." (let* ((ping-program-options '("-c" "1")) (buf (ping host)) proc) (sleep-for 0.5) (with-current-buffer buf (accept-process-output (get-buffer-process (current-buffer)) 2) (goto-char (point-min)) (prog1 (re-search-forward ",[ ]*1.*?received,[ ]*0" nil t) (when (setq proc (get-buffer-process (current-buffer))) (set-process-query-on-exit-flag proc nil)) (kill-buffer))))) (setq gnus-home-directory (concat temporary-file-directory (make-temp-name = "gnus-test-"))) (message "***** Using %s as temporary Gnus home." gnus-home-directory) (mkdir gnus-home-directory) (setq-default gnus-init-file nil) (require 'gnus-load) (setq gnus-select-method `(nntp ,gnustest-nntp-server)) (if (null (gnustest-ping-host gnustest-nntp-server)) (message "***** Skipping tests: Gmane doesn't seem to be available.") ;; Server seems to be available, so start Gnus. (message "***** Firing up Gnus; connecting to Gmane.") (gnus) (ert-deftest gnustest-nntp-run-simple-test () "Test Gnus with gmane.discuss." (set-buffer gnus-group-buffer) (gnus-group-jump-to-group "gmane.discuss") (gnus-group-get-new-news-this-group 1) (gnus-active "gmane.discuss") (message "***** Reading active from gmane.discuss.") (should (> (car (gnus-active "gmane.discuss")) 0)) (should (> (cdr (gnus-active "gmane.discuss")) 10000)) (gnus-group-unsubscribe-current-group) (gnus-group-set-current-level 1 1) (gnus-group-select-group 5) (message "***** Getting article with certain MID and check subject.") (set-buffer gnus-summary-buffer) (gnus-summary-refer-article "m3mxr8pa1t.fsf@quimbies.gnus.org") (should (string=3D (gnus-summary-article-subject) "Re: gwene idea: stri= p from from subject if present")) (gnus-summary-exit) (message "***** Quitting Gnus.") (set-buffer gnus-group-buffer) (gnus-group-save-newsrc) (gnus-group-exit)) ) --=-=-=--