travis_script.sh 4.2 KB

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