travis_script.sh 4.6 KB

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