travis_script.sh 4.6 KB

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