From c41c14c697396ee434c1794e83c15dd84f16753c Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Thu, 15 Sep 2022 13:09:10 +0100 Subject: [PATCH] Remove deprecated grunt code (#9506) GitOrigin-RevId: 2b19d73c593545aaa9f6eb88143d08c5df39a1be --- server-ce/bin/grunt | 5 ++ .../clsi/test/acceptance/scripts/full-test.sh | 23 --------- .../test/acceptance/scripts/settings.test.js | 49 ------------------- .../test/acceptance/scripts/full-test.sh | 23 --------- .../test/acceptance/scripts/full-test.sh | 23 --------- services/web/README.md | 15 ------ services/web/config/settings.defaults.js | 4 +- .../web/test/acceptance/scripts/full-test.sh | 40 --------------- 8 files changed, 6 insertions(+), 176 deletions(-) delete mode 100755 services/clsi/test/acceptance/scripts/full-test.sh delete mode 100644 services/clsi/test/acceptance/scripts/settings.test.js delete mode 100755 services/docstore/test/acceptance/scripts/full-test.sh delete mode 100755 services/real-time/test/acceptance/scripts/full-test.sh delete mode 100755 services/web/test/acceptance/scripts/full-test.sh diff --git a/server-ce/bin/grunt b/server-ce/bin/grunt index 1af49b2357..8b3e65730e 100755 --- a/server-ce/bin/grunt +++ b/server-ce/bin/grunt @@ -2,6 +2,7 @@ # Thin wrapper on old grunt tasks to ease migrating. set -e +set -x TASK="$1" shift 1 @@ -9,18 +10,22 @@ cd /overleaf/services/web case "$TASK" in user:create-admin) + echo "The grunt command is deprecated, run the create-user script using node instead" node modules/server-ce-scripts/scripts/create-user --admin "$@" ;; user:delete) + echo "The grunt command is deprecated, run the delete-user script using node instead" node modules/server-ce-scripts/scripts/delete-user "$@" ;; check:mongo) + echo "The grunt command is deprecated, run the check-mongodb script using node instead" node modules/server-ce-scripts/scripts/check-mongodb ;; check:redis) + echo "The grunt command is deprecated, run the check-redis script using node instead" node modules/server-ce-scripts/scripts/check-redis ;; diff --git a/services/clsi/test/acceptance/scripts/full-test.sh b/services/clsi/test/acceptance/scripts/full-test.sh deleted file mode 100755 index 953b49452a..0000000000 --- a/services/clsi/test/acceptance/scripts/full-test.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -x - -export SHARELATEX_CONFIG=`pwd`/test/acceptance/scripts/settings.test.js - -echo ">> Starting server..." - -grunt --no-color >server.log 2>&1 & - -echo ">> Server started" - -sleep 5 - -echo ">> Running acceptance tests..." -grunt --no-color mochaTest:acceptance -_test_exit_code=$? - -echo ">> Killing server" - -kill %1 - -echo ">> Done" - -exit $_test_exit_code diff --git a/services/clsi/test/acceptance/scripts/settings.test.js b/services/clsi/test/acceptance/scripts/settings.test.js deleted file mode 100644 index 79be996344..0000000000 --- a/services/clsi/test/acceptance/scripts/settings.test.js +++ /dev/null @@ -1,49 +0,0 @@ -const Path = require('path') - -module.exports = { - path: { - compilesDir: Path.join(__dirname, '../../../compiles'), - clsiCacheDir: Path.join(__dirname, '../../../cache'), - // synctexBaseDir: (project_id) -> Path.join(@compilesDir, project_id) - synctexBaseDir() { - return '/compile' - }, - sandboxedCompilesHostDir: process.env.SANDBOXED_COMPILES_HOST_DIR, - }, - - clsi: { - // strace: true - // archive_logs: true - commandRunner: 'docker-runner-sharelatex', - latexmkCommandPrefix: ['/usr/bin/time', '-v'], // on Linux - docker: { - image: process.env.TEXLIVE_IMAGE || 'texlive-full:2017.1-opt', - env: { - PATH: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/texlive/2017/bin/x86_64-linux/', - HOME: '/tmp', - }, - modem: { - socketPath: false, - }, - user: process.env.SIBLING_CONTAINER_USER || '111', - }, - }, - - internal: { - clsi: { - port: 3013, - load_port: 3044, - host: 'localhost', - }, - }, - - apis: { - clsi: { - url: 'http://localhost:3013', - }, - }, - - smokeTest: false, - project_cache_length_ms: 1000 * 60 * 60 * 24, - parallelFileDownloads: 1, -} diff --git a/services/docstore/test/acceptance/scripts/full-test.sh b/services/docstore/test/acceptance/scripts/full-test.sh deleted file mode 100755 index afd5ef2ecb..0000000000 --- a/services/docstore/test/acceptance/scripts/full-test.sh +++ /dev/null @@ -1,23 +0,0 @@ -#! /usr/bin/env bash - -# npm rebuild - -echo ">> Starting server..." - -grunt --no-color forever:app:start - -echo ">> Server started" - -sleep 20 - -echo ">> Running acceptance tests..." -grunt --no-color mochaTest:acceptance -_test_exit_code=$? - -echo ">> Killing server" - -grunt --no-color forever:app:stop - -echo ">> Done" - -exit $_test_exit_code diff --git a/services/real-time/test/acceptance/scripts/full-test.sh b/services/real-time/test/acceptance/scripts/full-test.sh deleted file mode 100755 index 8584cd17d0..0000000000 --- a/services/real-time/test/acceptance/scripts/full-test.sh +++ /dev/null @@ -1,23 +0,0 @@ -#! /usr/bin/env bash - -# npm rebuild - -echo ">> Starting server..." - -grunt --no-color forever:app:start - -echo ">> Server started" - -sleep 5 - -echo ">> Running acceptance tests..." -grunt --no-color mochaTest:acceptance -_test_exit_code=$? - -echo ">> Killing server" - -grunt --no-color forever:app:stop - -echo ">> Done" - -exit $_test_exit_code diff --git a/services/web/README.md b/services/web/README.md index 94790bb8f0..9a92d51cfb 100644 --- a/services/web/README.md +++ b/services/web/README.md @@ -10,19 +10,6 @@ a lot of logic around creating and editing projects, and account management. The rest of the Overleaf stack, along with information about contributing can be found in the [overleaf/overleaf](https://github.com/overleaf/overleaf) repository. -Build process ----------------- - -overleaf/web uses [Grunt](http://gruntjs.com/) to build its front-end related assets. - -Image processing tasks are commented out in the gruntfile and the needed packages aren't presently in the project's `package.json`. If the images need to be processed again (minified and sprited), start by fetching the packages (`npm install grunt-contrib-imagemin grunt-sprity`), then *decomment* the tasks in `Gruntfile.coffee`. After this, the tasks can be called (explicitly, via `grunt imagemin` and `grunt sprity`). - -New Docker-based build process ------------------------------- - -Note that the Grunt workflow from above should still work, but we are transitioning to a -Docker based testing workflow, which is documented below: - ### Running the app The app runs natively using npm and Node on the local system: @@ -32,8 +19,6 @@ $ npm install $ npm run start ``` -*Ideally the app would run in Docker like the tests below, but with host networking not supported in OS X, we need to run it natively until all services are Dockerised.* - ### Running Tests To run all tests run: diff --git a/services/web/config/settings.defaults.js b/services/web/config/settings.defaults.js index e3c9f16b45..8e07337e92 100644 --- a/services/web/config/settings.defaults.js +++ b/services/web/config/settings.defaults.js @@ -486,9 +486,7 @@ module.exports = { ? process.env.PRECOMPILE_PUG_TEMPLATES_AT_BOOT_TIME === 'true' : process.env.NODE_ENV === 'production', - // Should javascript assets be served minified or not. Note that you will - // need to run `grunt compile:minify` within the web-sharelatex directory - // to generate these. + // Should javascript assets be served minified or not. useMinifiedJs: process.env.MINIFIED_JS === 'true' || false, // Should static assets be sent with a header to tell the browser to cache diff --git a/services/web/test/acceptance/scripts/full-test.sh b/services/web/test/acceptance/scripts/full-test.sh deleted file mode 100755 index 9351df81e3..0000000000 --- a/services/web/test/acceptance/scripts/full-test.sh +++ /dev/null @@ -1,40 +0,0 @@ -#! /usr/bin/env bash - -# If you're running on OS X, you probably need to rebuild -# some dependencies in the docker container, before it will start. -# -#npm rebuild --update-binary - -echo ">> Starting server..." - -grunt --no-color forever:app:start - -echo ">> Waiting for Server" - -count=1 -max_wait=60 - -while [ $count -le $max_wait ] -do - if nc -z localhost 3000 - then - echo ">> Server Started" - - echo ">> Running acceptance tests..." - grunt --no-color mochaTest:acceptance - _test_exit_code=$? - - echo ">> Killing server" - - grunt --no-color forever:app:stop - - echo ">> Done" - - exit $_test_exit_code - fi - - sleep 1 - echo -n "." - count=$((count+1)) -done -exit 1