diff options
| author | Michael Albinus | 2021-12-13 16:09:56 +0100 |
|---|---|---|
| committer | Michael Albinus | 2021-12-13 16:09:56 +0100 |
| commit | b30b33ed9b3cdacecebef73ad1131f03c635de7a (patch) | |
| tree | 51f74825579561f8267b0ba7d0b885dcd88378cf | |
| parent | c1476afb99fbba316832c12e584a633684966c09 (diff) | |
| download | emacs-b30b33ed9b3cdacecebef73ad1131f03c635de7a.tar.gz emacs-b30b33ed9b3cdacecebef73ad1131f03c635de7a.zip | |
ERT can generate JUnit test reports
* .gitignore: Add test/**/*.xml.
* admin/notes/emba: Mention JUnit test report.
* etc/NEWS: ERT can generate JUnit test reports.
* lisp/emacs-lisp/ert.el (xml-escape-string): Autoload.
(ert-write-junit-test-report)
(ert-write-junit-test-summary-report): New defuns.
(ert-run-tests-batch, ert-summarize-tests-batch-and-exit): Call them.
* test/Makefile.in (clean): Remove *.xml.
* test/README: Mention $EMACS_TEST_JUNIT_REPORT environment variable.
* test/infra/Makefile.in ($(FILE)): Generate header commentary.
(clean): Remove.
* test/infra/gitlab-ci.yml (variables): Set EMACS_TEST_JUNIT_REPORT.
(.job-template): Use it in script and after_script.
(.build-template, .gnustep-template, .filenotify-gio-template)
(.native-comp-template): Adapt rules.
(.test-template): Trigger JUnit test report.
* test/infra/test-jobs.yml: Regenerate.
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | admin/notes/emba | 4 | ||||
| -rw-r--r-- | etc/NEWS | 7 | ||||
| -rw-r--r-- | lisp/emacs-lisp/ert.el | 134 | ||||
| -rw-r--r-- | test/Makefile.in | 1 | ||||
| -rw-r--r-- | test/README | 3 | ||||
| -rw-r--r-- | test/infra/Makefile.in | 6 | ||||
| -rw-r--r-- | test/infra/gitlab-ci.yml | 22 | ||||
| -rw-r--r-- | test/infra/test-jobs.yml | 1 |
9 files changed, 159 insertions, 20 deletions
diff --git a/.gitignore b/.gitignore index f1abb2ab687..7baee47b0a1 100644 --- a/.gitignore +++ b/.gitignore | |||
| @@ -159,6 +159,7 @@ test/manual/etags/CTAGS | |||
| 159 | test/manual/indent/*.new | 159 | test/manual/indent/*.new |
| 160 | test/lisp/gnus/mml-sec-resources/random_seed | 160 | test/lisp/gnus/mml-sec-resources/random_seed |
| 161 | test/lisp/play/fortune-resources/fortunes.dat | 161 | test/lisp/play/fortune-resources/fortunes.dat |
| 162 | test/**/*.xml | ||
| 162 | 163 | ||
| 163 | # ctags, etags. | 164 | # ctags, etags. |
| 164 | TAGS | 165 | TAGS |
diff --git a/admin/notes/emba b/admin/notes/emba index f1b52b2cde0..2135c7a97cc 100644 --- a/admin/notes/emba +++ b/admin/notes/emba | |||
| @@ -63,6 +63,10 @@ They can be downloaded from the server, visiting the URL | |||
| 63 | <https://emba.gnu.org/emacs/emacs/-/pipelines>, and selecting the job | 63 | <https://emba.gnu.org/emacs/emacs/-/pipelines>, and selecting the job |
| 64 | in question. | 64 | in question. |
| 65 | 65 | ||
| 66 | Every pipeline generates a JUnit test report for the respective test | ||
| 67 | jobs, which can be inspected on the pipeline web page. This test | ||
| 68 | report counts completed ERT tests, aborted tests are not counted. | ||
| 69 | |||
| 66 | * Emba configuration | 70 | * Emba configuration |
| 67 | 71 | ||
| 68 | The emba configuration files are hosted on | 72 | The emba configuration files are hosted on |
| @@ -163,6 +163,12 @@ the previous definition to be discarded, which was probably not | |||
| 163 | intended when this occurs in batch mode. To remedy the error, rename | 163 | intended when this occurs in batch mode. To remedy the error, rename |
| 164 | tests so that they all have unique names. | 164 | tests so that they all have unique names. |
| 165 | 165 | ||
| 166 | +++ | ||
| 167 | *** ERT can generate JUnit test reports. | ||
| 168 | When environment variable 'EMACS_TEST_JUNIT_REPORT' is set, ERT | ||
| 169 | generates a JUnit test report under this file name. This is useful | ||
| 170 | for Emacs integration into CI/CD test environments. | ||
| 171 | |||
| 166 | ** Emoji | 172 | ** Emoji |
| 167 | 173 | ||
| 168 | +++ | 174 | +++ |
| @@ -1143,6 +1149,7 @@ This variable is bound to t during the preparation of a "*Help*" buffer. | |||
| 1143 | ** 'date-to-time' now assumes earliest values if its argument lacks | 1149 | ** 'date-to-time' now assumes earliest values if its argument lacks |
| 1144 | month, day, or time. For example, (date-to-time "2021-12-04") now | 1150 | month, day, or time. For example, (date-to-time "2021-12-04") now |
| 1145 | assumes a time of 00:00 instead of signaling an error. | 1151 | assumes a time of 00:00 instead of signaling an error. |
| 1152 | |||
| 1146 | 1153 | ||
| 1147 | * Changes in Emacs 29.1 on Non-Free Operating Systems | 1154 | * Changes in Emacs 29.1 on Non-Free Operating Systems |
| 1148 | 1155 | ||
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 946193e40dc..981e23931c2 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el | |||
| @@ -65,6 +65,8 @@ | |||
| 65 | (require 'pp) | 65 | (require 'pp) |
| 66 | (require 'map) | 66 | (require 'map) |
| 67 | 67 | ||
| 68 | (autoload 'xml-escape-string "xml.el") | ||
| 69 | |||
| 68 | ;;; UI customization options. | 70 | ;;; UI customization options. |
| 69 | 71 | ||
| 70 | (defgroup ert () | 72 | (defgroup ert () |
| @@ -247,7 +249,6 @@ in batch mode, an error is signalled. | |||
| 247 | "%s\\(\\s-\\|$\\)") | 249 | "%s\\(\\s-\\|$\\)") |
| 248 | "The regexp the `find-function' mechanisms use for finding test definitions.") | 250 | "The regexp the `find-function' mechanisms use for finding test definitions.") |
| 249 | 251 | ||
| 250 | |||
| 251 | (define-error 'ert-test-failed "Test failed") | 252 | (define-error 'ert-test-failed "Test failed") |
| 252 | (define-error 'ert-test-skipped "Test skipped") | 253 | (define-error 'ert-test-skipped "Test skipped") |
| 253 | 254 | ||
| @@ -677,7 +678,6 @@ and is displayed in front of the value of MESSAGE-FORM." | |||
| 677 | ,@body)) | 678 | ,@body)) |
| 678 | 679 | ||
| 679 | 680 | ||
| 680 | |||
| 681 | ;;; Facilities for running a single test. | 681 | ;;; Facilities for running a single test. |
| 682 | 682 | ||
| 683 | (defvar ert-debug-on-error nil | 683 | (defvar ert-debug-on-error nil |
| @@ -1437,7 +1437,9 @@ Returns the stats object." | |||
| 1437 | (if (getenv "EMACS_TEST_VERBOSE") | 1437 | (if (getenv "EMACS_TEST_VERBOSE") |
| 1438 | (ert-reason-for-test-result result) | 1438 | (ert-reason-for-test-result result) |
| 1439 | "")))) | 1439 | "")))) |
| 1440 | (message "%s" ""))))) | 1440 | (message "%s" "")) |
| 1441 | (when (getenv "EMACS_TEST_JUNIT_REPORT") | ||
| 1442 | (ert-write-junit-test-report stats))))) | ||
| 1441 | (test-started) | 1443 | (test-started) |
| 1442 | (test-ended | 1444 | (test-ended |
| 1443 | (cl-destructuring-bind (stats test result) event-args | 1445 | (cl-destructuring-bind (stats test result) event-args |
| @@ -1525,6 +1527,128 @@ the tests)." | |||
| 1525 | (backtrace)) | 1527 | (backtrace)) |
| 1526 | (kill-emacs 2)))) | 1528 | (kill-emacs 2)))) |
| 1527 | 1529 | ||
| 1530 | (defun ert-write-junit-test-report (stats) | ||
| 1531 | "Write a JUnit test report, generated from STATS." | ||
| 1532 | ;; https://www.ibm.com/docs/de/developer-for-zos/14.1.0?topic=formats-junit-xml-format | ||
| 1533 | ;; https://llg.cubic.org/docs/junit/ | ||
| 1534 | (unless (zerop (length (ert--stats-tests stats))) | ||
| 1535 | (when-let ((test-file | ||
| 1536 | (symbol-file | ||
| 1537 | (ert-test-name (aref (ert--stats-tests stats) 0)) 'ert--test))) | ||
| 1538 | (with-temp-file (file-name-with-extension test-file "xml") | ||
| 1539 | (insert "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n") | ||
| 1540 | (insert (format "<testsuites name=\"%s\" tests=\"%s\" failures=\"%s\" skipped=\"%s\" time=\"%s\">\n" | ||
| 1541 | (file-name-nondirectory test-file) | ||
| 1542 | (ert-stats-total stats) | ||
| 1543 | (ert-stats-completed-unexpected stats) | ||
| 1544 | (ert-stats-skipped stats) | ||
| 1545 | (float-time | ||
| 1546 | (time-subtract | ||
| 1547 | (ert--stats-end-time stats) | ||
| 1548 | (ert--stats-start-time stats))))) | ||
| 1549 | (insert (format " <testsuite id=\"0\" name=\"%s\" tests=\"%s\" failures=\"%s\" skipped=\"%s\" time=\"%s\" timestamp=\"%s\">\n" | ||
| 1550 | (file-name-nondirectory test-file) | ||
| 1551 | (ert-stats-total stats) | ||
| 1552 | (ert-stats-completed-unexpected stats) | ||
| 1553 | (ert-stats-skipped stats) | ||
| 1554 | (float-time | ||
| 1555 | (time-subtract | ||
| 1556 | (ert--stats-end-time stats) | ||
| 1557 | (ert--stats-start-time stats))) | ||
| 1558 | (ert--format-time-iso8601 (ert--stats-end-time stats)))) | ||
| 1559 | (insert " <properties>\n" | ||
| 1560 | (format " <property name=\"selector\" value=\"%s\"/>\n" | ||
| 1561 | (ert--stats-selector stats)) | ||
| 1562 | " </properties>\n") | ||
| 1563 | (cl-loop for test across (ert--stats-tests stats) | ||
| 1564 | for result = (ert-test-most-recent-result test) do | ||
| 1565 | (insert (format " <testcase name=\"%s\" status=\"%s\" time=\"%s\"" | ||
| 1566 | (xml-escape-string | ||
| 1567 | (symbol-name (ert-test-name test))) | ||
| 1568 | (ert-string-for-test-result | ||
| 1569 | result | ||
| 1570 | (ert-test-result-expected-p test result)) | ||
| 1571 | (ert-test-result-duration result))) | ||
| 1572 | (if (and (ert-test-result-expected-p test result) | ||
| 1573 | (not (ert-test-skipped-p result)) | ||
| 1574 | (zerop (length (ert-test-result-messages result)))) | ||
| 1575 | (insert "/>\n") | ||
| 1576 | (insert ">\n") | ||
| 1577 | (if (ert-test-skipped-p result) | ||
| 1578 | (insert (format " <skipped message=\"%s\" type=\"%s\">\n" | ||
| 1579 | (xml-escape-string | ||
| 1580 | (string-trim | ||
| 1581 | (ert-reason-for-test-result result))) | ||
| 1582 | (ert-string-for-test-result | ||
| 1583 | result | ||
| 1584 | (ert-test-result-expected-p | ||
| 1585 | test result))) | ||
| 1586 | (xml-escape-string | ||
| 1587 | (string-trim | ||
| 1588 | (ert-reason-for-test-result result))) | ||
| 1589 | "\n" | ||
| 1590 | " </skipped>\n") | ||
| 1591 | (unless | ||
| 1592 | (ert-test-result-type-p | ||
| 1593 | result (ert-test-expected-result-type test)) | ||
| 1594 | (insert (format " <failure message=\"%s\" type=\"%s\">\n" | ||
| 1595 | (xml-escape-string | ||
| 1596 | (string-trim | ||
| 1597 | (ert-reason-for-test-result result))) | ||
| 1598 | (ert-string-for-test-result | ||
| 1599 | result | ||
| 1600 | (ert-test-result-expected-p | ||
| 1601 | test result))) | ||
| 1602 | (xml-escape-string | ||
| 1603 | (string-trim | ||
| 1604 | (ert-reason-for-test-result result))) | ||
| 1605 | "\n" | ||
| 1606 | " </failure>\n"))) | ||
| 1607 | (unless (zerop (length (ert-test-result-messages result))) | ||
| 1608 | (insert " <system-out>\n" | ||
| 1609 | (xml-escape-string | ||
| 1610 | (ert-test-result-messages result)) | ||
| 1611 | " </system-out>\n")) | ||
| 1612 | (insert " </testcase>\n"))) | ||
| 1613 | (insert " </testsuite>\n") | ||
| 1614 | (insert "</testsuites>\n"))))) | ||
| 1615 | |||
| 1616 | (defun ert-write-junit-test-summary-report (&rest logfiles) | ||
| 1617 | "Write a JUnit summary test report, generated from LOGFILES." | ||
| 1618 | (let ((report (file-name-with-extension | ||
| 1619 | (getenv "EMACS_TEST_JUNIT_REPORT") "xml")) | ||
| 1620 | (tests 0) (failures 0) (skipped 0) (time 0) (id 0)) | ||
| 1621 | (with-temp-file report | ||
| 1622 | (dolist (logfile logfiles) | ||
| 1623 | (let ((test-file (file-name-with-extension logfile "xml"))) | ||
| 1624 | (when (file-readable-p test-file) | ||
| 1625 | (insert-file-contents-literally test-file) | ||
| 1626 | (when (looking-at-p | ||
| 1627 | (regexp-quote "<?xml version=\"1.0\" encoding=\"utf-8\"?>")) | ||
| 1628 | (delete-region (point) (line-beginning-position 2))) | ||
| 1629 | (when (looking-at | ||
| 1630 | "<testsuites name=\".+\" tests=\"\\(.+\\)\" failures=\"\\(.+\\)\" skipped=\"\\(.+\\)\" time=\"\\(.+\\)\">") | ||
| 1631 | (cl-incf tests (string-to-number (match-string 1))) | ||
| 1632 | (cl-incf failures (string-to-number (match-string 2))) | ||
| 1633 | (cl-incf skipped (string-to-number (match-string 3))) | ||
| 1634 | (cl-incf time (string-to-number (match-string 4))) | ||
| 1635 | (delete-region (point) (line-beginning-position 2))) | ||
| 1636 | (when (looking-at " <testsuite id=\"\\(0\\)\"") | ||
| 1637 | (replace-match (number-to-string id) nil nil nil 1) | ||
| 1638 | (cl-incf id 1)) | ||
| 1639 | (goto-char (point-max)) | ||
| 1640 | (beginning-of-line 0) | ||
| 1641 | (when (looking-at-p "</testsuites>") | ||
| 1642 | (delete-region (point) (line-beginning-position 2))) | ||
| 1643 | (narrow-to-region (point-max) (point-max))))) | ||
| 1644 | |||
| 1645 | (insert "</testsuites>\n") | ||
| 1646 | (widen) | ||
| 1647 | (goto-char (point-min)) | ||
| 1648 | (insert "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n") | ||
| 1649 | (insert (format "<testsuites name=\"%s\" tests=\"%s\" failures=\"%s\" skipped=\"%s\" time=\"%s\">\n" | ||
| 1650 | (file-name-nondirectory report) | ||
| 1651 | tests failures skipped time))))) | ||
| 1528 | 1652 | ||
| 1529 | (defun ert-summarize-tests-batch-and-exit (&optional high) | 1653 | (defun ert-summarize-tests-batch-and-exit (&optional high) |
| 1530 | "Summarize the results of testing. | 1654 | "Summarize the results of testing. |
| @@ -1540,6 +1664,8 @@ If HIGH is a natural number, the HIGH long lasting tests are summarized." | |||
| 1540 | ;; behavior. | 1664 | ;; behavior. |
| 1541 | (setq attempt-stack-overflow-recovery nil | 1665 | (setq attempt-stack-overflow-recovery nil |
| 1542 | attempt-orderly-shutdown-on-fatal-signal nil) | 1666 | attempt-orderly-shutdown-on-fatal-signal nil) |
| 1667 | (when (getenv "EMACS_TEST_JUNIT_REPORT") | ||
| 1668 | (apply #'ert-write-junit-test-summary-report command-line-args-left)) | ||
| 1543 | (let ((nlogs (length command-line-args-left)) | 1669 | (let ((nlogs (length command-line-args-left)) |
| 1544 | (ntests 0) (nrun 0) (nexpected 0) (nunexpected 0) (nskipped 0) | 1670 | (ntests 0) (nrun 0) (nexpected 0) (nunexpected 0) (nskipped 0) |
| 1545 | nnotrun logfile notests badtests unexpected skipped tests) | 1671 | nnotrun logfile notests badtests unexpected skipped tests) |
| @@ -1855,7 +1981,6 @@ Also sets `ert--results-progress-bar-button-begin'." | |||
| 1855 | ;; should test it again.) | 1981 | ;; should test it again.) |
| 1856 | "\n"))) | 1982 | "\n"))) |
| 1857 | 1983 | ||
| 1858 | |||
| 1859 | (defvar ert-test-run-redisplay-interval-secs .1 | 1984 | (defvar ert-test-run-redisplay-interval-secs .1 |
| 1860 | "How many seconds ERT should wait between redisplays while running tests. | 1985 | "How many seconds ERT should wait between redisplays while running tests. |
| 1861 | 1986 | ||
| @@ -2037,7 +2162,6 @@ STATS is the stats object; LISTENER is the results listener." | |||
| 2037 | (goto-char (1- (point-max))) | 2162 | (goto-char (1- (point-max))) |
| 2038 | buffer))))) | 2163 | buffer))))) |
| 2039 | 2164 | ||
| 2040 | |||
| 2041 | (defvar ert--selector-history nil | 2165 | (defvar ert--selector-history nil |
| 2042 | "List of recent test selectors read from terminal.") | 2166 | "List of recent test selectors read from terminal.") |
| 2043 | 2167 | ||
diff --git a/test/Makefile.in b/test/Makefile.in index f2c49584e7f..eeda2918fa3 100644 --- a/test/Makefile.in +++ b/test/Makefile.in | |||
| @@ -353,6 +353,7 @@ mostlyclean: | |||
| 353 | 353 | ||
| 354 | clean: | 354 | clean: |
| 355 | find . '(' -name '*.log' -o -name '*.log~' ')' $(FIND_DELETE) | 355 | find . '(' -name '*.log' -o -name '*.log~' ')' $(FIND_DELETE) |
| 356 | find . '(' -name '*.xml' -a ! -path '*resources*' ')' $(FIND_DELETE) | ||
| 356 | rm -f ${srcdir}/lisp/gnus/mml-sec-resources/random_seed | 357 | rm -f ${srcdir}/lisp/gnus/mml-sec-resources/random_seed |
| 357 | rm -f $(test_module_dir)/*.o $(test_module_dir)/*.so \ | 358 | rm -f $(test_module_dir)/*.o $(test_module_dir)/*.so \ |
| 358 | $(test_module_dir)/*.dll | 359 | $(test_module_dir)/*.dll |
diff --git a/test/README b/test/README index 4d447c9bf15..2bd84b5f9b3 100644 --- a/test/README +++ b/test/README | |||
| @@ -114,6 +114,9 @@ mode--only the names of the failed tests are listed. If the | |||
| 114 | $EMACS_TEST_VERBOSE environment variable is set, the failure summaries | 114 | $EMACS_TEST_VERBOSE environment variable is set, the failure summaries |
| 115 | will also include the data from the failing test. | 115 | will also include the data from the failing test. |
| 116 | 116 | ||
| 117 | If the $EMACS_TEST_JUNIT_REPORT environment variable is set to a file | ||
| 118 | name, a JUnit test report is generated under this name. | ||
| 119 | |||
| 117 | Some of the tests require a remote temporary directory | 120 | Some of the tests require a remote temporary directory |
| 118 | (autorevert-tests.el, filenotify-tests.el, shadowfile-tests.el and | 121 | (autorevert-tests.el, filenotify-tests.el, shadowfile-tests.el and |
| 119 | tramp-tests.el). Per default, a mock-up connection method is used | 122 | tramp-tests.el). Per default, a mock-up connection method is used |
diff --git a/test/infra/Makefile.in b/test/infra/Makefile.in index fd11d367983..e4f99743e09 100644 --- a/test/infra/Makefile.in +++ b/test/infra/Makefile.in | |||
| @@ -93,10 +93,8 @@ all: generate-test-jobs | |||
| 93 | 93 | ||
| 94 | .PHONY: generate-test-jobs $(FILE) $(SUBDIR_TARGETS) | 94 | .PHONY: generate-test-jobs $(FILE) $(SUBDIR_TARGETS) |
| 95 | 95 | ||
| 96 | generate-test-jobs: clean $(FILE) $(SUBDIR_TARGETS) | 96 | generate-test-jobs: $(FILE) $(SUBDIR_TARGETS) |
| 97 | 97 | ||
| 98 | $(FILE): | 98 | $(FILE): |
| 99 | $(AM_V_GEN) | 99 | $(AM_V_GEN) |
| 100 | 100 | @echo "# Generated by \"make generate-test-jobs\", don't edit." >$(FILE) | |
| 101 | clean: | ||
| 102 | @rm -f $(FILE) | ||
diff --git a/test/infra/gitlab-ci.yml b/test/infra/gitlab-ci.yml index b0ea6813b30..3903642c792 100644 --- a/test/infra/gitlab-ci.yml +++ b/test/infra/gitlab-ci.yml | |||
| @@ -44,6 +44,7 @@ workflow: | |||
| 44 | variables: | 44 | variables: |
| 45 | GIT_STRATEGY: fetch | 45 | GIT_STRATEGY: fetch |
| 46 | EMACS_EMBA_CI: 1 | 46 | EMACS_EMBA_CI: 1 |
| 47 | EMACS_TEST_JUNIT_REPORT: junit-test-report.xml | ||
| 47 | EMACS_TEST_TIMEOUT: 3600 | 48 | EMACS_TEST_TIMEOUT: 3600 |
| 48 | EMACS_TEST_VERBOSE: 1 | 49 | EMACS_TEST_VERBOSE: 1 |
| 49 | # Use TLS https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#tls-enabled | 50 | # Use TLS https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#tls-enabled |
| @@ -85,7 +86,7 @@ default: | |||
| 85 | # TODO: with make -j4 several of the tests were failing, for | 86 | # TODO: with make -j4 several of the tests were failing, for |
| 86 | # example shadowfile-tests, but passed without it. | 87 | # example shadowfile-tests, but passed without it. |
| 87 | - 'export PWD=$(pwd)' | 88 | - 'export PWD=$(pwd)' |
| 88 | - 'docker run -i -e EMACS_EMBA_CI=${EMACS_EMBA_CI} -e EMACS_TEST_TIMEOUT=${EMACS_TEST_TIMEOUT} -e EMACS_TEST_VERBOSE=${EMACS_TEST_VERBOSE} --volumes-from $(docker ps -q -f "label=com.gitlab.gitlab-runner.job.id=${CI_JOB_ID}"):ro --name ${test_name} ${CI_REGISTRY_IMAGE}:${target}-${BUILD_TAG} /bin/bash -c "git fetch ${PWD} HEAD && echo checking out these updated files && git diff --name-only FETCH_HEAD && ( git diff --name-only FETCH_HEAD | xargs git checkout -f FETCH_HEAD ) && make -j4 && make ${make_params}"' | 89 | - 'docker run -i -e EMACS_EMBA_CI=${EMACS_EMBA_CI} -e EMACS_TEST_JUNIT_REPORT=${EMACS_TEST_JUNIT_REPORT} -e EMACS_TEST_TIMEOUT=${EMACS_TEST_TIMEOUT} -e EMACS_TEST_VERBOSE=${EMACS_TEST_VERBOSE} --volumes-from $(docker ps -q -f "label=com.gitlab.gitlab-runner.job.id=${CI_JOB_ID}"):ro --name ${test_name} ${CI_REGISTRY_IMAGE}:${target}-${BUILD_TAG} /bin/bash -c "git fetch ${PWD} HEAD && echo checking out these updated files && git diff --name-only FETCH_HEAD && ( git diff --name-only FETCH_HEAD | xargs git checkout -f FETCH_HEAD ) && make -j4 && make ${make_params}"' |
| 89 | after_script: | 90 | after_script: |
| 90 | # - docker ps -a | 91 | # - docker ps -a |
| 91 | # - printenv | 92 | # - printenv |
| @@ -93,7 +94,8 @@ default: | |||
| 93 | # Prepare test artifacts. | 94 | # Prepare test artifacts. |
| 94 | - test -n "$(docker ps -aq -f name=${test_name})" && docker cp ${test_name}:checkout/test ${test_name} | 95 | - test -n "$(docker ps -aq -f name=${test_name})" && docker cp ${test_name}:checkout/test ${test_name} |
| 95 | - test -n "$(docker ps -aq -f name=${test_name})" && docker rm ${test_name} | 96 | - test -n "$(docker ps -aq -f name=${test_name})" && docker rm ${test_name} |
| 96 | - find ${test_name} ! -name "*.log" -type f -delete | 97 | - find ${test_name} ! \( -name "*.log" -o -name ${EMACS_TEST_JUNIT_REPORT} \) -type f -delete |
| 98 | # BusyBox find does not know -empty. | ||
| 97 | - find ${test_name} -type d -depth -exec rmdir {} + 2>/dev/null | 99 | - find ${test_name} -type d -depth -exec rmdir {} + 2>/dev/null |
| 98 | 100 | ||
| 99 | .build-template: | 101 | .build-template: |
| @@ -103,7 +105,6 @@ default: | |||
| 103 | when: always | 105 | when: always |
| 104 | - changes: | 106 | - changes: |
| 105 | - "**.in" | 107 | - "**.in" |
| 106 | - "**.yml" | ||
| 107 | - GNUmakefile | 108 | - GNUmakefile |
| 108 | - aclocal.m4 | 109 | - aclocal.m4 |
| 109 | - autogen.sh | 110 | - autogen.sh |
| @@ -112,7 +113,7 @@ default: | |||
| 112 | - lib/malloc/*.{h,c} | 113 | - lib/malloc/*.{h,c} |
| 113 | - lisp/emacs-lisp/*.el | 114 | - lisp/emacs-lisp/*.el |
| 114 | - src/*.{h,c} | 115 | - src/*.{h,c} |
| 115 | - test/infra/Dockerfile.emba | 116 | - test/infra/* |
| 116 | - changes: | 117 | - changes: |
| 117 | # gfilemonitor, kqueue | 118 | # gfilemonitor, kqueue |
| 118 | - src/gfilenotify.c | 119 | - src/gfilenotify.c |
| @@ -133,9 +134,11 @@ default: | |||
| 133 | name: ${test_name} | 134 | name: ${test_name} |
| 134 | public: true | 135 | public: true |
| 135 | expire_in: 1 week | 136 | expire_in: 1 week |
| 137 | when: always | ||
| 136 | paths: | 138 | paths: |
| 137 | - ${test_name}/ | 139 | - ${test_name}/ |
| 138 | when: always | 140 | reports: |
| 141 | junit: ${test_name}/${EMACS_TEST_JUNIT_REPORT} | ||
| 139 | 142 | ||
| 140 | .gnustep-template: | 143 | .gnustep-template: |
| 141 | rules: | 144 | rules: |
| @@ -143,12 +146,11 @@ default: | |||
| 143 | - if: '$CI_PIPELINE_SOURCE == "schedule"' | 146 | - if: '$CI_PIPELINE_SOURCE == "schedule"' |
| 144 | changes: | 147 | changes: |
| 145 | - "**.in" | 148 | - "**.in" |
| 146 | - "**.yml" | ||
| 147 | - src/ns*.{h,m} | 149 | - src/ns*.{h,m} |
| 148 | - src/macfont.{h,m} | 150 | - src/macfont.{h,m} |
| 149 | - lisp/term/ns-win.el | 151 | - lisp/term/ns-win.el |
| 150 | - nextstep/** | 152 | - nextstep/** |
| 151 | - test/infra/Dockerfile.emba | 153 | - test/infra/* |
| 152 | 154 | ||
| 153 | .filenotify-gio-template: | 155 | .filenotify-gio-template: |
| 154 | rules: | 156 | rules: |
| @@ -156,12 +158,11 @@ default: | |||
| 156 | - if: '$CI_PIPELINE_SOURCE == "schedule"' | 158 | - if: '$CI_PIPELINE_SOURCE == "schedule"' |
| 157 | changes: | 159 | changes: |
| 158 | - "**.in" | 160 | - "**.in" |
| 159 | - "**.yml" | ||
| 160 | - lisp/autorevert.el | 161 | - lisp/autorevert.el |
| 161 | - lisp/filenotify.el | 162 | - lisp/filenotify.el |
| 162 | - lisp/net/tramp-sh.el | 163 | - lisp/net/tramp-sh.el |
| 163 | - src/gfilenotify.c | 164 | - src/gfilenotify.c |
| 164 | - test/infra/Dockerfile.emba | 165 | - test/infra/* |
| 165 | - test/lisp/autorevert-tests.el | 166 | - test/lisp/autorevert-tests.el |
| 166 | - test/lisp/filenotify-tests.el | 167 | - test/lisp/filenotify-tests.el |
| 167 | 168 | ||
| @@ -171,11 +172,10 @@ default: | |||
| 171 | - if: '$CI_PIPELINE_SOURCE == "schedule"' | 172 | - if: '$CI_PIPELINE_SOURCE == "schedule"' |
| 172 | changes: | 173 | changes: |
| 173 | - "**.in" | 174 | - "**.in" |
| 174 | - "**.yml" | ||
| 175 | - lisp/emacs-lisp/comp.el | 175 | - lisp/emacs-lisp/comp.el |
| 176 | - lisp/emacs-lisp/comp-cstr.el | 176 | - lisp/emacs-lisp/comp-cstr.el |
| 177 | - src/comp.{h,m} | 177 | - src/comp.{h,m} |
| 178 | - test/infra/Dockerfile.emba | 178 | - test/infra/* |
| 179 | - test/src/comp-resources/*.el | 179 | - test/src/comp-resources/*.el |
| 180 | - test/src/comp-tests.el | 180 | - test/src/comp-tests.el |
| 181 | timeout: 8 hours | 181 | timeout: 8 hours |
diff --git a/test/infra/test-jobs.yml b/test/infra/test-jobs.yml index bad8575b5c5..63b052bf8c7 100644 --- a/test/infra/test-jobs.yml +++ b/test/infra/test-jobs.yml | |||
| @@ -1,3 +1,4 @@ | |||
| 1 | # Generated by "make generate-test-jobs", don't edit. | ||
| 1 | 2 | ||
| 2 | test-lib-src-inotify: | 3 | test-lib-src-inotify: |
| 3 | stage: normal | 4 | stage: normal |