travis_script.sh 2.8 KB

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