-
Notifications
You must be signed in to change notification settings - Fork 26
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
Test bundle, Documentation & Codi 🐶 Update #1707
base: patch
Are you sure you want to change the base?
Conversation
esbuild.config.mjs
Outdated
@@ -4,13 +4,14 @@ import * as esbuild from 'esbuild' | |||
const isDev = process.env.NODE_ENV !== 'DEVELOPMENT'; | |||
|
|||
const buildOptions = { | |||
entryPoints: ['./lib/mapp.mjs', './lib/ui.mjs'], | |||
entryPoints: isDev ? ['./lib/mapp.mjs', './lib/ui.mjs'] : ['./lib/mapp.mjs', './lib/ui.mjs', './tests/_mapp.test.mjs'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We bundle the test assets if we are in DEVELOPMENT mode. We can discuss if we want this all the time or in other certain situations.
@@ -11,7 +11,7 @@ | |||
"scripts": { | |||
"test": "codi tests", | |||
"_build": "node esbuild.config.mjs", | |||
"browser-sync": "npx browser-sync start --proxy localhost:3000 --port 3001 --ui-port 3002 --files public/js/lib/**/* --no-open --no-notify", | |||
"browser-sync": "npx browser-sync start --proxy localhost:3000 --port 3001 --ui-port 3002 --files public/js/**/* --no-open --no-notify", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Browser sync will now reload for either changes to lib or tests
if (integrity) { | ||
results = await codi.runWebTests(testFiles); | ||
} else { | ||
results = await codi.runWebTestFunction(_mappTest.coreTest); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This webTestFunction might be better used on each test function in the test bundle to try aid parallel testing in the future.
import { formatTest } from './lib/layer/format/_format.test.mjs'; | ||
import { ui_locations } from './lib/ui/locations/_locations.test.mjs'; | ||
|
||
self._mappTest = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the test bundle entry point that self assigns just like mapp
@@ -0,0 +1,67 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example of saving away a configuration, which can be imported from the bundled test library.
} | ||
} | ||
} | ||
import mvt_layer_default from '../../../assets/layers/mvt/layer.json'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example of importing the asset. This will be applied more as I continue the re-review and structure of current tests
//TODO | ||
}); | ||
}); | ||
// await codi.describe('TODO: Mapview: allfeaturesTest', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeping these TODO's in the test base so I can get to the asap
@@ -3,67 +3,7 @@ | |||
* @function Tabview | |||
*/ | |||
export async function Tabview() { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This need to be re-reviewed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The quiet flag is a nice addition. The testing.md makes sense to me 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The integrity tests are not working correctly.
At the start of the integrity test it throws an error that /js/tests/_mapp.test.js does not exist (404).
I also see an error 'Erroringrunning test file' using this path /public/tests/integrity.test.mjs. This is also timing out after 5000ms in the webRunner.
The tests then also say that they have finished way before all the thematics have finished running through the test.
How are you running the tests? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The nodemon.json references local resources and must be added to ignore. The file and it's content must be referenced in the testing.md to explain the build process.
I have updated the documentation and removed nodemon.json and added in an example config into the DEVELOPING docs |
Need to see how the tests are called
Quality Gate passedIssues Measures |
After some discussion @simon-leech has pushed a change where the test bundle will happen all the time. This is fine because only on the _test.html view do we call the bundle! |
Description
Implemented a comprehensive test bundle system to enhance test reusability across different environments. This update includes:
Test Bundle Features
Codi 🐶 v0.0.47 Updates
--quiet
flagGitHub Issue
Resolves #1440
Type of Change