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

chore: remove type: module, create openmct-e2e subpackage #7590

Merged
merged 26 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e92e3e7
fix: remove mystery webpack code
ozyx Mar 14, 2024
943f61b
fix: remove type:module and specify exports
ozyx Mar 14, 2024
70fe7b4
fix: rename webpack*.js to webpack*.mjs so we can use import/export. …
ozyx Mar 14, 2024
c83d25f
fix: exports format
ozyx Mar 15, 2024
ad0d2eb
fix: woops, need to add `start` script back
ozyx Mar 15, 2024
8964506
chore: split e2e into its own module
ozyx Mar 15, 2024
4c449fa
fix: use normal Painterro import
ozyx Mar 15, 2024
9c668ca
fix: update e2e pathing
ozyx Mar 15, 2024
6bade52
fix: copy over helper functions
ozyx Mar 15, 2024
9510555
chore: specify `cwd` for playwright configs so that openmct npm comma…
ozyx Mar 15, 2024
7827b70
chore: add pretest script to e2e package.json
ozyx Mar 15, 2024
45f69a6
chore: don't package e2e
ozyx Mar 15, 2024
73fbf07
refactor: tidy up webpack common config
ozyx Mar 15, 2024
bf9ccf7
chore: compile types to a single file
ozyx Mar 15, 2024
8f63a44
chore: fix visual test npm scripts
ozyx Mar 15, 2024
96de064
chore: fix import pathing
ozyx Mar 15, 2024
352ef77
chore: define package exports, move test specific dependencies to the…
ozyx Mar 16, 2024
162f8d6
chore: export test framework from openmct-e2e
ozyx Mar 16, 2024
763cf6e
chore: export baseFixtures also
ozyx Mar 16, 2024
e790a9a
chore: let `openmct` and `openmct-e2e` share `node_modules/`
ozyx Mar 16, 2024
ebe00fd
chore: use `--workspace`, remove pretest script
ozyx Mar 16, 2024
a42daad
Revert "fix: remove mystery webpack code"
ozyx Mar 17, 2024
f65ea83
chore: update package-lock
ozyx Mar 27, 2024
3d4c9d9
chore: add `.npmignore`
ozyx Mar 28, 2024
c8a7114
Merge branch 'master' into fix-import-require-the-other-way
ozyx Mar 28, 2024
1de1510
fix: *js -> mjs
ozyx Mar 28, 2024
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
6 changes: 0 additions & 6 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,3 @@
!index.html
!openmct.js
!SECURITY.md

# Add e2e tests to npm package
!/e2e/**/*

# ... except our test-data folder files.
/e2e/test-data/*.json
15 changes: 9 additions & 6 deletions .webpack/webpack.common.js → .webpack/webpack.common.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
This is the OpenMCT common webpack file. It is imported by the other three webpack configurations:
- webpack.prod.js - the production configuration for OpenMCT (default)
- webpack.dev.js - the development configuration for OpenMCT
- webpack.coverage.js - imports webpack.dev.js and adds code coverage
- webpack.prod.mjs - the production configuration for OpenMCT (default)
- webpack.dev.mjs - the development configuration for OpenMCT
- webpack.coverage.mjs - imports webpack.dev.js and adds code coverage
There are separate npm scripts to use these configurations, though simply running `npm install`
will use the default production configuration.
*/
Expand All @@ -15,6 +15,7 @@ import CopyWebpackPlugin from 'copy-webpack-plugin';
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
import { VueLoaderPlugin } from 'vue-loader';
import webpack from 'webpack';
import { merge } from 'webpack-merge';
let gitRevision = 'error-retrieving-revision';
let gitBranch = 'error-retrieving-branch';

Expand Down Expand Up @@ -54,9 +55,11 @@ const config = {
globalObject: 'this',
filename: '[name].js',
path: path.resolve(projectRootDir, 'dist'),
library: 'openmct',
libraryExport: 'default',
libraryTarget: 'umd',
library: {
name: 'openmct',
type: 'umd',
export: 'default'
},
publicPath: '',
hashFunction: 'xxhash64',
clean: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
This file extends the webpack.dev.js config to add babel istanbul coverage.
This file extends the webpack.dev.mjs config to add babel istanbul coverage.
OpenMCT Continuous Integration servers use this configuration to add code coverage
information to pull requests.
*/

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

config.devtool = 'source-map';
config.devServer.hot = false;
Expand Down
7 changes: 4 additions & 3 deletions .webpack/webpack.dev.js → .webpack/webpack.dev.mjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
/*
This configuration should be used for development purposes. It contains full source map, a
devServer (which be invoked using by `npm start`), and a non-minified Vue.js distribution.
If OpenMCT is to be used for a production server, use webpack.prod.js instead.
If OpenMCT is to be used for a production server, use webpack.prod.mjs instead.
*/
import { fileURLToPath } from 'node:url';

import path from 'path';
import webpack from 'webpack';
import { merge } from 'webpack-merge';
import { fileURLToPath } from 'node:url';

import common from './webpack.common.js';
import common from './webpack.common.mjs';

export default merge(common, {
mode: 'development',
Expand Down
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 @@ -6,7 +6,7 @@ It is the default webpack configuration.
import webpack from 'webpack';
import { merge } from 'webpack-merge';

import common from './webpack.common.js';
import common from './webpack.common.mjs';

export default merge(common, {
mode: 'production',
Expand Down
2 changes: 1 addition & 1 deletion TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Once the file is generated, it can be published to codecov with
### e2e
The e2e line coverage is a bit more complex than the karma implementation. This is the general sequence of events:

1. Each e2e suite will start webpack with the ```npm run start:coverage``` command with config `webpack.coverage.js` and the `babel-plugin-istanbul` plugin to generate code coverage during e2e test execution using our custom [baseFixture](./baseFixtures.js).
1. Each e2e suite will start webpack with the ```npm run start:coverage``` command with config `webpack.coverage.mjs` and the `babel-plugin-istanbul` plugin to generate code coverage during e2e test execution using our custom [baseFixture](./baseFixtures.js).
1. During testcase execution, each e2e shard will generate its piece of the larger coverage suite. **This coverage file is not merged**. The raw coverage file is stored in a `.nyc_report` directory.
1. [nyc](https://github.com/istanbuljs/nyc) converts this directory into a `lcov` file with the following command `npm run cov:e2e:report`
1. Most of the tests are run in the '@stable' configuration and focus on chrome/ubuntu at a single resolution. This coverage is published to codecov with `npm run cov:e2e:stable:publish`.
Expand Down
6 changes: 3 additions & 3 deletions e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ When an a11y test fails, the result must be interpreted in the html test report

The open source performance tests function in three ways which match their naming and folder structure:

`./e2e/tests/performance` - The tests at the root of this folder path detect functional changes which are mostly apparent with large performance regressions like [this](https://github.com/nasa/openmct/issues/6879). These tests run against openmct webpack in `production-mode` with the `npm run test:perf:localhost` script.
`./e2e/tests/performance/contract/` - These tests serve as [contracts](https://martinfowler.com/bliki/ContractTest.html) for the locator logic, functionality, and assumptions will work in our downstream, closed source test suites. These tests run against openmct webpack in `dev-mode` with the `npm run test:perf:contract` script.
`./e2e/tests/performance/memory/` - These tests execute memory leak detection checks in various ways. This is expected to evolve as we move to the `memlab` project. These tests run against openmct webpack in `production-mode` with the `npm run test:perf:memory` script.
`tests/performance` - The tests at the root of this folder path detect functional changes which are mostly apparent with large performance regressions like [this](https://github.com/nasa/openmct/issues/6879). These tests run against openmct webpack in `production-mode` with the `npm run test:perf:localhost` script.
`tests/performance/contract/` - These tests serve as [contracts](https://martinfowler.com/bliki/ContractTest.html) for the locator logic, functionality, and assumptions will work in our downstream, closed source test suites. These tests run against openmct webpack in `dev-mode` with the `npm run test:perf:contract` script.
`tests/performance/memory/` - These tests execute memory leak detection checks in various ways. This is expected to evolve as we move to the `memlab` project. These tests run against openmct webpack in `production-mode` with the `npm run test:perf:memory` script.

These tests are expected to become blocking and gating with assertions as we extend the capabilities of Playwright.

Expand Down
8 changes: 8 additions & 0 deletions e2e/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Import everything from the specific fixture files
import * as appActions from './appActions.js';
import * as avpFixtures from './avpFixtures.js';
import * as baseFixtures from './baseFixtures.js';
import * as pluginFixtures from './pluginFixtures.js';

// Export these as named exports
export { appActions, avpFixtures, baseFixtures, pluginFixtures };
Loading
Loading