travis_script.sh 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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="$HOME/miniconda/bin:$PATH"
  8. npm run build:examples
  9. if [[ $GROUP == tests ]]; then
  10. # Run the JS and python tests
  11. py.test
  12. npm run clean
  13. npm run build:src
  14. npm run build:test
  15. npm test
  16. npm run test:services || npm run test:services
  17. # Make sure we have CSS that can be converted with postcss
  18. npm install -g postcss-cli
  19. postcss packages/**/style/*.css --dir /tmp
  20. # Run the publish script in jupyterlab
  21. cd jupyterlab
  22. npm run publish
  23. if [ ! -f ./build/release_data.json ]; then
  24. echo "npm publish in jupyterlab unsucessful!"
  25. fi
  26. fi
  27. if [[ $GROUP == coverage_and_docs ]]; then
  28. # Run the coverage and python tests.
  29. py.test
  30. npm run build
  31. npm run build:test
  32. npm run coverage
  33. # Run the link check
  34. pip install -q pytest-check-links
  35. py.test --check-links -k .md .
  36. # Build the api docs
  37. npm run docs
  38. cp jupyter_plugins.png docs
  39. # Verify tutorial docs build
  40. pushd docs
  41. conda env create -n test_docs -f environment.yml
  42. source activate test_docs
  43. make html
  44. source deactivate
  45. popd
  46. fi
  47. if [[ $GROUP == cli ]]; then
  48. # Make sure we can successfully load the core app.
  49. pip install selenium
  50. python -m jupyterlab.selenium_check --core-mode
  51. # Make sure we can build and run the app.
  52. jupyter lab build
  53. python -m jupyterlab.selenium_check
  54. jupyter labextension list
  55. # Test the cli apps.
  56. jupyter lab clean
  57. jupyter lab build
  58. jupyter lab path
  59. jupyter labextension link jupyterlab/tests/mockextension --no-build
  60. jupyter labextension unlink jupyterlab/tests/mockextension --no-build
  61. jupyter labextension link jupyterlab/tests/mockextension --no-build
  62. jupyter labextension listlinked
  63. jupyter labextension unlink @jupyterlab/python-tests --no-build
  64. jupyter labextension install jupyterlab/tests/mockextension --no-build
  65. jupyter labextension list
  66. jupyter labextension disable @jupyterlab/python-tests
  67. jupyter labextension enable @jupyterlab/python-tests
  68. jupyter labextension disable @jupyterlab/notebook-extension
  69. jupyter labextension uninstall @jupyterlab/python-tests --no-build
  70. jupyter labextension uninstall @jupyterlab/notebook-extension --no-build
  71. # Make sure we can call help on all the cli apps.
  72. jupyter lab -h
  73. jupyter lab build -h
  74. jupyter lab clean -h
  75. jupyter lab path -h
  76. jupyter labextension link -h
  77. jupyter labextension unlink -h
  78. jupyter labextension install -h
  79. jupyter labextension uninstall -h
  80. jupyter labextension list -h
  81. jupyter labextension listlinked -h
  82. jupyter labextension enable -h
  83. jupyter labextension disable -h
  84. fi