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

Test bundle, Documentation & Codi 🐶 Update #1707

Open
wants to merge 13 commits into
base: patch
Choose a base branch
from

Conversation

RobAndrewHurst
Copy link
Contributor

@RobAndrewHurst RobAndrewHurst commented Nov 13, 2024

Description

Implemented a comprehensive test bundle system to enhance test reusability across different environments. This update includes:

Test Bundle Features

  • Created reusable workspace assets for cross-environment testing
  • Did a review and optimization of the majority of existing test suites. (Some still need to be revisted and reworked.)
  • Standardized test configurations for better maintainability

Codi 🐶 v0.0.47 Updates

  • Enhanced test output control with --quiet flag
    • Streamlines output by displaying only test failures
    • Reduces noise in CI/CD pipelines
    • Backward compatible with existing test configurations

GitHub Issue

Resolves #1440

Type of Change

  • ✅ New feature (non-breaking change which adds functionality)
    • Test bundle system
    • Enhanced output control
  • ✅ Documentation
    • Updated test configuration guides
  • ✅ Testing
    • Improved test organization
    • Enhanced cross-environment compatibility
    • Optimized test asset reusability

@RobAndrewHurst RobAndrewHurst changed the title Test bundle Test bundle, Documentation & Codi 🐶 Update Nov 14, 2024
@RobAndrewHurst RobAndrewHurst marked this pull request as ready for review November 14, 2024 06:20
@RobAndrewHurst RobAndrewHurst linked an issue Nov 14, 2024 that may be closed by this pull request
@@ -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'],
Copy link
Contributor Author

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",
Copy link
Contributor Author

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);
Copy link
Contributor Author

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 = {
Copy link
Contributor Author

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 @@
{
Copy link
Contributor Author

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';
Copy link
Contributor Author

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 () => {
Copy link
Contributor Author

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() {

Copy link
Contributor Author

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

@RobAndrewHurst RobAndrewHurst added Testing Changes relating to existing or new unit tests. Documentation Adding or updating documentation. labels Nov 14, 2024
Copy link

sonarcloud bot commented Nov 14, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Adding or updating documentation. Testing Changes relating to existing or new unit tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Codi tests documentation and options
2 participants