Skip to content

chore: improve tests#21

Merged
2-towns merged 10 commits intomasterfrom
chore/improve-tests
May 30, 2025
Merged

chore: improve tests#21
2-towns merged 10 commits intomasterfrom
chore/improve-tests

Conversation

@2-towns
Copy link
Collaborator

@2-towns 2-towns commented May 30, 2025

This PR enhances test quality by leveraging codex-factory for integration testing.

cc @AuHau

@2-towns 2-towns marked this pull request as ready for review May 30, 2025 10:02
@2-towns 2-towns merged commit a437e59 into master May 30, 2025
1 check passed
@2-towns 2-towns deleted the chore/improve-tests branch May 30, 2025 10:04
@2-towns 2-towns mentioned this pull request May 30, 2025
Copy link
Contributor

@AuHau AuHau left a comment

Choose a reason for hiding this comment

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

I would maybe add a note to README about how tu run the tests locally with the codex-factory. Eq. before running tests spin up Codex cluster with npx codex-factory start --detach latest.

Also, I would be bit cautious about using latest. That runs the latest nim-codex master commit, which might not be really something you want. First of all the stability of the tests might be compromised (eq. you run the tests once and they pass, then you rerun them later on again without any change in codex-js and suddenly they might start failing). Second of all, IMHO it is good idea to target specific version of nim-codex that the library supports and run the tests against that. Then of course upon every new nim-codex release this will need to be updated, but again that is a good thing. You can automatize it with Github Actions, where you can get automatic PR that will update the supported version and thanks to that you will immediately know if there are some problems from the CI tests. I have this setup for example for the Python's bindings library (example).
For this there is IMHO great feature in Codex Factory - External Codex version configuration. Where you can put the version of the nim-codex that the library supports into package.json: engines.codex property which will then get automatically picked up by Codex Factory (you then run only npx codex-factory start --detach without version). And then you can have the automatic PR modifying this property.

- run: npm ci

- name: Start codex-factory
run: npx codex-factory start latest &
Copy link
Contributor

Choose a reason for hiding this comment

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

You can run this with --detach and then you don't need the & and following "Wait for SP" step, because it will automatically "exit" when the cluster is ready (eq. all the nodes are up and running) ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants