travis_script.sh 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. #!/bin/bash
  2. # Copyright (c) Jupyter Development Team.
  3. # Distributed under the terms of the Modified BSD License.
  4. set -ex
  5. export DISPLAY=:99.0
  6. sh -e /etc/init.d/xvfb start || true
  7. export PATH="$MINICONDA_DIR/bin:$PATH"
  8. source activate test
  9. if [[ $GROUP == py2 || $GROUP == py3 ]]; then
  10. # Run the python tests
  11. py.test -v
  12. fi
  13. if [[ $GROUP == js ]]; then
  14. jlpm build:packages
  15. jlpm build:test
  16. # Allow the tests to fail once due to slow CI.
  17. jlpm test || jlpm test
  18. jlpm run clean
  19. fi
  20. if [[ $GROUP == js_cov ]]; then
  21. jlpm run build:packages
  22. jlpm run build:test
  23. # Allow the tests to fail once due to slow CI.
  24. jlpm run coverage || jlpm run coverage
  25. # Run the services node example.
  26. pushd packages/services/examples/node
  27. python main.py
  28. popd
  29. jlpm run clean
  30. fi
  31. if [[ $GROUP == js_services ]]; then
  32. jlpm build:packages
  33. jlpm build:test
  34. # Allow the tests to fail once due to slow CI.
  35. jlpm run test:services || jlpm run test:services
  36. fi
  37. if [[ $GROUP == docs ]]; then
  38. # Run the link check - allow for a link to fail once
  39. py.test --check-links -k .md . || py.test --check-links -k .md --lf .
  40. # Build the api docs
  41. jlpm run docs
  42. # Verify tutorial docs build
  43. pushd docs
  44. conda remove --name test_docs --all || true
  45. conda env create -n test_docs -f environment.yml
  46. source activate test_docs
  47. make html
  48. source deactivate
  49. popd
  50. fi
  51. if [[ $GROUP == integrity ]]; then
  52. # Build the packages individually.
  53. jlpm run build:src
  54. # Make sure the examples build
  55. jlpm run build:examples
  56. # Make sure we have CSS that can be converted with postcss
  57. jlpm global add postcss-cli
  58. jlpm config set prefix ~/.yarn
  59. ~/.yarn/bin/postcss packages/**/style/*.css --dir /tmp
  60. # Make sure we can successfully load the dev app.
  61. python -m jupyterlab.selenium_check --dev-mode
  62. # Make sure we can run the built app.
  63. jupyter labextension install ./jupyterlab/tests/mock_packages/extension
  64. python -m jupyterlab.selenium_check
  65. jupyter labextension list
  66. # Make sure we can non-dev install.
  67. conda remove --name test_install --all || true
  68. conda create -n test_install notebook python=3.5
  69. source activate test_install
  70. pip install ".[test]" # this populates <sys_prefix>/share/jupyter/lab
  71. python -m jupyterlab.selenium_check
  72. # Make sure we can start and kill the lab server
  73. jupyter lab --no-browser &
  74. TASK_PID=$!
  75. # Make sure the task is running
  76. ps -p $TASK_PID || exit 1
  77. sleep 5
  78. kill $TASK_PID
  79. wait $TASK_PID
  80. source deactivate
  81. fi
  82. if [[ $GROUP == cli ]]; then
  83. # Test the cli apps.
  84. jupyter lab clean
  85. jupyter lab build
  86. jupyter lab path
  87. pushd jupyterlab/tests/mock_packages
  88. jupyter labextension link extension --no-build
  89. jupyter labextension unlink extension --no-build
  90. jupyter labextension link extension --no-build
  91. jupyter labextension unlink @jupyterlab/mock-extension --no-build
  92. jupyter labextension install extension --no-build
  93. jupyter labextension list
  94. jupyter labextension disable @jupyterlab/mock-extension
  95. jupyter labextension enable @jupyterlab/mock-extension
  96. jupyter labextension disable @jupyterlab/notebook-extension
  97. jupyter labextension uninstall @jupyterlab/mock-extension --no-build
  98. jupyter labextension uninstall @jupyterlab/notebook-extension --no-build
  99. popd
  100. # Make sure we can call help on all the cli apps.
  101. jupyter lab -h
  102. jupyter lab build -h
  103. jupyter lab clean -h
  104. jupyter lab path -h
  105. jupyter labextension link -h
  106. jupyter labextension unlink -h
  107. jupyter labextension install -h
  108. jupyter labextension uninstall -h
  109. jupyter labextension list -h
  110. jupyter labextension enable -h
  111. jupyter labextension disable -h
  112. # Make sure we can add and remove a sibling package.
  113. jlpm run add:sibling jupyterlab/tests/mock_packages/extension
  114. jlpm run build
  115. jlpm run remove:package extension
  116. jlpm run build
  117. jlpm run integrity
  118. # Test cli tools
  119. jlpm run get:dependency mocha
  120. jlpm run update:dependency mocha
  121. jlpm run remove:dependency mocha
  122. jlpm run get:dependency @jupyterlab/buildutils
  123. jlpm run get:dependency typescript
  124. jlpm run get:dependency react-native
  125. fi