-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
perf: wrap tests in check to make sure app is ready when they run #5317
Conversation
Signed-off-by: Erik Kieckhafer <[email protected]>
@aldeed @focusaurus not sure the best way to test this, since it was an intermittent thing. I ran locally and it passed a couple times, and it passed the first time when pushing it to CI, so that's a good sign at least. |
I'm worried putting the import { appIsReady } from "some-test-utils-module";
describe("used outside of a connection", () => {
ConnectionDataStore.set("key", "val");
it(
"sets/gets cached data",
appIsReady(() => {
ConnectionDataStore.set("key", "val");
expect(ConnectionDataStore.get("key")).to.equal("val");
expect(ConnectionDataStore.get("key")).to.equal("val");
})
);
}); Or use |
Could we also do this in a |
@focusaurus most of the tests were already wrapped in this |
@focusaurus You are correct. Looking at the logging, it appears that tests passed because no tests were found. I remember thinking this might be happening at some point but forgot to check it. Sorry! I like the idea of doing a before((done) => {
Reaction.onAppStartupComplete(() => {
Fixtures();
done();
});
}); Didn't try it so I'm not sure it works. If the file calls @kieckhafer the output when the tests run should say "N passed", where N is the number of |
OK I think that makes more sense. Already have lots of nesting due to the mocha API. I think this type of thing is a poster child for why |
@aldeed does the before need to be done inside each |
I think you can have a top-level (not nested) |
@kieckhafer have you had a chance to look at this recently? |
@spencern been caught up with some other time-sensitive work this morning, will circle back once that is finished up. |
Signed-off-by: Erik Kieckhafer <[email protected]>
Made all the updates mentioned here, wrapping it all in a |
Bummer. Not sure just from code inspection what the issue is then. |
I will check out this branch and spend a couple minutes seeing if anything I can think of works. |
They are now all running reliably, but issues with the fixtures and the tests need to be fixed Signed-off-by: Eric Dobbertin <[email protected]>
@kieckhafer @focusaurus I pushed a commit that has all of the Meteor app tests being reliably detected and run. I couldn't get many of the tests to be found, and then I noticed that they were all ones that were moved to Anyway I moved those to be in The remaining problem is that since these haven't been running for awhile, there are at least 24 tests that need to be investigated and fixed. Most of these are probably issues with the mock data or APIs that changed after the tests stopped running. I don't have time to go through any more right now. |
Signed-off-by: Eric Dobbertin <[email protected]>
Signed-off-by: Eric Dobbertin <[email protected]>
Signed-off-by: Eric Dobbertin <[email protected]>
Signed-off-by: Eric Dobbertin <[email protected]>
…test-kieckhafer-wrapInIsAppReady Signed-off-by: Peter Lyons <[email protected]>
Signed-off-by: Peter Lyons <[email protected]>
@kieckhafer @focusaurus I think what's happening with the eslint check is that it's not omitting deleted / moved files from the list. Maybe there is a |
Signed-off-by: Erik Kieckhafer <[email protected]>
Signed-off-by: Erik Kieckhafer <[email protected]>
@aldeed @focusaurus added a check for deleted files: |
Signed-off-by: Erik Kieckhafer <[email protected]>
Resolves #5315
Impact: minor
Type: performance
Issue
CI
test-app
tests intermittently fail with a timeout, but usually pass on a second or third run.Solution
Wrap each test in
Reaction.onAppStartupComplete(() => { /* tests */ })
to make sure app is ready before tests run.Breaking changes
None
Testing