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

promises support in tests #307

Draft
wants to merge 28 commits into
base: feature/mocha-test-reporter
Choose a base branch
from

Conversation

chrisdp
Copy link
Collaborator

@chrisdp chrisdp commented Jan 15, 2025

  • Add https://github.com/rokucommunity/promises to rooibos project under the rooibos namespace
  • Update FileFactory to import rooibos roku_modules
  • Update node and async test to always be node tests as async tests already always had to be run as node test.
  • When @async is present and @sgnode annotation isn't we should default to using Node
  • Allow node tests to extend native nodes
  • When extending native nodes make sure script imports work correct
  • Add differed promises to test, test group, and suite when running node tests
  • Accept promises as a returned result from test functions
  • Move timeout handling for tests into the test class
  • Move timeout handing for suites into the suites
  • Ensure that if a suite times out all incomplete tests are flagged as failures
  • Make sure timeouts fail tests, test groups, and suites
  • Remove old fields that used to be used for observing timeouts and complete states that are no longer needed
  • Add some error checking to fail tests if a promise was returned from a non-node test
  • Maintain support for tests to self invoke m.done()
  • Add some examples to the docs

@chrisdp chrisdp added the enhancement New feature or request label Jan 15, 2025
@chrisdp chrisdp changed the title installed ropm and promises promises support in tests Jan 15, 2025
return m.onTestSuiteComplete()
end if

rooibos.common.logDebug("Running suite asynchronously!")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

update this message

@chrisdp chrisdp added the create-package create a temporary npm package on every commit label Jan 17, 2025
@rokucommunity-bot
Copy link

Hey there! I just built a new temporary npm package based on 49e625a. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/rooibos/releases/download/v0.0.0-packages/rooibos-roku-5.14.0-feature-promises-support.20250117220722.tgz

if m.testSuite.isNodeTest
m.markDoneWhenTestCompletes(promise)
else
throw "Can not return a promise from a non-node test"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Double check that this is a safe way to fail the test and have it show as crashed test.

framework/src/source/rooibos/BaseTestSuite.bs Outdated Show resolved Hide resolved
framework/src/source/rooibos/Test.bs Outdated Show resolved Hide resolved
@@ -159,27 +159,16 @@ namespace rooibos
m.nodeContext.testRunner = m
m.nodeContext.top.addFields({
"rooibosSuiteFinished": false
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We can remove this field as well due to watching for the test results now.

@rokucommunity-bot
Copy link

Hey there! I just built a new temporary npm package based on 07c81a3. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/rooibos/releases/download/v0.0.0-packages/rooibos-roku-5.14.0-feature-promises-support.20250118010524.tgz

@rokucommunity-bot
Copy link

Hey there! I just built a new temporary npm package based on c8f2978. You can download it here or install it by running the following command:

npm install https://github.com/rokucommunity/rooibos/releases/download/v0.0.0-packages/rooibos-roku-5.14.0-feature-promises-support.20250118010533.tgz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
create-package create a temporary npm package on every commit enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant