travis_script.sh 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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. # Run integrity first we we see the message.
  9. npm run integrity
  10. # Build the packages.
  11. npm run build:packages
  12. if [[ $GROUP == tests ]]; then
  13. # Run the JS and python tests
  14. py.test -v
  15. jlpm run build:test
  16. jlpm test
  17. jlpm run test:services || jlpm run test:services
  18. fi
  19. if [[ $GROUP == coverage ]]; then
  20. # Make sure the examples build
  21. jlpm run build:examples
  22. # Run the coverage and python tests.
  23. py.test -v
  24. jlpm run build:test
  25. jlpm run coverage
  26. jlpm run clean
  27. fi
  28. if [[ $GROUP == other ]]; then
  29. # Build the core assets.
  30. jlpm run build
  31. # Make sure we can successfully load the core app.
  32. python -m jupyterlab.selenium_check --core-mode
  33. # Make sure we can run the built app.
  34. jupyter labextension install ./jupyterlab/tests/mock_packages/extension
  35. python -m jupyterlab.selenium_check
  36. jupyter labextension list
  37. # Make sure we can non-dev install.
  38. conda create -n test_install notebook python=3.5
  39. source activate test_install
  40. pip install .
  41. jupyter lab build
  42. pip install selenium
  43. python -m jupyterlab.selenium_check
  44. source deactivate
  45. # Test the cli apps.
  46. jupyter lab clean
  47. jupyter lab build
  48. jupyter lab path
  49. pushd jupyterlab/tests/mock_packages
  50. jupyter labextension link extension --no-build
  51. jupyter labextension unlink extension --no-build
  52. jupyter labextension link extension --no-build
  53. jupyter labextension unlink @jupyterlab/mock-extension --no-build
  54. jupyter labextension install extension --no-build
  55. jupyter labextension list
  56. jupyter labextension disable @jupyterlab/mock-extension
  57. jupyter labextension enable @jupyterlab/mock-extension
  58. jupyter labextension disable @jupyterlab/notebook-extension
  59. jupyter labextension uninstall @jupyterlab/mock-extension --no-build
  60. jupyter labextension uninstall @jupyterlab/notebook-extension --no-build
  61. popd
  62. # Make sure we can call help on all the cli apps.
  63. jupyter lab -h
  64. jupyter lab build -h
  65. jupyter lab clean -h
  66. jupyter lab path -h
  67. jupyter labextension link -h
  68. jupyter labextension unlink -h
  69. jupyter labextension install -h
  70. jupyter labextension uninstall -h
  71. jupyter labextension list -h
  72. jupyter labextension enable -h
  73. jupyter labextension disable -h
  74. # Make sure the examples build
  75. jlpm run build:examples
  76. # Run the services node example.
  77. pushd packages/services/examples/node
  78. python main.py
  79. popd
  80. # Run the link check - allow for a link to fail once
  81. py.test --check-links -k .md . || py.test --check-links -k .md --lf .
  82. # Build the api docs
  83. jlpm run docs
  84. cp jupyter_plugins.png docs
  85. # Verify tutorial docs build
  86. pushd docs
  87. conda env create -n test_docs -f environment.yml
  88. source activate test_docs
  89. make html
  90. source deactivate
  91. popd
  92. # Make sure we have CSS that can be converted with postcss
  93. npm install -g postcss-cli
  94. postcss packages/**/style/*.css --dir /tmp
  95. # Make sure we can add and remove a sibling package.
  96. npm run add:sibling jupyterlab/tests/mock_packages/extension
  97. npm run build
  98. npm run remove:package extension
  99. npm run build
  100. npm run integrity
  101. # Test cli tools
  102. npm run get:dependency mocha
  103. npm run update:dependency mocha
  104. npm run remove:dependency mocha
  105. npm run get:dependency @jupyterlab/buildutils
  106. npm run get:dependency typescript
  107. npm run get:dependency react-native
  108. # Make sure we can make release assets
  109. jlpm run build:static
  110. if [ ! -f ./build/release_data.json ]; then
  111. echo "jlpm publish in jupyterlab unsucessful!"
  112. fi
  113. fi