Hello,
It has been 2 days since my Raspberry Pi 4 was set up to create a small server to run Gladys 4. To make my modifications, I go directly through Git, as described in the documentation.
I have cloned the repository into a folder, installed the server and front-end via npm, migrated the database, but despite all this, I get these errors after running the tests:
Server side:
pi@raspberrypi:~/gladys/server $ npm test
> gladys-server@ pretest /home/pi/gladys/server
> cross-env SQLITE_FILE_PATH=/tmp/gladys-test.db npm run db-migrate:test && npm run eslint
> gladys-server@ db-migrate:test /home/pi/gladys/server
> cross-env NODE_ENV=test node_modules/.bin/sequelize db:migrate
Sequelize CLI [Node: 10.16.3, CLI: 5.4.0, ORM: 4.44.3]
Loaded configuration file "config/config.js".
Using environment "test".
== 20190211042644-create-calendar-event: migrating ==========
ERROR: SQLITE_ERROR: index t_calendar_event_calendar_id already exists
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gladys-server@ db-migrate:test: `cross-env NODE_ENV=test node_modules/.bin/sequelize db:migrate`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the gladys-server@ db-migrate:test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2019-10-17T09_25_49_725Z-debug.log
npm ERR! Test failed. See above for more details.
Front side:
pi@raspberrypi:~/gladys/server $ cd ../front/
pi@raspberrypi:~/gladys/front $ npm test
> gladys-front@ test /home/pi/gladys/front
> jest --coverage
FAIL tests/header.test.js
Initial Test of the Header
âś• Header renders Gladys Assistant title and 8 items in header (78ms)
âś“ Should return null, login page doesnt need a header (2ms)
âś• [Backslash URL] Header renders Gladys Assistant title and 8 items in header (17ms)
âś“ [Backslash URL] Should return null, login page doesnt need a header (1ms)
● Initial Test of the Header › Header renders Gladys Assistant title and 8 items in header
expect(received).toBe(expected)
Expected value to be (using ===):
"Gladys Assistant"
Received:
""
at Object.<anonymous> (tests/header.test.js:25:305)
at new Promise (<anonymous>)
● Initial Test of the Header › [Backslash URL] Header renders Gladys Assistant title and 8 items in header
expect(received).toBe(expected)
Expected value to be (using ===):
"Gladys Assistant"
Received:
""
at Object.<anonymous> (tests/header.test.js:25:728)
at new Promise (<anonymous>)
Test Suites: 1 failed, 1 total
Tests: 2 failed, 2 passed, 4 total
Snapshots: 0 total
Time: 1.956s
Ran all test suites.
-------------------|----------|----------|----------|----------|-------------------|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
-------------------|----------|----------|----------|----------|-------------------|
All files | 100 | 66.67 | 100 | 100 | |
components/header | 100 | 57.14 | 100 | 100 | |
index.jsx | 100 | 57.14 | 100 | 100 |35,41,45,73,96,114 |
utils | 100 | 100 | 100 | 100 | |
url.js | 100 | 100 | 100 | 100 | |
-------------------|----------|----------|----------|----------|-------------------|
npm ERR! Test failed. See above for more details.
pi@raspberrypi:~/gladys/front $
However, I do have sqlite3 installed, node and npm are running fine, and I am trying to install directly after cloning the Gladys repository.
On the server side, the problem would come from duplicate indexes in the database.
On the front side, I have an error in the definition of the Header.
Could you provide me with some research leads? I am very eager to start developing the services I need ![]()
Thank you in advance.
