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

CTQ status is not reliably reported to Slack#continouous-testing #166

Closed
pixelzoom opened this issue Mar 5, 2023 · 13 comments
Closed

CTQ status is not reliably reported to Slack#continouous-testing #166

pixelzoom opened this issue Mar 5, 2023 · 13 comments

Comments

@pixelzoom
Copy link
Contributor

pixelzoom commented Mar 5, 2023

CTQ is not showing up reliably in this Slack channel. For example, looking at the CT page, number-suite-common has been failing lint since 3/3/2023 2:52:40 PM (see below) and as of 3/5/2023 8:48 AM is not showing up in Slack#continouous-testing.

If there are multiple CTQ errors, is something considering them all fixes when only 1 of them has been fixed?

Assigning to @zepumph @jonathanolson to investigate, @kathy-phet to prioritize.

screenshot_2348

@pixelzoom
Copy link
Contributor Author

pixelzoom commented Mar 5, 2023

In Slack#continouous-testing, @kathy-phet said:

@chrisklus - can you please take a quick look at the above on Monday [3/6] and comment on possible issues, I believe you were leading the work to consolidate the slack messaging piece of CT a while back. But let me know if I’m mistaken there.

@pixelzoom
Copy link
Contributor Author

pixelzoom commented Mar 12, 2023

I hit this again today. Buggy code in to the new 'community' repo. It's failing lint in CTQ, reported on the CT webpage, not reported in Slack#continuous-testing.

Raising priority to top, because PhET depends heavily on CT and CTQ. And assigning to @kathy-phet to prioritize.

@chrisklus
Copy link
Contributor

@zepumph and I are planning to investigate this afternoon.

@zepumph
Copy link
Member

zepumph commented Mar 14, 2023

@chrisklus and I spent an hour on this just now and only barely got to a point where we could iterate and understand the code effectively. We made many improvements along the way and if this issue should remain a priority. It should not try to be worked into the cracks of this iteration, but should have real time devoted to it (and I'd be very happy to get to work on it!).

We will check back in tomorrow.

@zepumph
Copy link
Member

zepumph commented Apr 14, 2023

Today @chrisklus and I overhauled the quick server to get it ready for parsing these messages better. We have a few leads on where the problems are coming from, but our best guess is that we change the lint output so that it has individual repos as they run, and then an "all results" section. We should just parse that part for CTQ.

zepumph added a commit that referenced this issue Apr 14, 2023
  * Factor out methods from  main loop
  * Simplify forceTests and waiting logic
  * Send slack a message upon first run and passing
  * Isolate individual tests to a single line each
zepumph added a commit to phetsims/chipper that referenced this issue Apr 14, 2023
jonathanolson added a commit that referenced this issue Apr 24, 2023
zepumph added a commit to phetsims/chipper that referenced this issue Apr 25, 2023
@zepumph
Copy link
Member

zepumph commented Apr 25, 2023

I was able to find and fix a fair number of bugs about the lint error parsing, now I'm going to move on to tsc checking which is (on my machine at least) reporting errors like tsc: . (blank). Fun!

zepumph added a commit that referenced this issue Apr 25, 2023
1. Support windows using backslashes for file paths.
2. Instead of line.length use a line regex (with row:column + error detection)
3. Fix case missing last filename because we need to recheck when we have a currentFilename and the `line` is the next filename.
zepumph added a commit that referenced this issue Apr 25, 2023
@zepumph
Copy link
Member

zepumph commented Apr 25, 2023

I made good progress. With the help of @marlitas and @samreid the tsc command is not much easier to parse and report on. I pushed these new changes to sparky ctq. We will see if there is any trouble before too long.

zepumph added a commit that referenced this issue Apr 25, 2023
@zepumph
Copy link
Member

zepumph commented Apr 25, 2023

  • As part of this issue I'd like to look into reportErrorStatus, documenting and updating if needed (but mostly trying to understand it).

@zepumph
Copy link
Member

zepumph commented Apr 26, 2023

Ok. I have completed the work I see for this issue. All changes above are now pushed to production on sparky's ct-quick process. From here I think it would be best for @chrisklus to do the review.

@pixelzoom, please let us know if you run into any more trouble.

@zepumph zepumph removed their assignment Apr 26, 2023
@chrisklus
Copy link
Contributor

@zepumph and I did much of this review together to get me oriented and then I did some testing on my side and a bit more code review. Things are looking great! I tested all of the cases I could think of, including throwing an Error in code which @zepumph mentioned he had not tried out. It didn't always show up but I think that was just because sometimes the sim doesn't start up for the allotted time in the test case.

@zepumph and I ran into one issue where i didn't have an npm module and so an unexpected lint error triggered an assertion which was a failure farther downstream than we were expecting. I looked into this a little bit and found that the error was not sending an stderr, but I'm not sure why.

The only thing I noticed behavior wise was that a fuzz error reports as new error every loop. I think this may be because the server port is different every time? So it doesn't recognize it as the same error. But, it's good that it's not continuously adding to the number of errors every time, so that when it is fixed, there aren't a bunch of reported pre-existing errors still around. I'm not thinking this is worth fixing since I'm not sure I've ever seen a fuzz error show up on CTQ in the history of it's life, and it would probably be a lot of work.

CTQ additional failure:
simFuzz: Error: Error: Error: Assertion failed: Screen tandems should end with Screen suffix
    at window.assertions.assertFunction (http://localhost:59717/assert/js/assert.js:28:13)
    at new Screen (http://localhost:59717/chipper/dist/js/joist/js/Screen.js:120:17)
    at new LabScreen (http://localhost:59717/chipper/dist/js/natural-selection/js/lab/LabScreen.js:39:5)
    at http://localhost:59717/chipper/dist/js/natural-selection/js/natural-selection-main.js:17:78
    at Namespace.window.phet.joist.launchSimulation (http://localhost:59717/chipper/dist/js/joist/js/simLauncher.js:62:9)
    at http://localhost:59717/chipper/dist/js/joist/js/simLauncher.js:80:27
    at http://localhost:59717/chipper/dist/js/phet-core/js/asyncLoader.js:38:42
    at Array.forEach (<anonymous>)
    at AsyncLoader.proceedIfReady (http://localhost:59717/chipper/dist/js/phet-core/js/asyncLoader.js:38:22)
    at Image.<anonymous> (http://localhost:59717/chipper/dist/js/phet-core/js/asyncLoader.js:51:12)
3 pre-existing errors remain.

[4:28](https://phetsims.slack.com/archives/C03G9D6NY07/p1682634486002929)
CTQ additional failure:
simFuzz: Error: Error: Error: Assertion failed: Screen tandems should end with Screen suffix
    at window.assertions.assertFunction (http://localhost:59733/assert/js/assert.js:28:13)
    at new Screen (http://localhost:59733/chipper/dist/js/joist/js/Screen.js:120:17)
    at new LabScreen (http://localhost:59733/chipper/dist/js/natural-selection/js/lab/LabScreen.js:39:5)
    at http://localhost:59733/chipper/dist/js/natural-selection/js/natural-selection-main.js:17:78
    at Namespace.window.phet.joist.launchSimulation (http://localhost:59733/chipper/dist/js/joist/js/simLauncher.js:62:9)
    at http://localhost:59733/chipper/dist/js/joist/js/simLauncher.js:80:27
    at http://localhost:59733/chipper/dist/js/phet-core/js/asyncLoader.js:38:42
    at Array.forEach (<anonymous>)
    at AsyncLoader.proceedIfReady (http://localhost:59733/chipper/dist/js/phet-core/js/asyncLoader.js:38:22)
    at Image.<anonymous> (http://localhost:59733/chipper/dist/js/phet-core/js/asyncLoader.js:51:12)
3 pre-existing errors remain.

[4:28](https://phetsims.slack.com/archives/C03G9D6NY07/p1682634505594419)
CTQ additional failure:
simFuzz: Error: Error: Error: Assertion failed: Screen tandems should end with Screen suffix
    at window.assertions.assertFunction (http://localhost:59750/assert/js/assert.js:28:13)
    at new Screen (http://localhost:59750/chipper/dist/js/joist/js/Screen.js:120:17)
    at new LabScreen (http://localhost:59750/chipper/dist/js/natural-selection/js/lab/LabScreen.js:39:5)
    at http://localhost:59750/chipper/dist/js/natural-selection/js/natural-selection-main.js:17:78
    at Namespace.window.phet.joist.launchSimulation (http://localhost:59750/chipper/dist/js/joist/js/simLauncher.js:62:9)
    at http://localhost:59750/chipper/dist/js/joist/js/simLauncher.js:80:27
    at http://localhost:59750/chipper/dist/js/phet-core/js/asyncLoader.js:38:42
    at Array.forEach (<anonymous>)
    at AsyncLoader.proceedIfReady (http://localhost:59750/chipper/dist/js/phet-core/js/asyncLoader.js:38:22)
    at Image.<anonymous> (http://localhost:59750/chipper/dist/js/phet-core/js/asyncLoader.js:51:12)
3 pre-existing errors remain.

Back to @zepumph if anything else to do before close.

@chrisklus chrisklus assigned zepumph and unassigned chrisklus Apr 28, 2023
@zepumph
Copy link
Member

zepumph commented Apr 28, 2023

So still to investigate:

  • lint.js should provide stderr when facing problems (likely from the composite structure of linting individual repos)
  • Figure out how to make sure puppeteer fails to CTQ if you have a very upstream error like throw new Error() in main
  • Update the "comparison" logic for fuzzing errors to ignore /localhost:\d} so that ports don't cause reporting to think there is a new error.

@zepumph
Copy link
Member

zepumph commented Apr 28, 2023

  • Figure out how to make sure puppeteer fails to CTQ if you have a very upstream error like throw new Error() in main

Yes I'm pretty sure you are right. I also encountered it only sometimes throwing an error because the sim fuzz is only for 1 second when testing.

@zepumph
Copy link
Member

zepumph commented Apr 28, 2023

Alright. With a bit of a weird try catch in lint, we can force stderr from occurring. This means that problems with Line will be handled separately, upstream of trying to parse the lint errors (which would likely result in a false negative).

Everything else here has been handled. Thanks so much @chrisklus for the timely review.

@zepumph zepumph closed this as completed Apr 28, 2023
samreid pushed a commit to phetsims/perennial that referenced this issue Oct 17, 2024
samreid pushed a commit to phetsims/perennial that referenced this issue Oct 17, 2024
samreid pushed a commit to phetsims/perennial that referenced this issue Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants