Skip to content

Commit

Permalink
feat: group override files
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-yarmosh committed Apr 12, 2024
1 parent 173acb9 commit ef53429
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions src/lib/admin-data.ts → src/lib/override/admin-data.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* eslint-disable camelcase */
import ipaddr from 'ipaddr.js';
import type { Knex } from 'knex';
import type { Probe, ProbeLocation } from '../probe/types.js';
import { normalizeFromPublicName } from './geoip/utils.js';
import { getContinentByCountry, getRegionByCountry } from './location/location.js';
import { scopedLogger } from './logger.js';
import type { Probe, ProbeLocation } from '../../probe/types.js';
import { normalizeFromPublicName } from '../geoip/utils.js';
import { getContinentByCountry, getRegionByCountry } from '../location/location.js';
import { scopedLogger } from '../logger.js';

const logger = scopedLogger('admin-data');

Expand Down
10 changes: 5 additions & 5 deletions src/lib/adopted-probes.ts → src/lib/override/adopted-probes.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { Knex } from 'knex';
import Bluebird from 'bluebird';
import _ from 'lodash';
import { scopedLogger } from './logger.js';
import type { fetchProbesWithAdminData as serverFetchProbesWithAdminData } from './ws/server.js';
import type { Probe, ProbeLocation } from '../probe/types.js';
import { normalizeFromPublicName } from './geoip/utils.js';
import { getIndex } from './location/location.js';
import { scopedLogger } from '../logger.js';
import type { fetchProbesWithAdminData as serverFetchProbesWithAdminData } from '../ws/server.js';
import type { Probe, ProbeLocation } from '../../probe/types.js';
import { normalizeFromPublicName } from '../geoip/utils.js';
import { getIndex } from '../location/location.js';

const logger = scopedLogger('adopted-probes');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Probe } from '../probe/types.js';
import type { Probe } from '../../probe/types.js';
import type { AdoptedProbes } from './adopted-probes.js';
import type { AdminData } from './admin-data.js';

Expand Down
6 changes: 3 additions & 3 deletions src/lib/ws/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import type { Probe } from '../../probe/types.js';
import { getRedisClient } from '../redis/client.js';
import { SyncedProbeList } from './synced-probe-list.js';
import { client } from '../sql/client.js';
import { ProbeOverride } from '../probe-override.js';
import { ProbeOverride } from '../override/probe-override.js';
import { ProbeIpLimit } from './helper/probe-ip-limit.js';
import { AdoptedProbes } from '../adopted-probes.js';
import { AdminData } from '../admin-data.js';
import { AdoptedProbes } from '../override/adopted-probes.js';
import { AdminData } from '../override/admin-data.js';

export type SocketData = {
probe: Probe;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/ws/synced-probe-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { scopedLogger } from '../logger.js';
import type { WsServerNamespace } from './server.js';
import type { Probe, ProbeStats } from '../../probe/types.js';
import type winston from 'winston';
import type { ProbeOverride } from '../probe-override.js';
import type { ProbeOverride } from '../override/probe-override.js';
import type { RedisClient } from '../redis/shared.js';

type NodeData = {
Expand Down
4 changes: 2 additions & 2 deletions test/tests/integration/measurement/create-measurement.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import nock from 'nock';
import type { Socket } from 'socket.io-client';
import nockGeoIpProviders from '../../../utils/nock-geo-ip.js';
import { client } from '../../../../src/lib/sql/client.js';
import type { ProbeOverride } from '../../../../src/lib/probe-override.js';
import type { ProbeOverride } from '../../../../src/lib/override/probe-override.js';
import { waitForProbesUpdate } from '../../../utils/server.js';

describe('Create measurement', () => {
Expand All @@ -19,7 +19,7 @@ describe('Create measurement', () => {
before(async () => {
await td.replaceEsm('../../../../src/lib/ip-ranges.ts', { getRegion: () => 'gcp-us-west4', populateMemList: () => Promise.resolve() });
({ getTestServer, addFakeProbe, deleteFakeProbes } = await import('../../../utils/server.js'));
({ ADOPTED_PROBES_TABLE } = await import('../../../../src/lib/adopted-probes.js'));
({ ADOPTED_PROBES_TABLE } = await import('../../../../src/lib/override/adopted-probes.js'));
({ probeOverride } = await import('../../../../src/lib/ws/server.js'));
const app = await getTestServer();
requestAgent = request(app);
Expand Down
2 changes: 1 addition & 1 deletion test/tests/integration/probes/get-probes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { expect } from 'chai';
import request, { type Agent } from 'supertest';
import { getTestServer, addFakeProbe, deleteFakeProbes, waitForProbesUpdate } from '../../../utils/server.js';
import nockGeoIpProviders from '../../../utils/nock-geo-ip.js';
import { ADOPTED_PROBES_TABLE } from '../../../../src/lib/adopted-probes.js';
import { ADOPTED_PROBES_TABLE } from '../../../../src/lib/override/adopted-probes.js';
import { probeOverride } from '../../../../src/lib/ws/server.js';
import { client } from '../../../../src/lib/sql/client.js';

Expand Down
2 changes: 1 addition & 1 deletion test/tests/unit/adopted-probes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect } from 'chai';
import type { Knex } from 'knex';
import * as sinon from 'sinon';
import relativeDayUtc from 'relative-day-utc';
import { AdoptedProbes } from '../../../src/lib/adopted-probes.js';
import { AdoptedProbes } from '../../../src/lib/override/adopted-probes.js';
import type { Probe } from '../../../src/probe/types.js';

describe('AdoptedProbes', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/tests/unit/ws/synced-probe-list.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { SyncedProbeList } from '../../../../src/lib/ws/synced-probe-list.js';
import type { Probe } from '../../../../src/probe/types.js';
import { getRegionByCountry } from '../../../../src/lib/location/location.js';
import { getRedisClient } from '../../../../src/lib/redis/client.js';
import { ProbeOverride } from '../../../../src/lib/probe-override.js';
import { ProbeOverride } from '../../../../src/lib/override/probe-override.js';

describe('SyncedProbeList', () => {
const sandbox = sinon.createSandbox();
Expand Down
2 changes: 1 addition & 1 deletion wallaby.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function wallaby () {

setup (w) {
const path = require('path');
w.testFramework.addFile(path.resolve(process.cwd(), 'test/setup.js'));
w.testFramework.files.unshift(path.resolve(process.cwd(), 'test/setup.js'));
},

env: {
Expand Down

0 comments on commit ef53429

Please sign in to comment.