Commit Graph

225 Commits

Author SHA1 Message Date
Noam Postavsky
df9541a4d3 Fix `message' advice used in tests
* test/el-get-tests.el (el-get-test-catch-output): Handle the (message
nil) case.
2016-10-22 09:13:04 -04:00
Noam Postavsky
e9fe611373 test/travis-ci.sh (prereqs): Download package-x.el 2016-10-08 22:28:58 -04:00
Noam Postavsky
c00a03a26f Fix secure URL checking for :type elpa
* el-get-methods.el (el-get-insecure-check): Also consider URLs
satisfying `file-name-absolute-p' to be secure.  `package-archives' uses
absolute file names *without* file:// prefix, so we have allow this too.
* methods/el-get-elpa.el (el-get-elpa-package-id):
(el-get-elpa-package-archive-base): New compat functions.
* methods/el-get-elpa.el (el-get-elpa-install): Call
`el-get-insecure-check' after ensuring `package-archive-contents' is
initialized.
2016-10-08 22:00:41 -04:00
Noam Postavsky
58d071a26c Additional (failing) test for ELPA+allow-insecure 2016-10-08 20:04:12 -04:00
Mykola Nikishov
63be589c1d Delegate install and update actions for github to git
github method, as a derived method, should build a final repository URL
and let parent's respective methods do the actual work.

Register new 'el-get-github-pull function as update method.

Make both methods, 'el-get-github-pull and 'el-get-github-clone,
implement the same pattern:

- Delegate check if URL is a secure one to the parent method
- Ignore :url from package's recipe passed by 'el-get-do-update as it
  makes no sense
- Unconditionally build package repository URL with 'el-get-github-url
- Call respective git method
2016-09-19 08:42:04 +03:00
Noam Postavsky
b8cfcd981a elpa-feature test: don't make a mess in $HOME
* test/el-get-tests.el (el-get-elpa-feature): Use the temp
user-emacs-directory, don't make a mess in user's $HOME.
2016-09-18 16:18:04 -04:00
Noam Postavsky
e80bfd4ec9 Prevent jump to debugger from failed assertion
In Emacs 25.1, a failed cl-assert will always jump to the debugger if
debug-on-error is non-nil.  In batch-mode runs this becomes confusing
with the message suppression we have, and the crazy long stack traces
that are printed are really hard to read, so suppress this debugger
behaviour with advice as well.
2016-09-18 16:03:30 -04:00
Noam Postavsky
2b5be4d239 Remove travis log-folding hack; fix broken recipes
A couple of recipes that were failing the test snuck in while the test
was accidentally disabled.

* .travis.yml (script):
* test/travis-ci.sh (prereqs): Remove folded_call; it was folding too
much, which made the logs needlessly difficult to read.
* recipes/flycheck-package.rcp (flycheck-package):
* recipes/idle-require.rcp (idle-require): Add :description field.
2016-09-09 20:54:23 -04:00
Noam Postavsky
cfd460698d * test/travis-ci.sh: Fix Emacs version check. 2016-09-09 20:48:19 -04:00
Mykola Nikishov
cb02c71181 Customize list of secure URL protocols via 'el-get-secure-protocols 2016-09-06 08:49:29 +03:00
Mykola Nikishov
600ddcee76 Treat 'bzr+ssh', 'git+ssh' and 'sftp' as secure protocols 2016-09-05 06:48:21 +03:00
Mykola Nikishov
6a724f9168 Add few more 'insecure' URLs to the test
For some reason, these, X-over-SSH protocols, are not considered as
secure by 'el-get-insecure-check:
- git+ssh
- bzr+ssh
- sftp
2016-09-05 06:48:21 +03:00
Mykola Nikishov
17b0da4984 Package with empty :checksum is insecure
For compatibility with Emacs versions before 24.4, fall back to
'string-match if 'string-blank-p from subr-x is not available.
2016-09-05 06:48:18 +03:00
Mykola Nikishov
070dddde7e Consider URL pointing to a local file as secure
URL starting with 'file:///' (hostname is empty) is secure because it
always points to a local file.

OTOH, 'file://example.com/' (with any hostname, including 'localhost'
and '127.0.0.1') is insecure as it may refer to the remote file and
deciding if some hostname is actually a local in given moment in time is
tricky and too error-prone.
2016-09-03 22:22:14 +03:00
Mykola Nikishov
e8c3ec6c80 Add test for 'el-get-insecure-check 2016-09-01 13:39:24 +03:00
Noam Postavsky
eb264f7c64 Fix compilation on different Emacs versions
* .travis.yml:
* test/travis-ci.sh: Don't treat byte-compilation warnings as errors for
downloaded package.el and ert.

* el-get-dependencies.el (el-get-auto-dependencies): Don't use
`read-from-whole-string', it's obsolete in Emacs 25.

* el-get-list-packages.el (el-get-package-menu-sort-by-column): Don't
assume `mouse-select-window' is fbound, it may not be for non-X builds.
2016-05-14 07:47:28 -04:00
Noam Postavsky
7ff73eb11d Test more Emacs versions in Travis CI
Using binaries from https://github.com/npostavs/emacs-travis
2016-05-12 20:08:48 -04:00
Noam Postavsky
00e08b148d .travis.yml: don't hide compile failure
Fix compile warnings that snuck in while the test was broken.
2015-11-13 23:39:27 -05:00
Noam Postavsky
d79c395f22 enable ert tests in travis, reorganize test files
rename ert tests file test.el => el-get-tests.el
move el-get-issue-* files to separate dir
2015-11-13 23:39:27 -05:00
Takafumi Arakaki
dfb8c9c1ef Add a failing new test: el-get-elpa-feature 2015-11-13 23:39:27 -05:00
Takafumi Arakaki
6e4622ec9a el-get-with-temp-home: new helper for tests
Also suppress output for passing tests.
2015-11-13 23:39:27 -05:00
Noam Postavsky
6707f8c1d8 let ert shell scripts use test-utils.sh 2015-11-13 23:39:27 -05:00
Iqbal Ansari
2edca8d941 Fix test script to use el-get-read-from-file instead of
`el-get-read-recipe-file`

`el-get-read-recipe-file` was renamed to `el-get-read-from-file` in #2212
2015-09-29 00:28:02 +05:30
Noam Postavsky
6968ff8ada split el-get-check.el from el-get-recipes.el
Move checking functions from el-get-recipes.el
2015-07-05 15:53:05 -04:00
Noam Postavsky
1385ebb515 .travis.yml: display environment in log
test/travis-ci.sh: remove TRAVIS_COMMIT_RANGE work around, it's no
longer needed.
2015-03-27 17:37:32 -04:00
tarao
4ab4885297 Force installing the package. 2015-03-04 00:24:58 +09:00
Noam Postavsky
f540acc924 test/check-recipe.el: reuse el-get-check-recipe-batch 2015-01-26 14:57:24 -05:00
Noam Postavsky
1d30abffb9 Update package.el git revision hash
Following Emacs' transition to git, the hashes of commits have changed
because some commits were edited to remove bzr specific
referefences (e.g. revnos in commit messages).

Note: the equivalent bzr commit had revno 103620 on trunk, revid
cyd@stupidchicken.com-20110310234046-vzsm4s3pjxc1aids.

First line of commit: "Fix package.el handling of version numbers like
1.0pre6"

* recipes/package.rcp (package):
* test/travis-ci.sh: Update hash for last package.el version compatible
  with Emacs 23.
2014-11-20 16:20:58 -05:00
Noam Postavsky
537a90848d fix typo in test/travis-ci.sh 2014-10-28 19:07:40 -04:00
Noam Postavsky
60ce053515 Improve travis log a bit
Log SHA1 of commit range tested.
Fold output of compilation.
2014-10-26 14:51:48 -04:00
Noam Postavsky
2c131434ed show function definitions for log 2014-10-26 14:05:31 -04:00
Noam Postavsky
94ee9090ea reorganize travis test scripts
Also skip testing with emacs-snapshot if only recipes have been updated.

* test/run-travis-ci.sh: Deleted.
* test/travis-ci.sh (prereqs, byte-compile, check-recipes,
  check-whitespace): New functions.
* .travis.yml (language): emacs-lisp -> generic. emacs-lisp is not
  recognized, so Travis would treat it as ruby and needlessly install
  rvm.
  (install, script): Call functions from travis-ci.sh.
2014-10-26 13:21:57 -04:00
Iqbal Ansari
bb7ccfb49a Do not depend on url-parse for extracting hosts from urls
This fixes for #1939. Tests have been added to test/el-get-issue-1939.el
2014-10-15 21:37:52 +05:30
Iqbal Ansari
4c065f189d Fix some typos and style issues 2014-10-05 20:53:21 +05:30
Iqbal Ansari
c5d3a475ee Add tests for git shallow clones functionality 2014-10-05 12:47:13 +05:30
Rüdiger Sonderfeld
570555b72f Change bash shebang to use /usr/bin/env.
That makes those scripts usable on systems where GNU bash is not in
/bin/.  E.g., NixOS.
2014-08-18 01:09:16 +02:00
Noam Postavsky
56164e7a21 el-get-issue-407.el: remove el-get-notify hack
It's only to support the now-obsolete "stable" version; test-setup.el
already sets el-get-notify-type to 'message.
2014-06-09 22:19:05 -04:00
Noam Postavsky
46007a0334 el-get-issue-407.el: skip emacswiki install
It's not relevant to what we're testing for there, and it takes quite a
long time.
2014-06-09 22:18:44 -04:00
Noam Postavsky
34f3068883 Test that basic installer loads el-get immediately
Closes #1457
2014-06-09 22:18:04 -04:00
Noam Postavsky
8205f3eaa2 Rename el-get-(generate -> use)-autoloads
This reflects what the variable actually does.
2014-06-01 11:20:34 -04:00
Noam Postavsky
92a39c84fe Don't cache http checksums.
- If the file was changed on the HTTP server before you restarted emacs,
  the checksum wouldn't be recomputed because it would be taken from the
  cache.

- The cached value was wrongly including the HTTP headers in the
  computation. Added a test for this.

- Computing a SHA1 is not so expensive that it needs the complication of
  caching.

* methods/el-get-http.el
(el-get-http-checksums): remove.
(el-get-http-retrieve-callback): don't compute hash on HTTP headers.
(el-get-http-compute-checksum): always compute a fresh hash.

* test/el-get-issue-1752.el: new test.
2014-05-28 18:01:52 -04:00
Noam Postavsky
65ecce8567 test_recipe: extend (not replace) el-get-sources
This allows, for example setting ((:name package :post-init nil)) to
avoid downloading all the other archives when testing an ELPA recipe.
2014-05-26 19:06:24 -04:00
Noam Postavsky
dab9b81690 add whitespace check to travis test 2014-05-17 22:36:14 -04:00
Noam Postavsky
0938229093 avoid local variable queries during tests 2014-05-17 22:36:14 -04:00
Noam Postavsky
4b31e99a4a check-recipe-batch: recipes/*.rcp -> recipes/
The travis script has set -e enabled which prints out command line to be
executed. However, it prints the command line after glob expansion, so
having recipes/*.rcp in a command would be a pain to scroll through.
2014-05-01 21:00:32 -04:00
Noam Postavsky
09f9d9a82e check recipes in travis, fix or muffle warnings
suppressed warnings: -Wno-features -Wno-github -Wno-autoloads, because
too many recipes trigger them to handle right now.
2014-05-01 21:00:31 -04:00
Noam Postavsky
979314ddff some tweaks to travis tests
- use github emacs mirror for travis test: repo.or.cz was down a few
  times; since github.com must be up to run anything anyway, it's
  preferable to rely on that instead.

- run all the apt commands separately; there have been some intermittent
  failures, this should make it easier to diagnose.

- suppress curl progress bar

- show emacs --version before running tests
2014-04-23 23:29:43 -04:00
Noam Postavsky
0836da5f43 refactor common parts of test_recipe and run_test 2014-04-22 22:52:51 -04:00
Noam Postavsky
a66ed00b8b refactor run_test into test-utils.sh 2014-04-22 22:17:59 -04:00
Noam Postavsky
160552a6cf refactor test_recipe into test-utils.sh 2014-04-22 21:30:09 -04:00