rigwild il y a 5 ans
Parent
commit
d58c26664c
3 fichiers modifiés avec 17 ajouts et 17 suppressions
  1. 15 15
      README.md
  2. 1 1
      test/api/databaseWebSocket.js
  3. 1 1
      test/api/listScenesQualities.js

+ 15 - 15
README.md

@@ -2,7 +2,7 @@
 A web app to collect data on noise detection by humans on images.
 A web app to collect data on noise detection by humans on images.
 
 
 ## Download project
 ## Download project
-```console
+```sh
 git clone https://gogs.univ-littoral.fr/Prise3D/Antoine_Internship.git
 git clone https://gogs.univ-littoral.fr/Prise3D/Antoine_Internship.git
 cd Antoine_Internship
 cd Antoine_Internship
 ```
 ```
@@ -37,7 +37,7 @@ Configure more deeply the way the app works by modifying *[config.js](config.js)
 
 
 ### Run server + client
 ### Run server + client
 Linux
 Linux
-```console
+```sh
 PORT=8080 SERVE_CLIENT=true IMAGE_PATH=/var/images docker-compose up
 PORT=8080 SERVE_CLIENT=true IMAGE_PATH=/var/images docker-compose up
 ```
 ```
 Windows
 Windows
@@ -50,7 +50,7 @@ docker-compose up
 
 
 ### Run server only
 ### Run server only
 Linux
 Linux
-```console
+```sh
 SERVE_CLIENT=false docker-compose up
 SERVE_CLIENT=false docker-compose up
 ```
 ```
 Windows
 Windows
@@ -60,14 +60,14 @@ docker-compose up
 ```
 ```
 
 
 ### Run client only
 ### Run client only
-```console
+```sh
 docker-compose -f docker-compose.frontapp_only.yml up
 docker-compose -f docker-compose.frontapp_only.yml up
 ```
 ```
 
 
 ### Notice
 ### Notice
 #### New version Docker build
 #### New version Docker build
 When using a new version of the project, you need to re-build the application with Docker.
 When using a new version of the project, you need to re-build the application with Docker.
-```console
+```sh
 # Server / Server + client versions
 # Server / Server + client versions
 docker-compose build
 docker-compose build
 
 
@@ -94,7 +94,7 @@ yarn install
 If this is a production build, set the `NODE_ENV` environment variable to `production` to enhance performance.
 If this is a production build, set the `NODE_ENV` environment variable to `production` to enhance performance.
 
 
 Linux
 Linux
-```console
+```sh
 export NODE_ENV=production
 export NODE_ENV=production
 ```
 ```
 Windows
 Windows
@@ -104,17 +104,17 @@ SET NODE_ENV=production
 
 
 ### API
 ### API
 #### Run the server
 #### Run the server
-```console
+```sh
 yarn run server:start
 yarn run server:start
 ```
 ```
 
 
 #### Run the server with hot-reload for development
 #### Run the server with hot-reload for development
-```console
+```sh
 yarn run server:dev
 yarn run server:dev
 ```
 ```
 
 
 #### Automatically fix the API code syntax with ESLint
 #### Automatically fix the API code syntax with ESLint
-```console
+```sh
 yarn run server:lint
 yarn run server:lint
 ```
 ```
 
 
@@ -122,24 +122,24 @@ yarn run server:lint
 ### Client
 ### Client
 #### Compile and minify for production
 #### Compile and minify for production
 Files will be built to the `dist/` directory.
 Files will be built to the `dist/` directory.
-```console
+```sh
 yarn run app:build
 yarn run app:build
 ```
 ```
 
 
 #### Run a hot-reload server for client development
 #### Run a hot-reload server for client development
-```console
+```sh
 yarn run app:dev
 yarn run app:dev
 ```
 ```
 
 
 
 
 #### Automatically fix the client code syntax with ESLint
 #### Automatically fix the client code syntax with ESLint
-```console
+```sh
 yarn run app:lint
 yarn run app:lint
 ```
 ```
 
 
 ## Automated deployment
 ## Automated deployment
 The app can be automatically deployed when a push event is sent to the master branch using Gogs. Open a port to the web and start *[webhook_deploy_gogs.js](webhook_deploy_gogs.js)*.
 The app can be automatically deployed when a push event is sent to the master branch using Gogs. Open a port to the web and start *[webhook_deploy_gogs.js](webhook_deploy_gogs.js)*.
-```console
+```sh
 WEBHOOK_SECRET=your_webhook_secret WEBHOOK_PORT=5000 SERVE_CLIENT=true PORT=8080 node webhook_deploy_gogs.js
 WEBHOOK_SECRET=your_webhook_secret WEBHOOK_PORT=5000 SERVE_CLIENT=true PORT=8080 node webhook_deploy_gogs.js
 ```
 ```
 You can pass any parameters to the script, they will be passed to the Docker instance. The following are required.
 You can pass any parameters to the script, they will be passed to the Docker instance. The following are required.
@@ -151,13 +151,13 @@ You can pass any parameters to the script, they will be passed to the Docker ins
 
 
 ## Running tests
 ## Running tests
 The `docker-compose` script will automatically run tests. Use the following command to run them by hand.
 The `docker-compose` script will automatically run tests. Use the following command to run them by hand.
-```console
+```sh
 yarn test
 yarn test
 ```
 ```
 
 
 ## Documentation
 ## Documentation
 The `docker-compose` script will automatically build the documentation. Use the following command to build it by hand.
 The `docker-compose` script will automatically build the documentation. Use the following command to build it by hand.
-```console
+```sh
 yarn doc
 yarn doc
 ```
 ```
 The documentation is generated to the `doc/` directory. If you started the server, the documentation is served at `/doc/`.
 The documentation is generated to the `doc/` directory. If you started the server, the documentation is served at `/doc/`.

+ 1 - 1
test/api/databaseWebSocket.js

@@ -101,6 +101,6 @@ test('Check WebSocket server is working', async t => {
 
 
   // Delete every collected data during test
   // Delete every collected data during test
   const db = DataController.Model
   const db = DataController.Model
-  const found = await db.remove({ 'data.AUTOMATED_TEST_WS': true })
+  const found = await db.deleteMany({ 'data.AUTOMATED_TEST_WS': true })
   t.true(found.deletedCount >= 2)
   t.true(found.deletedCount >= 2)
 })
 })

+ 1 - 1
test/api/listScenesQualities.js

@@ -23,7 +23,7 @@ test('GET /listSceneQualities?sceneName=invalid/../scene', async t => {
   const res = await request(t.context.server)
   const res = await request(t.context.server)
     .get(`${apiPrefix}/listSceneQualities?sceneName=invalid/../scene`)
     .get(`${apiPrefix}/listSceneQualities?sceneName=invalid/../scene`)
 
 
-  t.is(res.status, 409, json(res))
+  t.is(res.status, 400, json(res))
   t.truthy(res.body.message.match(/The requested scene name.*is not valid/), json(res.body))
   t.truthy(res.body.message.match(/The requested scene name.*is not valid/), json(res.body))
 })
 })