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

Codi tests documentation and options #1440

Open
dbauszus-glx opened this issue Aug 28, 2024 · 2 comments
Open

Codi tests documentation and options #1440

dbauszus-glx opened this issue Aug 28, 2024 · 2 comments
Assignees
Labels
Code Issues related to the code structure and performance. Documentation Adding or updating documentation. RFC Request for Comment or Change. Testing Changes relating to existing or new unit tests.

Comments

@dbauszus-glx
Copy link
Member

dbauszus-glx commented Aug 28, 2024

The xyz/TESTING.md needs to be reviewed and should be referenced in the xyz/DEVELOPING.md document.

  1. It should be possible to run the codi tests with just the workspace option, without the need to first setup an ACL, register a user, approve the user, etc.

  2. The security strategy test should perhaps be separate from mapp module tests.

  3. user [roles] could be spoofed for tests.

  4. A POSTGIS test database should be made available for replicating tests. It is possible to dump and restore a data on Postgres hosted with NEON. https://neon.tech/docs/import/import-from-postgres

  5. Perhaps we can make the test database available as bak file with instructions for restoring the data.

  6. Tests should be focused on modules and only include required modules. eg. The featureFormats requires the featureFields module. Tests for the featureFormats module should not require other modules in the test. The featureFields should be tested individually prior to the featureFormats which require the featureFields module.

  7. Is it possible to import assets in tests? Test for synchronous functions should not include await xhr for assets making the test async.

@dbauszus-glx dbauszus-glx added Code Issues related to the code structure and performance. Testing Changes relating to existing or new unit tests. Documentation Adding or updating documentation. RFC Request for Comment or Change. labels Aug 28, 2024
@RobAndrewHurst
Copy link
Contributor

  1. We would need to figure out how we handle workspaces with or without roles.

  2. Agreed.

  3. Yeah that's a great idea for the user roles will tie in with 1.

  4. That could be really good, we should maybe make a way to automate this. Possibly a function we write into ignite to pull and censor data.

  5. Maybe.

  6. So I agree that the tests should be more granular to functions, but we also want to test an entire process. So if its updating a location for example, we will want to call the function that uses all the functions that are included. Another example of this was getting a location to update to then trigger the icon_scale.max value to be recalculated. So we can test the featureFormats wkt function. But we need to see it's acting as it should in further processes. So it's like we need to think about micro and macro tests.

  7. Yes we can, but it will have to be via a request. So I have exposed the tests directory in express, and you can just create a request to get the asset you want. I do this with the decorate layer test.

workspace_layer = await mapp.utils.xhr(`/test/api/workspace/layer?layer=decorate`);
workspace_layer.mapview = mapview;

@RobAndrewHurst
Copy link
Contributor

Additions.

Bundle the test suite so that assets exist in the browser allowing us to remove the need to import files via a request and to expose the tests directory in the express.js. This will also allow us to run these tests in deployed environments and codepens.

We can make it very easy for 3rd parties to test out any bugs of their software using our inputs and tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Issues related to the code structure and performance. Documentation Adding or updating documentation. RFC Request for Comment or Change. Testing Changes relating to existing or new unit tests.
Projects
None yet
Development

No branches or pull requests

4 participants