Skip to content

Commit

Permalink
Mct7343 tests merge (#479)
Browse files Browse the repository at this point in the history
* Telemetry batching and throttling (#412)

* Refactored for new batched worker provider

* Skipp callbacks with no telemetry

* Process messages for that remote-clock before any others to avoid race conditions

* Fixing bugs

* Added explanatory comments. Make max batch size and throttle rate configuration

* Removed TODO comment in lieu of a followup ticket

* Make batch configuration explicit in the example

* Tell Istanbul to ignore serialized functions

* Fixing linting errors

* Allow passing in a promise that resolves to a request cache strategy for dictionary load (#418)

* temporarily enable source maps

* pass in cacheStrategy to objectProvider

* remove unused parameters

* change cache strategy to be dynamic

* disable eval-source-map in prod

* lint fix

* fix lint error

* add README section explaining new feature

---------

Co-authored-by: John Hill <john.c.hill@nasa.gov>

* Change promise to function `getDictionaryRequestOptions` (#421)

* make request promise a function getRequestOptions

* rename for clarity

* change promise to a function

* describe using getRequestOptions

* temporarily enable source maps for debugging

* Revert "temporarily enable source maps for debugging"

This reverts commit 6e40684.

* Default to returning a Promise

---------

Co-authored-by: Andrew Henry <akhenry@gmail.com>

* Bump nick-fields/retry from 2 to 3 (#422)

Bumps [nick-fields/retry](https://github.com/nick-fields/retry) from 2 to 3.
- [Release notes](https://github.com/nick-fields/retry/releases)
- [Changelog](https://github.com/nick-fields/retry/blob/master/.releaserc.js)
- [Commits](nick-fields/retry@v2...v3)

---
updated-dependencies:
- dependency-name: nick-fields/retry
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: Mission Status for Situational Awareness (#415)

* feat: first cut of `missionStatus` parameter and telemetry

* feat(WIP): link up mission statuses

* fix: typo

* fix: register missionStatus type in Open MCT

* feat: continue hooking up moving parts

* refactor: more method renames

* refactor: operatorStatusParameter to export functions

* refactor: rename

* remove: unimplemented argument

* refactor: a single endline

* refactor: rename `MissionRole` -> `MissionAction`

* refactor: woops missed one

* feat: user authorization

* fix: use `openmct.telemetry` api for realtime subscriptions

* Check that the mdb override is of parameter type. Discard any other mdb overrides (like algorithms) (#382)

* Check that the mdb override is of parameter type. Discard any other mdb overrides (like algorithms)

* Small change to logic

* Fix search test locator

* Address review comments

* fix: typo

---------

Co-authored-by: Mazzella, Jesse D. (ARC-TI)[KBR Wyle Services, LLC] <jesse.d.mazzella@nasa.gov>

* Update to 4.0.0 (#426)

Remove traces of 3.3.0

* Break at buildtime (#429)

* Add formatter for Binary values from YAMCS (#438)

* using atob on binary values

* using custom base64 to hex function on binary values

* add a little flair, aka, a hex prefix

* moving formatting to a custom formatter in openmct

* adding new binary to hex formatter

* fix typo

* module import syntax errors

* fix another typo

* formatting

* Fix realtime limits (#396)

* Add logic to clear limits in yamcs before running each limits test.
Add a new test to check that no network requests occur when redrawing limits due to resizing
* Add test to ensure no network requests are sent on resizing plots
* Fault management and staleness fixes - they will come in a separate PR

---------

Co-authored-by: Andrew Henry <akhenry@gmail.com>

* Improve telemetry batching (#433)

*  Install remote clock to allow more flight-like testing, but leave Local Clock as the default.
* Auto-fixed some linting errors that snuck into master in binaryToHexFormatter so ignore those changes.
* Renamed rate to maxBatchWait to improve clarity.
* Added extensive e2e tests to verify that Open MCT:
      * Does not drop telemetry while loading (the original issue)
       * Always displays the latest data according to Yamcs
       * Drops telemetry when UI is under sufficient load, and warns the user
       * Reconnects after a WebSocket dropout, and re-subscribes (good catch @shefalijoshi !)

* VIPEROMCT-494: realtime and historical providers should provide same datum format (#444)

* do not include id
* refactor so realtime and historical use same datum generator

* fix(#447): Return mdb override limits correctly on resize (#448)

* fix: correctly return limits

* test(e2e): assert limit lines values before and after resize

---------

Co-authored-by: Scott Bell <scott@traclabs.com>

* Staleness and fault management fix (#440)

* Add logic to clear limits in yamcs before running each limits test.
Add a new test to check that no network requests occur when redrawing limits due to resizing

* Remove test.only

* Change test organization, based on review comments

* Remove focused test

* Add test to ensure no network requests are sent on resizing plots

* remove focused test

* Clear limits before and after each test

* Create a staleness e2e tests stub

* Use the openmct telemetry API to find the provider for realtime fault management alarm objects

* Pass openmct as a parameter to yamcs fault management provider

* adds basic stubs for staleness and fault management tests

* Update tests/e2e/yamcs/faultManagement.e2e.spec.js

Co-authored-by: Jesse Mazzella <ozyx@users.noreply.github.com>

* Update tests/e2e/yamcs/staleness.e2e.js

Co-authored-by: Jesse Mazzella <ozyx@users.noreply.github.com>

* Remove openmct argument

---------

Co-authored-by: Jesse Mazzella <ozyx@users.noreply.github.com>
Co-authored-by: Andrew Henry <akhenry@gmail.com>

* Add format metadata to Events and Commands (#443)

* WIP

* Added gauges and alphanumerics to the test

* Do not activate remote clock by default

* Activate remote clock in tests

* Make max batch wait config rather than hard-coded

* Don't hard-code quickstart URL

* Remove debugging code

* Clean up and externalize test configuration

* Reference modified Yamcs quickstart branch until integrated

* Fixed linting errors

* Fixed quickstart tools tests which I had broken

* Use akhenry/quickstart not yamcs/quickstart for now

* Build against matching Open MCT branch

* Fixed open mct references

* Trying to make work with no feedback about why it's failing

* Set playback rate

* Add target for 10Hz

* Removed parameters missing from github action? (jvm introspection stuff. Maybe security?)

* Revert change to quickstart URLs

* Fixed issue where resubscribe was not happening on websocket dropout

* auto-fixed linting errors

* Do not configure remote clock by default. Creates a dependency on yamcs-quickstart

* Switch back to building against master

* source maps

* test

* adding formats so sorting works

* adding format for reception time as well

* adding metadata to commands so they will sort without issues

* removing source maps

* lint fixes

---------

Co-authored-by: Andrew Henry <akhenry@gmail.com>
Co-authored-by: Jesse Mazzella <ozyx@users.noreply.github.com>

* Warn if default alarms are of a different type than a staticAlarm and… (#435)

* Warn if default alarms are of a different type than a staticAlarm and allow the app to continue

* Use better english for warning message.

* Fix linting issue

---------

Co-authored-by: Andrew Henry <akhenry@gmail.com>
Co-authored-by: Jesse Mazzella <ozyx@users.noreply.github.com>

* Update PULL_REQUEST_TEMPLATE.md (#450)

Sync with openmct's template

* Fix import require (#446)

* chore: rename webpack.*.js -> webpack.*.mjs

* chore: rename *e2e*.js -> *e2e*.mjs

* chore: add workspace, update opensource script and playwright config

* fix: get openmct e2e tests before npm install

* chore: *.js -> *.mjs

* fix: npm script

* chore: revert workflow change, use post script instead

* refactor: async ops deps check

* refactor: add docs, resolve path

* chore: generate `source-map` for coverage

* fix: remove `.only`

* fix: change branch for testing

* fix: point to correct file

* fix: make yamcs example work again

* fix: add back context, remove unused alias

* fix: use absolute path

* coverage: match mjs files too

* chore: specify working dirs instead of cd

* fix: yaml whitespace issues

* fix: swap order of operations on quickstart job

* chore: remove debug branches

* fix: bad merge

* fix: upgrade playwright version in the workflow (fixme)

* test: fix historicalData tests

* [Historical Telemetry Provider] Respect "order" request options (#455)

* accepting incoming order value from request options
* verifying descending order for requests in limited mode
* refactor: historicalData tests

---------

Co-authored-by: Andrew Henry <akhenry@gmail.com>
Co-authored-by: Mazzella, Jesse D. (ARC-TI)[KBR Wyle Services, LLC] <jesse.d.mazzella@nasa.gov>

* chore:bump deps to match openmct 4.0.0 (#457)

* chore:bump deps to match openmct 4.0.0

* fix: update webpack devServer schema + lint/format

---------

Co-authored-by: Mazzella, Jesse D. (ARC-TI)[KBR Wyle Services, LLC] <jesse.d.mazzella@nasa.gov>

* docs: add JSDocs for Mission Status (#432)

* docs: mission-status-parameter

* docs(WIP): mission-status-telemetry

* docs: finish documention on `mission-status-telemetry`

* docs: document `mission-status-parameter`

* docs: document Mission Status configuration

* Test for Telemetry Table mutation on non-mutable objects (#458)

* update README.md steps as they have changed

* adding a test to check for telemetry tables trying to mutate immutable objects

* clarity

* adding general error failure as well as assertion of mode change

* chore: bump playwright to 1.44.0 (#460)

* chore: bump playwright to 1.45.0 (#462)

* chore: bump playwright to `1.45.2` (#465)

* chore: bump playwright to `1.45.2`

* chore: bump playwright to `1.45.2`, swap order of steps to be correct

* test: fix locator

* test: fix locator

* test: fix locator

* test: fix locators in anticipation of openmct e2e fixes (#467)

* test: fix locators in anticipation of openmct e2e fixes

* chore: use `make all`. `make all-10hz` had no effect before (maybe we thought it did?) but fails now due to Makefile upgrades

* fix: forkin' hell

- ok so it turns out that we were using a custom fork with the ability to change the data rate of the yamcs simulator script. akhenry is on vacation so i updated the branch and pushed it to my fork so we can get things moving.

* test: revert changes which broke assertion

* refactor: missed a spot :/

* build: go back to using actual quickstart repo now that our changes our merged (#473)

* Deal with Parameter mdb overrides only (#471)

* Check that the override is of type parameter before getting it's details.

* New test to ensure that openmct loads correctly when mdb overrides exist

* Update tests to use myproject visible assertion

---------

Co-authored-by: John Hill <john.c.hill@nasa.gov>

* Test for Performance Mode changes incorrectly changing sort order (#469)

* adding new test for sort order being sent in requests

* Update yamcs quickstart version to match viper (#475)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Andrew Henry <akhenry@gmail.com>
Co-authored-by: David Tsay <3614296+davetsay@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jesse Mazzella <ozyx@users.noreply.github.com>
Co-authored-by: Shefali Joshi <simplyrender@gmail.com>
Co-authored-by: Mazzella, Jesse D. (ARC-TI)[KBR Wyle Services, LLC] <jesse.d.mazzella@nasa.gov>
Co-authored-by: Jamie V <jamie.j.vigliotta@nasa.gov>
Co-authored-by: Scott Bell <scott@traclabs.com>
  • Loading branch information
9 people authored Sep 17, 2024
1 parent 1b11659 commit edd8ec4
Show file tree
Hide file tree
Showing 52 changed files with 2,361 additions and 529 deletions.
7 changes: 3 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ Closes <!--- Insert Issue Number(s) this PR addresses. Start by typing # will op

* [ ] Have you followed the guidelines in our [Contributing document](https://github.com/nasa/openmct/blob/master/CONTRIBUTING.md)?
* [ ] Have you checked to ensure there aren't other open [Pull Requests](https://github.com/nasa/openmct/pulls) for the same update/change?
* [ ] Is this change backwards compatible? For example, developers won't need to change how they are calling the API or how they've extended core plugins such as Tables or Plots.
* [ ] Is this a [notable change](../docs/src/process/release.md) that will require a special callout in the release notes? For example, will this break compatibility with existing APIs or projects that consume these plugins?

### Author Checklist

* [ ] Changes address original issue?
* [ ] Tests included and/or updated with changes?
* [ ] Command line build passes?
* [ ] Has this been smoke tested?
* [ ] Have you associated this PR with a `type:` label? Note: this is not necessarily the same as the original issue.
* [ ] Have you associated a milestone with this PR? Note: leave blank if unsure.
* [ ] Testing instructions included in associated issue OR is this a dependency/testcase change?

### Reviewer Checklist
Expand All @@ -25,5 +26,3 @@ Closes <!--- Insert Issue Number(s) this PR addresses. Start by typing # will op
* [ ] Changes appear not to be breaking changes?
* [ ] Appropriate automated tests included?
* [ ] Code style and in-line documentation are appropriate?
* [ ] Has associated issue been labelled unverified? (only applicable if this PR closes the issue)
* [ ] Has associated issue been labelled bug? (only applicable if this PR is for a bug fix)
23 changes: 11 additions & 12 deletions .github/workflows/yamcs-quickstart-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
matrix:
yamcs-version:
- default
- 5.8.7 #viper
- 5.9.8 #viper
## disabling until we get confirmation- 5.3.2 #ab
openmct-version:
- latest
Expand All @@ -34,33 +34,32 @@ jobs:
- uses: actions/checkout@v3
with:
repository: yamcs/quickstart
ref: master
path: 'quickstart'
- name: replace yamcsVersion with matrix param
if: matrix.yamcs-version != 'default'
run: |
cd quickstart
mvn -B versions:set-property -Dproperty=yamcsVersion -DnewVersion=${{ matrix.yamcs-version }}
working-directory: quickstart
- name: trigger make all from docker dir. Orphan and redirect output to docker/makeout.txt
run: |
cd quickstart/docker
touch makeout.txt
make all &> makeout.txt &
make all-10hz &> makeout.txt &
working-directory: quickstart/docker
- run: npm install
- name: Get Open MCT e2e tests
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
command: npm run test:getopensource
- name: Run build:example based on openmct-version
run: |
if [ "${{ matrix.openmct-version }}" = "latest" ]; then
npm run build:example:master
elif [ "${{ matrix.openmct-version }}" = "stable" ]; then
npm run build:example
fi
- run: npx playwright@1.39.0 install chromium
- name: Get Open MCT e2e tests
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command: npm run test:getopensource
- run: npx playwright@1.45.2 install chromium
- name: Check that yamcs is available
run: |
docker ps -a
Expand Down
File renamed without changes.
10 changes: 3 additions & 7 deletions .webpack/webpack.coverage.js → .webpack/webpack.coverage.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,19 @@
* at runtime from the About dialog for additional information.
*****************************************************************************/

import config from './webpack.dev.js';
import config from './webpack.dev.mjs';

// eslint-disable-next-line no-undef
const CI = process.env.CI === 'true';

config.devtool = CI ? false : undefined;
config.devtool = 'source-map';

config.devServer.hot = false;

config.module.rules.push({
test: /\.js$/,
test: /\.(mjs|js)$/,
exclude: /(node_modules)/,
use: {
loader: 'babel-loader',
options: {
retainLines: true,
// eslint-disable-next-line no-undef
plugins: [['babel-plugin-istanbul', {
extension: ['.js']
}]]
Expand Down
80 changes: 41 additions & 39 deletions .webpack/webpack.dev.js → .webpack/webpack.dev.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,51 +19,53 @@
* this source code distribution or the Licensing information page available
* at runtime from the About dialog for additional information.
*****************************************************************************/
import path from 'path';
import { fileURLToPath } from 'url';
import { merge } from 'webpack-merge';
import commonConfig from './webpack.common.js';
// @ts-check
import path from "path";
import { fileURLToPath } from "url";
import { merge } from "webpack-merge";
import commonConfig from "./webpack.common.mjs";

// Replicate __dirname functionality for ES modules
const __dirname = path.dirname(fileURLToPath(import.meta.url));

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

export default merge(commonConfig, devConfig);
2 changes: 1 addition & 1 deletion .webpack/webpack.prod.js → .webpack/webpack.prod.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*****************************************************************************/

import { merge } from 'webpack-merge';
import common from './webpack.common.js';
import common from './webpack.common.mjs';

/** @type {import('webpack').Configuration} */
const prodConfig = {
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,23 @@ openmct.install(installYamcsPlugin({
| yamcsInstance | The name of the instance configured in YAMCS that you wish to connect to. | myproject |
| yamcsFolder | The name of the instance configured in YAMCS that you wish to connect to. | myproject |

## getDictionaryRequestOptions
installYamcsPlugin also accepts an optional function argument `getDictionaryRequestOptions`. Use this function to return request options when requesting the YAMCS dictionary. An example of how to make use of this is below.
```
openmct.install(installYamcsPlugin(
configuration,
getDictionaryRequestOptions
))
function getDictionaryRequestOptions() {
const requestOptions = SOME_CHECK_IF_DICTIONARY_VERSION_IS_NEW
? { cache: 'reload' }
: {};
return requestOptions;
}
```

## Special XTCE features

If you are using an XTCE configuration in Yamcs, there are two special
Expand Down
24 changes: 0 additions & 24 deletions check-optional-dependencies.js

This file was deleted.

55 changes: 55 additions & 0 deletions check-optional-dependencies.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// check-optional-dependencies.mjs
import fs from 'node:fs/promises';
import semver from 'semver';
import process from 'node:process';

/**
* Checks if an optional dependency satisfies the expected version.
*
* @param {string} dependency - The name of the dependency to check.
* @param {string} expectedVersion - The semver range the version should satisfy.
* @returns {Promise<string|null>} A promise that resolves with an error message if the dependency does not satisfy the expected version, or is not installed; otherwise, null.
*/
async function checkOptionalDependency(dependency, expectedVersion) {
try {
const packageJsonPath = new URL(`./node_modules/${dependency}/package.json`, import.meta.url).pathname;
const installedPackageJsonData = await fs.readFile(packageJsonPath, { encoding: 'utf8' });
const { version: installedVersion } = JSON.parse(installedPackageJsonData);

if (!semver.satisfies(installedVersion, expectedVersion)) {
return `The installed version of optional dependency ${dependency} is ${installedVersion}, which does not satisfy the expected version ${expectedVersion}. Please update it before building.`;
}
} catch (error) {
return `The optional dependency ${dependency} is not installed. Please install it before building.\n${error}`;
}

return null;
}

/**
* Checks all optional dependencies listed in the package.json against their expected versions.
*
* @returns {Promise<void>} A promise that resolves if all optional dependencies satisfy their expected versions, or rejects with an error message if any do not.
*/
async function checkAllOptionalDependencies() {
const packageJsonPath = new URL('./package.json', import.meta.url);
const myPackageJsonData = await fs.readFile(packageJsonPath);
const { optionalDependencies } = JSON.parse(myPackageJsonData);

const checks = Object.entries(optionalDependencies).map(([dependency, expectedVersion]) =>
checkOptionalDependency(dependency, expectedVersion)
);

const results = await Promise.all(checks);
const errors = results.filter(result => result !== null);

if (errors.length > 0) {
console.error(errors.join('\n'));
process.exit(1);
}
}

checkAllOptionalDependencies().catch(error => {
console.error(error);
process.exit(1);
});
2 changes: 1 addition & 1 deletion example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<html>
<head>
<title>Open MCT - YAMCS Example</title>
<script src="/dist/openmct.js"></script>
<script src="/node_modules/openmct/dist/openmct.js"></script>
<script src="/openmct-yamcs-example.js" defer></script>

<link rel="icon" type="image/png" href="/node_modules/openmct/dist/favicons/favicon-96x96.png" sizes="96x96" type="image/x-icon">
Expand Down
Loading

0 comments on commit edd8ec4

Please sign in to comment.