Skip to content

refactor: Convert openmct-yamcs to ESModule #410

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

Merged
merged 50 commits into from
Jan 24, 2024

Conversation

shefalijoshi
Copy link
Collaborator

@shefalijoshi shefalijoshi commented Jan 12, 2024

Closes #409

Describe your changes:

  • We need to update openmct-yamcs to match the cjs import syntax for tests.
  • Also, the tests changed in 3.3.0 and are updated with the new locators.
  • Added lint step
  • Added linting rules for ESModule Import
  • Remove Deploysentinel
  • Added e2e watch mode to match openmct
  • Update network tests to inspect the request/response

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests 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.

Author Checklist

  • Changes address original issue?
  • Tests included and/or updated with changes?
  • Command line build passes?
  • Has this been smoke tested?
  • Testing instructions included in associated issue OR is this a dependency/testcase change?

Reviewer Checklist

  • Changes appear to address issue?
  • Reviewer has tested changes by following the provided instructions?
  • 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)

await expect(page.locator('[aria-label="Search Result"] >> nth=1')).toContainText("CCSDS_Packet_Sequence.GroupFlags");
await expect(page.locator('[aria-label="Search Result"] >> nth=2')).toContainText("CCSDS_Packet_Sequence.Count");

await expect(page.getByLabel('Object Search Result').nth(0)).toContainText("CCSDS_Packet_Sequence");
Copy link
Collaborator

Choose a reason for hiding this comment

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

test fixes to match 3.3.0

@unlikelyzero unlikelyzero added this to the Target:3.3.0 milestone Jan 12, 2024
Copy link
Collaborator

@scottbell scottbell left a comment

Choose a reason for hiding this comment

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

Tested this in my branch, and code is good, but still looks like some tests are still failing?

@@ -19,6 +20,7 @@
"test:e2e:smoke": "npx playwright test --config=./tests/e2e/playwright-quickstart.config.js --project=chromium quickstartSmoke",
"test:e2e:quickstart": "npx playwright test --config=./tests/e2e/playwright-quickstart.config.js --project=chromium tests/e2e/yamcs/",
"test:e2e:quickstart:local": "npx playwright test --config=./tests/e2e/playwright-quickstart.config.js --project=local-chrome tests/e2e/yamcs/",
"test:e2e:watch": "npx playwright test --ui --config=./tests/e2e/playwright-quickstart.config.js",
Copy link
Collaborator

Choose a reason for hiding this comment

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

driveby to write tests faster

@@ -36,11 +38,11 @@
"devDependencies": {
"@babel/core": "7.20.12",
"@babel/eslint-parser": "7.19.1",
"@deploysentinel/playwright": "0.3.4",
Copy link
Collaborator

Choose a reason for hiding this comment

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

driveby

"@playwright/test": "1.39.0",
"babel-loader": "9.1.0",
"babel-plugin-istanbul": "6.1.1",
"eslint": "8.38.0",
"eslint-plugin-import":"2.29.1",
Copy link
Collaborator

Choose a reason for hiding this comment

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

make sure we didn't miss anything

ozyx
ozyx previously requested changes Jan 23, 2024
Copy link
Collaborator

@ozyx ozyx left a comment

Choose a reason for hiding this comment

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

I found a rogue .only()


test('Validate network traffic to YAMCS', async ({ page }) => {
test.only('Validate network traffic to YAMCS', async ({ page }) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

.only

await page.goto("./", { waitUntil: "networkidle" });

await Promise.all([allParams, userGet, mdbOverride]);

//I'm not sure what this block does yet
Copy link
Collaborator

Choose a reason for hiding this comment

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

👁️

Copy link
Collaborator

Choose a reason for hiding this comment

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

@unlikelyzero I think the reason you're getting test failures here is that the page is doing a Promise.all on the page.waitForResponse after the await page.goto("./").

const fs = require('fs');
const semver = require('semver');
const myPackageJson = require('./package.json');
import fs from 'node:fs';
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should be using fs/promises


await page.waitForLoadState('networkidle');
await new Promise(resolve => setTimeout(resolve, 500));
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need this with the waitForResponse stuff?

await Promise.all([allParams, userGet, mdbOverride, parameterArchiveGet, batchPost, mdbOverride]);

// wait for debounced requests in YAMCS Latest Telemetry Provider to finish
await new Promise(resolve => setTimeout(resolve, 500));
Copy link
Collaborator

Choose a reason for hiding this comment

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

same as above - is this still needed?

await page.goto("./", { waitUntil: "networkidle" });

await Promise.all([allParams, userGet, mdbOverride]);

//I'm not sure what this block does yet
Copy link
Collaborator

Choose a reason for hiding this comment

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

@unlikelyzero I think the reason you're getting test failures here is that the page is doing a Promise.all on the page.waitForResponse after the await page.goto("./").

@unlikelyzero unlikelyzero requested a review from ozyx January 24, 2024 20:36
@unlikelyzero unlikelyzero modified the milestones: Target:3.3.0, Target:4.0.0 Jan 24, 2024
@unlikelyzero unlikelyzero merged commit 19513c3 into master Jan 24, 2024
@unlikelyzero unlikelyzero deleted the fix-openmct-yamcs-build-tests branch January 24, 2024 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:maintenance chore, tests, build, ci
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CI] CI is broken after the conversion to modules
4 participants