Commit 9aa26e8d authored by BERET Benjamin DGAC/CRNA-E's avatar BERET Benjamin DGAC/CRNA-E
Browse files

Resolve "Mise à jour nodejs v16"

parent 2ec1e9f8
image: node:12.18.3
image: node:16.10.0
stages:
- init
......
16.10.0
......@@ -2,6 +2,7 @@
## Master
- Node v16.10.0 (#734)
- Improve LFMM & LFEE datasets (#751)
- Implement new dataset validation rules
- Environment-server will now expose elementary sectors forming a collapsed sector
......
......@@ -10,12 +10,12 @@ docker run --rm \
-v ${REPO_DIR}:/home/4me \
-u ${LOCAL_UID}:${LOCAL_GID} \
-w /home/4me \
node:12.18.3 \
node:16.10.0 \
yarn
docker run --rm \
-v ${REPO_DIR}:/home/4me \
-w /home/4me \
-u ${LOCAL_UID}:${LOCAL_GID} \
node:12.18.3 \
node:16.10.0 \
yarn bootstrap
......@@ -10,5 +10,5 @@ docker run --rm \
-v ${REPO_DIR}:/home/4me/ \
-w /home/4me/packages/env \
-u ${LOCAL_UID}:${LOCAL_GID} \
node:12.18.3 \
node:16.10.0 \
yarn prepare
......@@ -10,7 +10,7 @@ docker run --rm \
-v ${REPO_DIR}:/home/4me \
-v /tmp:/tmp \
-w /home/4me \
node:12.18.3 \
node:16.10.0 \
/bin/bash -c 'rm -rf node_modules && \
echo "Removed <4ME>/node_modules" && \
rm -rf packages/*/node_modules && \
......
......@@ -6,7 +6,7 @@ volumes:
services:
auth-server:
image: 'node:12.18.3'
image: 'node:16.10.0'
user: ${UID-Please define a UID environment variable in .env}:${GID-Please define a GID environment variable in .env}
volumes:
- ../:/home/4me
......@@ -16,12 +16,13 @@ services:
- 3800:3000
working_dir: /home/4me/packages/auth-server
environment:
- LOG_REQUEST=false
- PORT=3000
- CONFIG=../../dev/auth-config.yml
command: yarn --silent dev
flight-positions:
image: 'node:12.18.3'
image: 'node:16.10.0'
user: ${UID-Please define a UID environment variable in .env}:${GID-Please define a GID environment variable in .env}
volumes:
- ../:/home/4me
......@@ -31,6 +32,7 @@ services:
- '3000'
working_dir: /home/4me/packages/adsbweb-flight.positions
environment:
- LOG_REQUEST=false
- PORT=3000
- PROVIDER=${FME_FLIGHT_POSITION_PROVIDER:-opensky}
- OPENSKY_USERNAME=${FME_OPENSKY_USERNAME:-}
......@@ -38,7 +40,7 @@ services:
command: yarn --silent dev
environment-server:
image: 'node:12.18.3'
image: 'node:16.10.0'
user: ${UID-Please define a UID environment variable in .env}:${GID-Please define a GID environment variable in .env}
volumes:
- ../:/home/4me
......@@ -59,7 +61,7 @@ services:
command: yarn --silent dev
xman-faker:
image: 'node:12.18.3'
image: 'node:16.10.0'
user: ${UID}:${GID}
volumes:
- ../:/home/4me
......@@ -77,7 +79,7 @@ services:
command: yarn --silent dev
xman:
image: 'node:12.18.3'
image: 'node:16.10.0'
user: ${UID}:${GID}
volumes:
- ../:/home/4me
......@@ -103,7 +105,7 @@ services:
command: yarn --silent dev
b2b-gateway:
image: 'node:12.18.3'
image: 'node:16.10.0'
user: ${UID}:${GID}
volumes:
- ../:/home/4me
......@@ -126,7 +128,7 @@ services:
command: yarn --silent dev
tile-server:
image: 'node:12.18.3'
image: 'node:16.10.0'
user: ${UID}:${GID}
volumes:
- ../:/home/4me
......@@ -135,12 +137,13 @@ services:
ports:
- '3400:3000'
environment:
- LOG_REQUEST=false
- PORT=3000
working_dir: /home/4me/packages/tile-server
command: yarn --silent dev
weather:
image: 'node:12.18.3'
image: 'node:16.10.0'
user: ${UID}:${GID}
volumes:
- ../:/home/4me
......@@ -151,13 +154,14 @@ services:
environment:
- PORT=3000
- LOG_REQUEST=false
- LOG_LEVEL=debug
- METSAFE_API_URL=https://apiv3.metsafecloud.com
- METSAFE_API_TOKEN=${FME_METSAFE_API_TOKEN}
working_dir: /home/4me/packages/weather
command: yarn --silent dev
dataset-explorer:
image: 'node:12.18.3'
image: 'node:16.10.0'
user: ${UID}:${GID}
volumes:
- ../:/home/4me
......@@ -171,7 +175,7 @@ services:
command: yarn --silent dev
frontend:
image: 'node:12.18.3'
image: 'node:16.10.0'
user: ${UID}:${GID}
volumes:
- ../:/home/4me
......@@ -184,7 +188,7 @@ services:
command: yarn --silent dev
graphql:
image: 'node:12.18.3'
image: 'node:16.10.0'
user: ${UID}:${GID}
volumes:
- ../:/home/4me
......
#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source $SCRIPT_DIR/.env
REPO_DIR="$( cd $SCRIPT_DIR/../ && pwd )"
LOCAL_UID="$(id -u)"
LOCAL_GID="$(id -g)"
docker run -it --rm \
-v ${REPO_DIR}:/home/4me \
-w /home/4me/packages/env \
-u ${LOCAL_UID}:${LOCAL_GID} \
node:12.18.3 \
yarn typecheck
docker run -it --rm \
-v ${REPO_DIR}:/home/4me \
-w /home/4me/packages/env \
-u ${LOCAL_UID}:${LOCAL_GID} \
node:12.18.3 \
yarn test
FROM node:12.18.3
FROM node:16.10.0
RUN mkdir /usr/src/app
RUN mkdir /usr/src/app/pk
......
......@@ -2,7 +2,7 @@ import Unix, { UnixSocket } from 'unix-dgram';
import { Readable } from 'stream';
import fs from 'fs';
import { logger } from '../logger';
const log = logger.child({ ns: 'unix-socket' });
const log = logger.child({ name: 'unix-socket' });
export class UnixSocketStream extends Readable {
congested: boolean;
......@@ -15,7 +15,7 @@ export class UnixSocketStream extends Readable {
this.congested = false;
this.path = path;
this.socket = Unix.createSocket('unix_dgram', buf => {
this.socket = Unix.createSocket('unix_dgram', (buf) => {
if (this.congested) {
return;
}
......
......@@ -24,7 +24,7 @@ router.get('/status', status);
router.get('/metrics', async (ctx) => {
const flights = await flightList.keys();
flightCount.set(flights.length);
ctx.body = promClient.register.metrics();
ctx.body = await promClient.register.metrics();
});
type DateMapper<T> = T extends Date
......
......@@ -31,7 +31,7 @@
"koa-pino-logger": "^2.1.3",
"pino": "^5.12.3",
"pino-pretty": "^3.0.0",
"prom-client": "^12.0.0",
"prom-client": "^14.0.0",
"ramda": "^0.27.0"
},
"peerDependencies": {
......
......@@ -34,5 +34,5 @@ export async function capture(ctx: Context, next: any) {
}
export async function metrics(ctx: Context) {
ctx.body = promClient.register.metrics();
ctx.body = await promClient.register.metrics();
}
......@@ -19,7 +19,7 @@
"dependencies": {
"@4me/backend-tools": "^2.6.0",
"@koa/cors": "^2.2.3",
"@mapbox/mbtiles": "^0.10.0",
"@mapbox/mbtiles": "^0.12.1",
"debug": "^4.1.1",
"dotenv": "^6.1.0",
"koa": "^2.6.2",
......
import MBTiles from '@mapbox/mbtiles';
import { logger } from './logger';
const log = logger.child({ ns: 'Tiler' });
const log = logger.child({ name: 'Tiler' });
export const tilers: { [key: string]: Tiler } = {};
......
......@@ -2,7 +2,7 @@ import 'dotenv/config';
import { logger } from './logger';
import app from './index';
const log = logger.child({ ns: `start-up` });
const log = logger.child({ name: 'start-up' });
const port = parseInt(process.env.PORT || '3000', 10);
......
......@@ -4,5 +4,6 @@ const config = require('../babel-config');
module.exports = Object.assign({}, config.jest, {
displayName: pack.name,
name: pack.name,
testEnvironment: './src/test-setup/environment.js',
testEnvironment: '<rootDir>/src/tests/PostgresTestEnvironment',
collectCoverageFrom: ['<rootDir>/src/**/*.ts'],
});
......@@ -72,13 +72,22 @@ module.exports = {
},
test: {
client: 'sqlite3',
client: 'pg',
connection: {
filename: ':memory:',
host: process.env.PGHOST || 'localhost',
database: `${process.env.PGDATABASE || 'fme_test_xman'}_${
process.env.JEST_WORKER_ID
}`,
user: process.env.PGUSER || 'fme',
password: process.env.PGPASSWORD || 'fmefmefme',
port: process.env.PGPORT || 5432,
},
pool: {
min: 0,
max: 5,
},
useNullAsDefault: true,
migrations: {
tableName: 'xman_knex_migrations',
tableName: 'knex_migrations',
directory: path.join(__dirname, 'migrations'),
},
seeds: {
......
......@@ -28,7 +28,7 @@
"glob": "^7.1.4",
"got": "^10.7.0",
"keyv": "^3.1.0",
"knex": "^0.19.3",
"knex": "^0.21.15",
"knex-migrate": "^1.7.2",
"koa": "^2.6.2",
"koa-bodyparser": "^4.2.0",
......@@ -36,7 +36,7 @@
"minimatch": "^3.0.4",
"moment": "^2.24.0",
"moment-timezone": "^0.5.26",
"pg": "^7.12.1",
"pg": "^8.6.0",
"uuid": "^7.0.3",
"xml2js": "^0.4.21"
},
......@@ -51,7 +51,6 @@
"@types/supertest": "2.0.7",
"@types/uuid": "^7.0.2",
"@types/xml2js": "^0.4.4",
"sqlite3": "^4.1.0",
"supertest": "^3.0.0"
}
}
const knex = require('knex');
const knexConfig = require('../../knexfile');
const NodeEnvironment = require('jest-environment-node');
class DbEnvironment extends NodeEnvironment {
constructor(config, context) {
super(config, context);
this.dbAdapter = knex(knexConfig.test);
}
async setup() {
await super.setup();
await this.dbAdapter.migrate.latest();
this.global.__DB_ADAPTER__ = this.dbAdapter;
}
async teardown() {
await this.dbAdapter.destroy();
await super.teardown();
}
}
module.exports = DbEnvironment;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment