diff --git a/README.md b/README.md index dd91edda80fc578d1a6638e9a6091d9eaee00e61..f0091062dc055663d91b62dd7569bcfe3475e17b 100644 --- a/README.md +++ b/README.md @@ -144,6 +144,34 @@ indeed, a developer may not only make mistakes, but may deliberately introduce or re-introduce bugs at some place to test code in another place. +Contributing to ASDF +-------------------- + +Bugs can be filled on ASDF by reporting them on the [Gitlab issue +tracker](https://gitlab.common-lisp.net/asdf/asdf/-/issues) or sending them to +the [asdf-devel mailing list](https://mailman.common-lisp.net/listinfo/asdf-devel). + +You can contribute code to ASDF development by forking the +[repository](https://gitlab.common-lisp.net/asdf/asdf) and sending a merge +request or sending a patch to the asdf-devel mailing list. + +If you fork the repository on Gitlab, note that Gitlab CI is enabled to help in +automated testing. While not exhaustive, this can help make sure you don't +inadvertantly break anything with your patch! The tests will be run any time +you submit a merge request or manually trigger a run using Gitlab's UI. In +order for the tests to run properly (namely the ASDF upgrade tests), you must +ensure your fork contains the tags for every released version of ASDF. If your +fork is freshly created, this will happen automatically. However, if there has +been a release since you forked, you need to update your tags. Assuming that +your fork is the `origin` remote and upstream is the `upstream` remote, you can +do this by running: + + git fetch upstream --tags + git push origin --tags + +If you would like to enable test jobs that use the Lisp scripting test harness, +set the variable `ENABLE_ASDF_TOOLS` on a pipeline. + Debugging ASDF -------------- @@ -297,3 +325,6 @@ How do I navigate this source tree? * [TODO](TODO) * Plenty of ideas for how to further improve ASDF (not all of them guaranteed good ideas.) + +* [gitlab-ci.yml](gitlab-ci.yml) + * A YAML file describing jobs for Gitlab CI to run. diff --git a/gitlab-ci.yml b/gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..3b9bd7d29a7a81d2cd760564cddced09cd92d7fc --- /dev/null +++ b/gitlab-ci.yml @@ -0,0 +1,208 @@ +############################################################################### +# Global configuration +############################################################################### + +variables: + # Just let the runner fetch and update the submodules for us. + GIT_SUBMODULE_STRATEGY: normal + + +# This causes pipelines to be created only on the default branch, tags, merge +# requests, and when triggered via the web interface. +workflow: + rules: + - if: $CI_MERGE_REQUEST_IID + - if: $CI_COMMIT_TAG + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + - if: $CI_PIPELINE_SOURCE == "web" + +# Split regression testing into a separate stage than upgrade tests. The +# upgrade tests tend to run slower and are generally less important than +# regression tests for most changes. +stages: + - build + - regression + - upgrade + +############################################################################### +# Build jobs +############################################################################### + +Build ASDF: + stage: build + image: debian:latest + script: + - apt-get update + - apt-get install -y --no-install-recommends git make + - make + artifacts: + paths: + - build/asdf.lisp + +Build docs: + stage: build + image: debian:latest + script: + - apt-get update + - apt-get install -y --no-install-recommends git make texinfo texlive + - make -C doc + artifacts: + paths: + - doc/asdf.html + - doc/asdf.info + - doc/asdf.pdf + +Build asdf-tools: + stage: build + image: mitmers/sbcl:latest + script: + - apt-get update + - apt-get install -y --no-install-recommends git make + - make -f Makefile-lisp-scripting build-asdf-tools + artifacts: + paths: + - build/asdf-tools + rules: + - if: $ENABLE_ASDF_TOOLS + +############################################################################### +# Testing Templates +############################################################################### + +.Regression tests: + stage: regression + image: mitmers/$l:$TAG + variables: + TAG: latest + script: + - apt-get update + - apt-get install -y --no-install-recommends git make + - make + - make test + artifacts: + paths: + - build/results/$l-test.text + needs: [] + +.Upgrade tests: + stage: upgrade + image: mitmers/$l:$TAG + variables: + TAG: latest + script: + - apt-get update + - apt-get install -y --no-install-recommends git make + - make + - make test-upgrade + artifacts: + paths: + - build/results/$l-upgrade.text + needs: [] + allow_failure: true + +.Scripting regression tests: + extends: .Regression tests + before_script: + - ln -s Makefile-lisp-scripting GNUmakefile + needs: + - Build asdf-tools + rules: + - if: $ENABLE_ASDF_TOOLS + +.Scripting upgrade tests: + extends: .Upgrade tests + before_script: + - ln -s Makefile-lisp-scripting GNUmakefile + needs: + - Build asdf-tools + rules: + - if: $ENABLE_ASDF_TOOLS + +############################################################################### +# Actual test jobs - Makefile based harness +############################################################################### + +ABCL regression tests: + extends: .Regression tests + variables: + l: abcl + +ABCL upgrade tests: + extends: .Upgrade tests + variables: + l: abcl + +CCL regression tests: + extends: .Regression tests + variables: + l: ccl + +CCL upgrade tests: + extends: .Upgrade tests + variables: + l: ccl + +ECL regression tests: + extends: .Regression tests + variables: + l: ecl + +ECL upgrade tests: + extends: .Upgrade tests + variables: + l: ecl + +SBCL regression tests: + extends: .Regression tests + variables: + l: sbcl + +SBCL upgrade tests: + extends: .Upgrade tests + variables: + l: sbcl + + +############################################################################### +# Actual test jobs - lisp scripting based harness +############################################################################### + +ABCL scripting regression tests: + extends: .Scripting regression tests + variables: + l: abcl + +ABCL scripting upgrade tests: + extends: .Scripting upgrade tests + variables: + l: abcl + +CCL scripting regression tests: + extends: .Scripting regression tests + variables: + l: ccl + +CCL scripting upgrade tests: + extends: .Scripting upgrade tests + variables: + l: ccl + +ECL scripting regression tests: + extends: .Scripting regression tests + variables: + l: ecl + +ECL scripting upgrade tests: + extends: .Scripting upgrade tests + variables: + l: ecl + +SBCL scripting regression tests: + extends: .Scripting regression tests + variables: + l: sbcl + +SBCL scripting upgrade tests: + extends: .Scripting upgrade tests + variables: + l: sbcl diff --git a/test/run-tests.sh b/test/run-tests.sh index 4a8ca294094531be791af31adf0bacbf71f2c51b..34a3a4097aa73dc09d81f7988687f457f724de50 100755 --- a/test/run-tests.sh +++ b/test/run-tests.sh @@ -476,6 +476,7 @@ run_upgrade_tests () { su=test/script-support.lisp tags="`upgrade_tags`" methods="`upgrade_methods`" + echo success > build/results/${lisp}-upgrade.status { for tag in $tags ; do for method in $methods ; do @@ -491,10 +492,21 @@ run_upgrade_tests () { echo "$icmd" echo "then copy/paste:" echo "(load \"$su\") (asdf-test::da) (test-upgrade $method \"$tag\")" - exit 1 ;} - fi ; done ; done - echo "Upgrade test succeeded for ${lisp}" + echo "failure" > "build/results/${lisp}-upgrade.status" ;} + fi ; done ; done ; + read status < "build/results/${lisp}-upgrade.status" + if [ "$status" = "success" ]; then + echo "Upgrade test succeeded for ${lisp}" + else + echo "Upgrade test failed for ${lisp}" + fi ; } 2>&1 | tee build/results/${lisp}-upgrade.text + # We need to reread the status because the piping to tee causes everything + # in the block above to be run in a subshell. + read status < "build/results/${lisp}-upgrade.status" + if [ "$status" = "failure" ]; then + exit 1 + fi } run_tests () { create_config diff --git a/test/test-run-program-unix.script b/test/test-run-program-unix.script index 1511414261350a0b5e13244bb4a5f66d5ca06748..b261b4531a14f17881bd3fbc4fd67f77913ea556 100644 --- a/test/test-run-program-unix.script +++ b/test/test-run-program-unix.script @@ -480,7 +480,7 @@ (let ((process-info (launch-program "./sleeper.sh 12 1"))) (handle-result "alive?" (process-alive-p process-info)) - (sleep 2) + (sleep 5) (handle-result "dead?" (not (process-alive-p process-info))) (wait-process process-info))) @@ -552,7 +552,7 @@ (let* ((process-info (launch-program "./sleeper.sh 12 1")) (status (process-status process-info))) (handle-result "running?" (equal :running status)) - (sleep 2) + (sleep 5) (multiple-value-bind (status exit-code) (process-status process-info) (handle-result "exited?" (equal :exited status)) @@ -568,7 +568,7 @@ #+(and lispworks (not lispworks7+)) (skip-test "Known to fail") (let* ((process-info (launch-program "./killer.sh"))) - (sleep 1) + (sleep 5) (multiple-value-bind (status code) (process-status process-info) (handle-result "exited or signaled?" @@ -588,7 +588,7 @@ (define-test ":exited (it exited >128; repeated query)" (let* ((process-info (launch-program "./killercontainer.sh"))) - (sleep 1) + (sleep 5) (multiple-value-bind (status code) (process-status process-info) (handle-result "exited?" (eq status :exited))