Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add minimal performance test to detect telemetry eviction handover #425

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 18 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
32 changes: 31 additions & 1 deletion .webpack/webpack.common.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,37 @@ const commonConfig = {
export: 'default',
name: 'openmctYamcs'
}
}
},
devServer: {
compress: true,
port: 9000,
static: [
{
directory: path.resolve(projectRootDir, './example'),
},
{
directory: path.resolve(projectRootDir, './node_modules/openmct/dist'),
publicPath: '/node_modules/openmct/dist'
},
],
proxy: [
{
context: ["/yamcs-proxy/"],
target: "http://0.0.0.0:8090/",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have some mercy for those of us who are targeted by enterprise port scanners, please.

secure: false,
changeOrigin: true,
pathRewrite: { "^/yamcs-proxy/": "" },
},
{
context: ["/yamcs-proxy-ws/"],
target: "ws://0.0.0.0:8090/api/websocket",
secure: false,
changeOrigin: true,
ws: true,
pathRewrite: { "^/yamcs-proxy-ws/": "" },
},
],
}
};

export default commonConfig;
Expand Down
52 changes: 9 additions & 43 deletions .webpack/webpack.dev.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,53 +19,19 @@
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
// @ts-check
import path from "path";
import { fileURLToPath } from "url";
import { merge } from "webpack-merge";
import commonConfig from "./webpack.common.mjs";
import { fileURLToPath } from 'node:url';

// Replicate __dirname functionality for ES modules
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const projectRootDir = fileURLToPath(new URL('../', import.meta.url));

/** @type {import('webpack').Configuration} */
const devConfig = {
mode: "development",
context: path.resolve(__dirname, "../"),
devtool: "eval-source-map",
entry: {
"openmct-yamcs-example": path.resolve(__dirname, "../example/index.js"),
},
devServer: {
compress: true,
port: 9000,
static: [
{
directory: path.join(__dirname, "../example"),
},
{
directory: path.join(__dirname, "../node_modules/openmct/dist"),
publicPath: "/node_modules/openmct/dist",
},
],
proxy: [
{
context: ["/yamcs-proxy/"],
target: "http://0.0.0.0:8090/",
secure: false,
changeOrigin: true,
pathRewrite: { "^/yamcs-proxy/": "" },
},
{
context: ["/yamcs-proxy-ws/"],
target: "ws://0.0.0.0:8090/api/websocket",
secure: false,
changeOrigin: true,
ws: true,
pathRewrite: { "^/yamcs-proxy-ws/": "" },
},
],
},
};

context: projectRootDir,
mode: 'development',
devtool: 'eval-source-map',
entry: {
'openmct-yamcs-example': './example/index.js'
},
}
export default merge(commonConfig, devConfig);
36 changes: 36 additions & 0 deletions .webpack/webpack.prod.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*****************************************************************************
* Open MCT, Copyright (c) 2014-2020, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* Open MCT includes source code licensed under additional open source
* licenses. See the Open Source Licenses file (LICENSES.md) included with
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/

import { merge } from 'webpack-merge';
import prod from './webpack.prod.mjs';
import { fileURLToPath } from 'node:url';

const projectRootDir = fileURLToPath(new URL('../', import.meta.url));

/** @type {import('webpack').Configuration} */
const prodTestConfig = {
context: projectRootDir,
entry: {
'openmct-yamcs-example': './example/index.js'
},
}
export default merge(prod, prodTestConfig);
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@
"build:example:master": "npm install nasa/openmct --no-save",
"postbuild:example": "node check-optional-dependencies.mjs",
"start": "npx webpack serve --config ./.webpack/webpack.dev.mjs",
"start:prod": "npx webpack serve --config ./.webpack/webpack.prod.test.mjs",
"start:coverage": "npx webpack serve --config ./.webpack/webpack.coverage.mjs",
"prepare": "npm run build:dist",
"test:getopensource": "sh ./tests/git-opensource-tests.sh",
"posttest:getopensource": "npm install",
"test:e2e:smoke": "npm test --workspace tests/e2e/opensource -- --config=../playwright-quickstart.config.js --project=chromium quickstartSmoke",
"test:e2e:quickstart": "npm test --workspace tests/e2e/opensource -- --config=../playwright-quickstart.config.js --project=chromium tests/e2e/yamcs/",
"test:e2e:quickstart:local": "npm test --workspace tests/e2e/opensource -- --config=../playwright-quickstart.config.js --project=local-chrome tests/e2e/yamcs/",
"test:perf:memory": "npm test --workspace tests/e2e/opensource -- --config=../playwright-performance-prod.config.js --project=chrome-memory",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When is test:perf:memory going to run though? It needs to be regularly triggered automatically to catch regressions.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be run with PRs. Let's also make sure navigation memory leak tests are also re-enabled.

"test:e2e:watch": "npm test --workspace tests/e2e/opensource -- --ui --config=../playwright-quickstart.config.js",
"wait-for-yamcs": "wait-on http-get://localhost:8090/ -v"
},
Expand Down
59 changes: 59 additions & 0 deletions tests/e2e/playwright-performance-prod.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// playwright.config.js
// @ts-check

/** @type {import('@playwright/test').PlaywrightTestConfig} */
const config = {
retries: 0, //Only for debugging purposes for trace: 'on-first-retry'
testDir: '.',
testMatch: /.*\.e2e\.perf\.spec\.(mjs|js)$/,
timeout: 60 * 1000,
workers: 1, //Only run in serial with 1 worker
webServer: {
cwd: '../',
command: 'npm run start:prod', //Production mode
url: 'http://localhost:9000/#',
timeout: 200 * 1000,
reuseExistingServer: false //Must be run with this option to prevent dev mode
},
use: {
baseURL: 'http://localhost:9000/',
headless: true,
ignoreHTTPSErrors: false, //HTTP performance varies!
screenshot: 'off',
trace: 'on-first-retry',
video: 'off'
},
projects: [
{
name: 'chrome-memory',
testMatch: /.*\.memory\.perf\.spec\.(mjs|js)$/, //Only run memory tests
use: {
browserName: 'chromium',
launchOptions: {
args: [
'--no-sandbox',
'--disable-notifications',
'--use-fake-ui-for-media-stream',
'--use-fake-device-for-media-stream',
'--js-flags=--no-move-object-start --expose-gc',
'--enable-precise-memory-info',
'--display=:100'
]
}
}
},
{
name: 'chrome',
testIgnore: /.*\.memory\.perf\.spec\.(mjs|js)$/, //Do not run memory tests without proper flags
use: {
browserName: 'chromium'
}
}
],
reporter: [
['list'],
['junit', { outputFile: 'test-results/results.xml' }]
]
};

export default config;
1 change: 1 addition & 0 deletions tests/e2e/playwright-quickstart.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const config = {
retries: 1,
testDir: '.',
testMatch: /.*\.e2e\.spec\.(mjs|js)$/,
testIgnore: /.*\.perf\.spec\.(mjs|js)$/,
timeout: 30 * 1000,
use: {
headless: false,
Expand Down
1 change: 1 addition & 0 deletions tests/e2e/test-data/telemetry-eviction-test-objects.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"openmct":{"667e8c4a-dd16-49a1-86f3-b9dde34c3df5":{"identifier":{"key":"667e8c4a-dd16-49a1-86f3-b9dde34c3df5","namespace":""},"name":"Telemetry Eviction Test","type":"folder","composition":[{"key":"aea91796-20eb-4205-a4c8-69d44f657af4","namespace":""},{"key":"d6b23129-bb63-4845-a811-de54b5091d56","namespace":""},{"key":"92f80348-b836-4fbe-8923-467174a8543d","namespace":""},{"key":"e5e00281-554e-49bb-9939-16741e60471b","namespace":""},{"key":"3855e50c-144f-4ff0-a7f7-9f8b326cf3db","namespace":""},{"key":"c5d0c31a-2150-4862-bf9d-a9c8f9c75078","namespace":""},{"key":"ed84a47c-c35a-4c61-878a-e143d12e2c70","namespace":""},{"key":"ac6fbefe-b89f-4a6b-90d1-3d726bd0bbdc","namespace":""},{"key":"9ae5b42b-e20a-4df6-b935-0109d29dc328","namespace":""}],"modified":1705568429541,"location":"mine","modifiedBy":"guest","createdBy":"guest","created":1705567367083,"persisted":1705568429542},"aea91796-20eb-4205-a4c8-69d44f657af4":{"identifier":{"key":"aea91796-20eb-4205-a4c8-69d44f657af4","namespace":""},"name":"Complex Display Layout","type":"layout","composition":[{"key":"e5e00281-554e-49bb-9939-16741e60471b","namespace":""},{"key":"92f80348-b836-4fbe-8923-467174a8543d","namespace":""},{"key":"ac6fbefe-b89f-4a6b-90d1-3d726bd0bbdc","namespace":""},{"key":"c5d0c31a-2150-4862-bf9d-a9c8f9c75078","namespace":""},{"key":"3855e50c-144f-4ff0-a7f7-9f8b326cf3db","namespace":""},{"key":"9ae5b42b-e20a-4df6-b935-0109d29dc328","namespace":""},{"key":"ed84a47c-c35a-4c61-878a-e143d12e2c70","namespace":""}],"configuration":{"items":[{"width":35,"height":30,"x":1,"y":1,"identifier":{"key":"e5e00281-554e-49bb-9939-16741e60471b","namespace":""},"hasFrame":true,"fontSize":"default","font":"default","type":"subobject-view","id":"dc513f25-c5d2-47cf-a84a-5fd6c2bda6c3"},{"width":32,"height":30,"x":37,"y":1,"identifier":{"key":"92f80348-b836-4fbe-8923-467174a8543d","namespace":""},"hasFrame":true,"fontSize":"default","font":"default","type":"subobject-view","id":"ba891a6f-3c4e-4158-b261-aa5b121e3f5b"},{"width":32,"height":18,"x":70,"y":1,"identifier":{"key":"ac6fbefe-b89f-4a6b-90d1-3d726bd0bbdc","namespace":""},"hasFrame":true,"fontSize":"default","font":"default","type":"subobject-view","id":"fdac2c9f-1ab6-4996-99a6-d6e6f7e49ac2"},{"width":40,"height":18,"x":1,"y":32,"identifier":{"key":"c5d0c31a-2150-4862-bf9d-a9c8f9c75078","namespace":""},"hasFrame":true,"fontSize":"default","font":"default","type":"subobject-view","id":"3ab3f08d-420d-4caf-ba82-dfbeb3854b55"},{"width":16,"height":11,"x":70,"y":20,"identifier":{"key":"3855e50c-144f-4ff0-a7f7-9f8b326cf3db","namespace":""},"hasFrame":true,"fontSize":"default","font":"default","type":"subobject-view","id":"8bfe8184-88a7-4832-bc88-75be5fff576f"},{"width":32,"height":18,"x":42,"y":32,"identifier":{"key":"9ae5b42b-e20a-4df6-b935-0109d29dc328","namespace":""},"hasFrame":true,"fontSize":"default","font":"default","type":"subobject-view","id":"41a5c056-7e1b-4f3f-89f2-a90751e3523d"},{"width":23,"height":26,"x":75,"y":32,"identifier":{"key":"ed84a47c-c35a-4c61-878a-e143d12e2c70","namespace":""},"hasFrame":true,"fontSize":"default","font":"default","type":"subobject-view","id":"a0e46ee0-508d-4c91-aad5-bb69599b39d9"}],"layoutGrid":[10,10]},"modified":1705568530618,"location":"667e8c4a-dd16-49a1-86f3-b9dde34c3df5","modifiedBy":"guest","createdBy":"guest","created":1705567381312,"persisted":1705568530619},"d6b23129-bb63-4845-a811-de54b5091d56":{"identifier":{"key":"d6b23129-bb63-4845-a811-de54b5091d56","namespace":""},"name":"Gyro Overlay Plot","type":"telemetry.plot.overlay","composition":[{"key":"~myproject~Gyro.x","namespace":"taxonomy"},{"key":"~myproject~Gyro.y","namespace":"taxonomy"},{"key":"~myproject~Gyro.z","namespace":"taxonomy"}],"configuration":{"series":[{"identifier":{"key":"~myproject~Gyro.x","namespace":"taxonomy"},"yAxisId":1,"color":"#fb4949"},{"identifier":{"key":"~myproject~Gyro.y","namespace":"taxonomy"},"yAxisId":1,"color":"#5abd56"},{"identifier":{"key":"~myproject~Gyro.z","namespace":"taxonomy"},"yAxisId":1,"color":"#9425ea"}]},"modified":1705567457540,"location":"667e8c4a-dd16-49a1-86f3-b9dde34c3df5","modifiedBy":"guest","createdBy":"guest","created":1705567401044,"persisted":1705567457540},"92f80348-b836-4fbe-8923-467174a8543d":{"identifier":{"key":"92f80348-b836-4fbe-8923-467174a8543d","namespace":""},"name":"Battery Overlay Plot","type":"telemetry.plot.overlay","composition":[{"key":"~myproject~Battery1_Temp","namespace":"taxonomy"},{"key":"~myproject~Battery2_Temp","namespace":"taxonomy"},{"key":"~myproject~Battery1_Voltage","namespace":"taxonomy"},{"key":"~myproject~Battery2_Voltage","namespace":"taxonomy"}],"configuration":{"series":[{"identifier":{"key":"~myproject~Battery1_Temp","namespace":"taxonomy"}},{"identifier":{"key":"~myproject~Battery2_Temp","namespace":"taxonomy"}},{"identifier":{"key":"~myproject~Battery1_Voltage","namespace":"taxonomy"}},{"identifier":{"key":"~myproject~Battery2_Voltage","namespace":"taxonomy"}}]},"modified":1705567555085,"location":"667e8c4a-dd16-49a1-86f3-b9dde34c3df5","modifiedBy":"guest","createdBy":"guest","created":1705567538489,"persisted":1705567555086},"e5e00281-554e-49bb-9939-16741e60471b":{"identifier":{"key":"e5e00281-554e-49bb-9939-16741e60471b","namespace":""},"name":"Battery and Gyro Stacked Plot","type":"telemetry.plot.stacked","composition":[{"key":"92f80348-b836-4fbe-8923-467174a8543d","namespace":""},{"key":"d6b23129-bb63-4845-a811-de54b5091d56","namespace":""}],"configuration":{"series":[],"yAxis":{},"xAxis":{}},"modified":1705567575119,"location":"667e8c4a-dd16-49a1-86f3-b9dde34c3df5","modifiedBy":"guest","createdBy":"guest","created":1705567568670,"persisted":1705567575120},"3855e50c-144f-4ff0-a7f7-9f8b326cf3db":{"identifier":{"key":"3855e50c-144f-4ff0-a7f7-9f8b326cf3db","namespace":""},"name":"Sunsensor Gauge","type":"gauge","composition":[{"key":"~myproject~Velocity.x","namespace":"taxonomy"}],"configuration":{"gaugeController":{"gaugeType":"dial-filled","isDisplayMinMax":false,"isDisplayCurVal":true,"isDisplayUnits":true,"isUseTelemetryLimits":false,"limitLow":-0.9,"limitHigh":0.9,"max":1,"min":-1,"precision":2}},"modified":1705567882497,"location":"667e8c4a-dd16-49a1-86f3-b9dde34c3df5","modifiedBy":"guest","createdBy":"guest","created":1705567723469,"persisted":1705567882497},"c5d0c31a-2150-4862-bf9d-a9c8f9c75078":{"identifier":{"key":"c5d0c31a-2150-4862-bf9d-a9c8f9c75078","namespace":""},"name":"Position Telemetry Table","type":"table","composition":[{"key":"~myproject~Position.x","namespace":"taxonomy"},{"key":"~myproject~Position.y","namespace":"taxonomy"},{"key":"~myproject~Position.z","namespace":"taxonomy"}],"configuration":{"columnWidths":{},"hiddenColumns":{},"columnOrder":[],"cellFormat":{},"autosize":true},"modified":1705567913745,"location":"667e8c4a-dd16-49a1-86f3-b9dde34c3df5","modifiedBy":"guest","createdBy":"guest","created":1705567904459,"persisted":1705567913745},"ed84a47c-c35a-4c61-878a-e143d12e2c70":{"identifier":{"key":"ed84a47c-c35a-4c61-878a-e143d12e2c70","namespace":""},"name":"Velocity LAD Table","type":"LadTable","composition":[{"key":"~myproject~Velocity.x","namespace":"taxonomy"},{"key":"~myproject~Velocity.y","namespace":"taxonomy"},{"key":"~myproject~Velocity.z","namespace":"taxonomy"}],"modified":1705568129857,"location":"667e8c4a-dd16-49a1-86f3-b9dde34c3df5","modifiedBy":"guest","createdBy":"guest","created":1705568115515,"persisted":1705568129857},"ac6fbefe-b89f-4a6b-90d1-3d726bd0bbdc":{"identifier":{"key":"ac6fbefe-b89f-4a6b-90d1-3d726bd0bbdc","namespace":""},"name":"Mode LAD Table","type":"LadTable","composition":[{"key":"~myproject~Mode_Day","namespace":"taxonomy"},{"key":"~myproject~Mode_Night","namespace":"taxonomy"},{"key":"~myproject~Mode_Payload","namespace":"taxonomy"},{"key":"~myproject~Mode_Safe","namespace":"taxonomy"},{"key":"~myproject~Mode_SBand","namespace":"taxonomy"},{"key":"~myproject~Mode_XBand","namespace":"taxonomy"}],"modified":1705568172599,"location":"667e8c4a-dd16-49a1-86f3-b9dde34c3df5","modifiedBy":"guest","createdBy":"guest","created":1705568162638,"persisted":1705568172599},"9ae5b42b-e20a-4df6-b935-0109d29dc328":{"identifier":{"key":"9ae5b42b-e20a-4df6-b935-0109d29dc328","namespace":""},"name":"Velocity and Mode LAD Table Set","type":"LadTableSet","composition":[{"key":"ac6fbefe-b89f-4a6b-90d1-3d726bd0bbdc","namespace":""},{"key":"ed84a47c-c35a-4c61-878a-e143d12e2c70","namespace":""}],"modified":1705568209248,"location":"667e8c4a-dd16-49a1-86f3-b9dde34c3df5","modifiedBy":"guest","createdBy":"guest","created":1705568184451,"persisted":1705568209248}},"rootId":"667e8c4a-dd16-49a1-86f3-b9dde34c3df5"}
Loading
Loading