travis_script.sh 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. #!/bin/bash
  2. # Copyright (c) Jupyter Development Team.
  3. # Distributed under the terms of the Modified BSD License.
  4. set -ex
  5. set -o pipefail
  6. if [[ $GROUP == python ]]; then
  7. # Run the python tests
  8. py.test -v
  9. fi
  10. if [[ $GROUP == js ]]; then
  11. jlpm build:packages
  12. jlpm build:test
  13. jlpm test --loglevel success > /dev/null
  14. jlpm run clean
  15. fi
  16. if [[ $GROUP == js_cov ]]; then
  17. jlpm run build:packages
  18. jlpm run build:test
  19. jlpm run coverage --loglevel success > /dev/null
  20. # Run the services node example.
  21. pushd packages/services/examples/node
  22. python main.py
  23. popd
  24. jlpm run clean
  25. fi
  26. if [[ $GROUP == js_services ]]; then
  27. jlpm build:packages
  28. jlpm build:test
  29. jlpm run test:services
  30. fi
  31. if [[ $GROUP == docs ]]; then
  32. # Run the link check - allow for a link to fail once
  33. py.test --check-links -k .md . || py.test --check-links -k .md --lf .
  34. # Build the api docs
  35. jlpm run docs
  36. # Verify tutorial docs build
  37. pushd docs
  38. pip install sphinx sphinx_rtd_theme recommonmark
  39. make html
  40. popd
  41. fi
  42. if [[ $GROUP == integrity ]]; then
  43. # Run the integrity script first
  44. jlpm run integrity
  45. # Lint our files.
  46. jlpm run lint:check || (echo 'Please run `jlpm run lint` locally and push changes' && exit 1)
  47. # Build the packages individually.
  48. jlpm run build:src
  49. # Make sure the examples build
  50. jlpm run build:examples
  51. # Make sure we have CSS that can be converted with postcss
  52. jlpm global add postcss-cli
  53. jlpm config set prefix ~/.yarn
  54. ~/.yarn/bin/postcss packages/**/style/*.css --dir /tmp
  55. # Make sure we can successfully load the dev app.
  56. python -m jupyterlab.browser_check --dev-mode
  57. # Make sure core mode works
  58. jlpm run build:core
  59. python -m jupyterlab.browser_check --core-mode
  60. # Make sure we can run the built app.
  61. jupyter labextension install ./jupyterlab/tests/mock_packages/extension
  62. python -m jupyterlab.browser_check
  63. jupyter labextension list
  64. # Make sure the deprecated `selenium_check` command still works
  65. python -m jupyterlab.selenium_check
  66. # Make sure we can non-dev install.
  67. virtualenv -p $(which python3) test_install
  68. ./test_install/bin/pip install -q ".[test]" # this populates <sys_prefix>/share/jupyter/lab
  69. ./test_install/bin/python -m jupyterlab.browser_check
  70. # Make sure we can run the build
  71. ./test_install/bin/jupyter lab build
  72. # Make sure we can start and kill the lab server
  73. ./test_install/bin/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. fi
  81. if [[ $GROUP == cli ]]; then
  82. # Test the cli apps.
  83. jupyter lab clean
  84. jupyter lab build
  85. jupyter lab path
  86. pushd jupyterlab/tests/mock_packages
  87. jupyter labextension link extension --no-build
  88. jupyter labextension unlink extension --no-build
  89. jupyter labextension link extension --no-build
  90. jupyter labextension unlink @jupyterlab/mock-extension --no-build
  91. jupyter labextension install extension --no-build
  92. jupyter labextension list
  93. jupyter labextension disable @jupyterlab/mock-extension
  94. jupyter labextension enable @jupyterlab/mock-extension
  95. jupyter labextension disable @jupyterlab/notebook-extension
  96. jupyter labextension uninstall @jupyterlab/mock-extension --no-build
  97. jupyter labextension uninstall @jupyterlab/notebook-extension --no-build
  98. popd
  99. # Make sure we can call help on all the cli apps.
  100. jupyter lab -h
  101. jupyter lab build -h
  102. jupyter lab clean -h
  103. jupyter lab path -h
  104. jupyter labextension link -h
  105. jupyter labextension unlink -h
  106. jupyter labextension install -h
  107. jupyter labextension uninstall -h
  108. jupyter labextension list -h
  109. jupyter labextension enable -h
  110. jupyter labextension disable -h
  111. # Make sure we can add and remove a sibling package.
  112. jlpm run add:sibling jupyterlab/tests/mock_packages/extension
  113. jlpm run build
  114. jlpm run remove:package extension
  115. jlpm run build
  116. jlpm run integrity
  117. # Test cli tools
  118. jlpm run get:dependency mocha
  119. jlpm run update:dependency mocha
  120. jlpm run remove:dependency mocha
  121. jlpm run get:dependency @jupyterlab/buildutils
  122. jlpm run get:dependency typescript
  123. jlpm run get:dependency react-native
  124. # Test theme creation - make sure we can add it as a package, build,
  125. # and run browser
  126. pip install -q pexpect
  127. python scripts/create_theme.py
  128. mv foo packages
  129. jlpm run integrity || exit 0
  130. jlpm run build:packages
  131. jlpm run build:dev
  132. python -m jupyterlab.browser_check --dev-mode
  133. rm -rf packages/foo
  134. jlpm run integrity || exit 0
  135. fi