Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/bookkeeping.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
logs,
envs,
runs,
runs-per-period-or-pass,
tags,
flps,
home,
Expand Down
1 change: 1 addition & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ services:
NODE_ENV: development
DATABASE_LOGGING: "${DATABASE_LOGGING-True}"
JWT_SECRET: BOOKKEEPING-DEV
PAGE_ITEMS_LIMIT: 100
GRPC_INTERNAL_ORIGIN: '[::]:4001'
GRPC_AUTHENTICATED_ORIGIN: '[::]:4002'
ports:
Expand Down
2 changes: 2 additions & 0 deletions test/public/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const SimulationPassesSuite = require('./simulationPasses');
const QcFlagTypesSuite = require('./qcFlagTypes');
const QcFlagsSuite = require('./qcFlags');
const FilterSuite = require('./Filters');
const RunsPerPeriodOrPass = require('./runsPerPeriodOrPass');

module.exports = () => {
describe('Components', ComponentsSuite);
Expand All @@ -37,6 +38,7 @@ module.exports = () => {
describe('Logs', LogsSuite);
describe('Envs', EnvsSuite);
describe('Runs', RunsSuite);
describe('RunsPerDataPassesAndPeriods', RunsPerPeriodOrPass);
describe('Tags', TagsSuite);
describe('Flps', FlpsSuite);
describe('Home', HomeSuite);
Expand Down
2 changes: 1 addition & 1 deletion test/public/qcFlags/detailsForDataPass.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const {
waitForTableLength,
} = require('../defaults.js');
const { resetDatabaseContent } = require('../../utilities/resetDatabaseContent.js');
const { navigateToRunsPerDataPass } = require('../runs/navigationUtils.js');
const { navigateToRunsPerDataPass } = require('../runsPerPeriodOrPass/dataPassesUtilities.js');

const { expect } = chai;

Expand Down
2 changes: 1 addition & 1 deletion test/public/qcFlags/forDataPassCreation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const {
getTableContent,
} = require('../defaults.js');
const { resetDatabaseContent } = require('../../utilities/resetDatabaseContent.js');
const { navigateToRunsPerDataPass } = require('../runs/navigationUtils.js');
const { navigateToRunsPerDataPass } = require('../runsPerPeriodOrPass/dataPassesUtilities.js');

const { expect } = chai;

Expand Down
21 changes: 0 additions & 21 deletions test/public/runs/dataPassesUtilities.js

This file was deleted.

6 changes: 0 additions & 6 deletions test/public/runs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,8 @@

const OverviewSuite = require('./overview.test');
const DetailSuite = require('./detail.test');
const RunsPerPeriodOverviewSuite = require('./runsPerLhcPeriod.overview.test');
const RunsPerDataPassOverviewPage = require('./runsPerDataPass.overview.test');
const RunsPerSimulationPassOverviewPage = require('./runsPerSimulationPass.overview.test');

module.exports = () => {
describe('Overview Page', OverviewSuite);
describe('Detail Page', DetailSuite);
describe('Runs Per LHC Period Overview Page', RunsPerPeriodOverviewSuite);
describe('Runs Per Data Pass Overview Page', RunsPerDataPassOverviewPage);
describe('Runs Per Simulation Pass Overview Page', RunsPerSimulationPassOverviewPage);
};
55 changes: 0 additions & 55 deletions test/public/runs/navigationUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,58 +22,3 @@ const { waitForNavigation, pressElement, expectUrlParams, waitForTableLength } =
exports.navigateToRunsOverview = async (page) => {
await waitForNavigation(page, () => pressElement(page, 'a#run-overview', true));
};


/**
* Navigate to Runs per LHC period
*
* @param {Puppeteer.Page} page page
* @param {number} lhcPeriodId id of lhc period on LHC Period overview page
* @param {number} expectedRowsCount expected number of rows on runs per data pass page
* @return {Promise<void>} promise
*/
exports.navigateToRunsPerLhcPeriod = async (page, lhcPeriodId, expectedRowsCount) => {
await waitForNavigation(page, () => pressElement(page, 'a#lhc-period-overview', true));
await waitForNavigation(page, () => pressElement(page, `#row${lhcPeriodId}-associatedRuns a`, true));
expectUrlParams(page, { page: 'runs-per-lhc-period', lhcPeriodId }, ['pdpBeamType']);
await waitForTableLength(page, expectedRowsCount);
};

/**
* Navigate to Runs per Data Pass page
*
* @param {Puppeteer.Page} page page
* @param {number} lhcPeriodId id of lhc period on LHC Period overview page
* @param {number} dataPassId id of data pass on Data Passes per LHC Period page
* @param {number} expectedRowsCount expected number of rows on runs per data pass page
* @return {Promise<void>} promise
*/
exports.navigateToRunsPerDataPass = async (page, lhcPeriodId, dataPassId, expectedRowsCount) => {
await waitForNavigation(page, () => pressElement(page, 'a#lhc-period-overview', true));
await waitForNavigation(page, () => pressElement(page, `#row${lhcPeriodId}-associatedDataPasses a`, true));
expectUrlParams(page, { page: 'data-passes-per-lhc-period-overview', lhcPeriodId });
await page.waitForSelector('th#description');
await waitForNavigation(page, () => pressElement(page, `#row${dataPassId}-associatedRuns a`, true));
expectUrlParams(page, { page: 'runs-per-data-pass', dataPassId }, ['pdpBeamType']);
await waitForTableLength(page, expectedRowsCount);
};


/**
* Navigate to Runs per Simulation Pass page
*
* @param {Puppeteer.Page} page page
* @param {number} lhcPeriodId id of lhc period on LHC Period overview page
* @param {number} simulationPassId id of data pass on Data Passes per LHC Period page
* @param {number} expectedRowsCount expected number of rows on runs per data pass page
* @return {Promise<void>} promise
*/
exports.navigateToRunsPerSimulationPass = async (page, lhcPeriodId, simulationPassId, expectedRowsCount) => {
await waitForNavigation(page, () => pressElement(page, 'a#lhc-period-overview', true));
await waitForNavigation(page, () => pressElement(page, `#row${lhcPeriodId}-associatedSimulationPasses a`, true));
expectUrlParams(page, { page: 'simulation-passes-per-lhc-period-overview', lhcPeriodId });
await page.waitForSelector('th#description');
await waitForNavigation(page, () => pressElement(page, `#row${simulationPassId}-associatedRuns a`, true));
expectUrlParams(page, { page: 'runs-per-simulation-pass', simulationPassId });
await waitForTableLength(page, expectedRowsCount);
};
55 changes: 55 additions & 0 deletions test/public/runsPerPeriodOrPass/dataPassesUtilities.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
const { waitForNavigation, pressElement, getInnerText, expectUrlParams, waitForTableLength } = require('../defaults.js');

/**
* Navigate to Runs per LHC period
*
* @param {Puppeteer.Page} page page
* @param {number} lhcPeriodId id of lhc period on LHC Period overview page
* @param {number} expectedRowsCount expected number of rows on runs per data pass page
* @return {Promise<void>} promise
*/
exports.navigateToRunsPerLhcPeriod = async (page, lhcPeriodId, expectedRowsCount) => {
await waitForNavigation(page, () => pressElement(page, 'a#lhc-period-overview', true));
await waitForNavigation(page, () => pressElement(page, `#row${lhcPeriodId}-associatedRuns a`, true));
expectUrlParams(page, { page: 'runs-per-lhc-period', lhcPeriodId }, ['pdpBeamType']);
await waitForTableLength(page, expectedRowsCount);
};

/**
* Navigate to Runs per Data Pass page
*
* @param {Puppeteer.Page} page page
* @param {number} lhcPeriodId id of lhc period on LHC Period overview page
* @param {number} dataPassId id of data pass on Data Passes per LHC Period page
* @param {number} expectedRowsCount expected number of rows on runs per data pass page
* @return {Promise<void>} promise
*/
exports.navigateToRunsPerDataPass = async (page, lhcPeriodId, dataPassId, expectedRowsCount) => {
await waitForNavigation(page, () => pressElement(page, 'a#lhc-period-overview', true));
await waitForNavigation(page, () => pressElement(page, `#row${lhcPeriodId}-associatedDataPasses a`, true));
expectUrlParams(page, { page: 'data-passes-per-lhc-period-overview', lhcPeriodId });
await page.waitForSelector('th#description');
await waitForNavigation(page, () => pressElement(page, `#row${dataPassId}-associatedRuns a`, true));
expectUrlParams(page, { page: 'runs-per-data-pass', dataPassId }, ['pdpBeamType']);
await waitForTableLength(page, expectedRowsCount);
};


/**
* Navigate to Runs per Simulation Pass page
*
* @param {Puppeteer.Page} page page
* @param {number} lhcPeriodId id of lhc period on LHC Period overview page
* @param {number} simulationPassId id of data pass on Data Passes per LHC Period page
* @param {number} expectedRowsCount expected number of rows on runs per data pass page
* @return {Promise<void>} promise
*/
exports.navigateToRunsPerSimulationPass = async (page, lhcPeriodId, simulationPassId, expectedRowsCount) => {
await waitForNavigation(page, () => pressElement(page, 'a#lhc-period-overview', true));
await waitForNavigation(page, () => pressElement(page, `#row${lhcPeriodId}-associatedSimulationPasses a`, true));
expectUrlParams(page, { page: 'simulation-passes-per-lhc-period-overview', lhcPeriodId });
await page.waitForSelector('th#description');
await waitForNavigation(page, () => pressElement(page, `#row${simulationPassId}-associatedRuns a`, true));
expectUrlParams(page, { page: 'runs-per-simulation-pass', simulationPassId });
await waitForTableLength(page, expectedRowsCount);
};
22 changes: 22 additions & 0 deletions test/public/runsPerPeriodOrPass/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* @license
* Copyright CERN and copyright holders of ALICE O2. This software is
* distributed under the terms of the GNU General Public License v3 (GPL
* Version 3), copied verbatim in the file "COPYING".
*
* See http://alice-o2.web.cern.ch/license for full licensing information.
*
* In applying this license CERN does not waive the privileges and immunities
* granted to it by virtue of its status as an Intergovernmental Organization
* or submit itself to any jurisdiction.
*/

const RunsPerPeriodOverviewSuite = require('./runsPerLhcPeriod.overview.test');
const RunsPerDataPassOverviewPage = require('./runsPerDataPass.overview.test');
const RunsPerSimulationPassOverviewPage = require('./runsPerSimulationPass.overview.test');

module.exports = () => {
describe('Runs Per LHC Period Overview Page', RunsPerPeriodOverviewSuite);
describe('Runs Per Data Pass Overview Page', RunsPerDataPassOverviewPage);
describe('Runs Per Simulation Pass Overview Page', RunsPerSimulationPassOverviewPage);
};
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const {
const { resetDatabaseContent } = require('../../utilities/resetDatabaseContent.js');
const DataPassRepository = require('../../../lib/database/repositories/DataPassRepository.js');
const { BkpRoles } = require('../../../lib/domain/enums/BkpRoles.js');
const { navigateToRunsPerDataPass } = require('./navigationUtils.js');
const { navigateToRunsPerDataPass } = require('./dataPassesUtilities.js');

const { expect } = chai;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const {
const { RUN_QUALITIES, RunQualities } = require('../../../lib/domain/enums/RunQualities.js');
const { resetDatabaseContent } = require('../../utilities/resetDatabaseContent.js');
const { RunDefinition } = require('../../../lib/domain/enums/RunDefinition.js');
const { navigateToRunsPerLhcPeriod } = require('./navigationUtils.js');
const { navigateToRunsPerLhcPeriod } = require('./dataPassesUtilities.js');

const { expect } = chai;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ const {
} = require('../defaults.js');

const { expect } = chai;
const { qcFlagService } = require('../../../lib/server/services/qualityControlFlag/QcFlagService');
const { qcFlagService } = require('../../../lib/server/services/qualityControlFlag/QcFlagService.js');
const { resetDatabaseContent } = require('../../utilities/resetDatabaseContent.js');
const { navigateToRunsPerSimulationPass } = require('./navigationUtils.js');
const { navigateToRunsPerSimulationPass } = require('./dataPassesUtilities.js');

const DETECTORS = [
'CPV',
Expand Down
1 change: 1 addition & 0 deletions test/scripts/parallel-local/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const testSuites = [
'logs',
'envs',
'runs',
'runs-per-period-or-pass',
'tags',
'flps',
'home',
Expand Down
34 changes: 34 additions & 0 deletions test/scripts/test-runs-per-period-or-pass.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* @license
* Copyright CERN and copyright holders of ALICE O2. This software is
* distributed under the terms of the GNU General Public License v3 (GPL
* Version 3), copied verbatim in the file "COPYING".
*
* See http://alice-o2.web.cern.ch/license for full licensing information.
*
* In applying this license CERN does not waive the privileges and immunities
* granted to it by virtue of its status as an Intergovernmental Organization
* or submit itself to any jurisdiction.
*/

const application = require('../../lib/application');
const RunsPerPeriodOverviewSuite = require('../public/runsPerPeriodOrPass/runsPerLhcPeriod.overview.test');
const RunsPerDataPassOverviewPage = require('../public/runsPerPeriodOrPass/runsPerDataPass.overview.test');
const RunsPerSimulationPassOverviewPage = require('../public/runsPerPeriodOrPass/runsPerSimulationPass.overview.test');

describe('Bookkeeping', () => {
before(async () => {
await application.run();
await application.connectDatabase();
});

after(async () => {
await application.stop(true);
});

describe('Runs', () => {
describe('Runs Per LHC Period Overview Page', RunsPerPeriodOverviewSuite);
describe('Runs Per Data Pass Overview Page', RunsPerDataPassOverviewPage);
describe('Runs Per Simulation Pass Overview Page', RunsPerSimulationPassOverviewPage);
});
});
6 changes: 0 additions & 6 deletions test/scripts/test-runs.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
const application = require('../../lib/application');
const OverviewSuite = require('../public/runs/overview.test');
const DetailSuite = require('../public/runs/detail.test');
const RunsPerPeriodOverviewSuite = require('../public/runs/runsPerLhcPeriod.overview.test');
const RunsPerDataPassOverviewPage = require('../public/runs/runsPerDataPass.overview.test');
const RunsPerSimulationPassOverviewPage = require('../public/runs/runsPerSimulationPass.overview.test');

describe('Bookkeeping', () => {
before(async () => {
Expand All @@ -31,8 +28,5 @@ describe('Bookkeeping', () => {
describe('Runs', () => {
describe('Overview Page', OverviewSuite);
describe('Detail Page', DetailSuite);
describe('Runs Per LHC Period Overview Page', RunsPerPeriodOverviewSuite);
describe('Runs Per Data Pass Overview Page', RunsPerDataPassOverviewPage);
describe('Runs Per Simulation Pass Overview Page', RunsPerSimulationPassOverviewPage);
});
});
Loading