-
Notifications
You must be signed in to change notification settings - Fork 14
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
phettest should run output-js #1073
Comments
We may be able to use phetsims/phetmarks#56 for local testing before we push to the remote. |
I messaged on slack:
|
I'm adding |
I pushed support for TS code on phettest, and ran the following experiments:
For reference, here are the basic steps to convert a project to TypeScript:
Running "pull-all" will run So I would consider basic support for this to be working, but I anticipate numerous problems related to:
I'm at a good point to check in with @jonathanolson or @zepumph. |
Patch from investigation with @jonathanolson Index: phettest/phettest-server.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/phettest/phettest-server.js b/phettest/phettest-server.js
--- a/phettest/phettest-server.js (revision f6ad184d9171c882d0265a84fa7f902c0d394e0b)
+++ b/phettest/phettest-server.js (date 1631132798022)
@@ -8,6 +8,8 @@
const path = require( 'path' );
const url = require( 'url' );
const fs = require( 'fs' );
+const gitStatus = require( '../../perennial/js/common/gitStatus' );
+const gitPull = require( '../../perennial/js/common/gitPull' );
const port = 45362;
@@ -80,6 +82,10 @@
execute( ON_WIN ? 'grunt.cmd' : 'grunt', [ 'output-js', '--no-color' ], rootDir + repo, callback, errCallback );
}
+async function gruntOutputJSAsync( repo, callback, errCallback ) {
+ execute( ON_WIN ? 'grunt.cmd' : 'grunt', [ 'output-js', '--no-color' ], rootDir + repo, callback, errCallback );
+}
+
function gruntOutputJSAll( callback, errCallback ) {
execute( ON_WIN ? 'grunt.cmd' : 'grunt', [ 'output-js-all', '--no-color' ], rootDir + 'chipper', callback, errCallback );
}
@@ -217,9 +223,21 @@
pull( simName, successFunction( req, res, `pull ${simName}` ), errorFunction( req, res, `pull ${simName}` ) );
}
-function taskPullAll( req, res, query ) {
+async function taskPullAll( req, res, query ) {
- execute( 'bash', [ `${rootDir}perennial/bin/pull-all.sh`, '-p' ], rootDir,
+ const activeRepos = getActiveRepos();
+ const reposToPull = [];
+ for ( const repo of activeRepos ) {
+ const status = await gitStatus( repo );
+ if ( status.behind > 0 ) {
+ reposToPull.push( repo );
+ }
+ }
+ for ( const repo of reposToPull ) {
+ await gitPull( repo );
+ await outputJS();
+ }
+ await execute( 'bash', [ `${rootDir}perennial/bin/pull-all.sh`, '-p' ], rootDir,
// After pull-all succeeds, run output-js-all
() => gruntOutputJSAll( successFunction( req, res, 'pulled' ), errorFunction( req, res, 'output-js-all failed' ) ),
|
Can we just bank on the fact that master may be unstable, but will ALWAYS be compilable? Can we do a git commit hook for that? |
There is a git hook that will prevent developers from committing code that doesn't pass the type checker. |
@jonathanolson and I made progress on this today, leveraging more of perennial tools. @zepumph pointed out that since phettest-server runs from 2 levels deep, its paths are incompatible with a lot of perennial tooling. @zepumph recommended I create a branch with phettest-server moved up one directory, then in the future he can move that to a new top-level repo (instead of nested under phetmarks). |
…nc/await, and use of perennial scripts, see phetsims/chipper#1073
OK the behavior seems to be testing properly on my side, and I committed to a branch as @zepumph and I discussed. @zepumph can you please take the next steps, reaching out to me or @jonathanolson as appropriate? |
grunt tsc -b
all step when pulling
caf9eb7 can almost certainly be improved on, but I was blocked because many tasks in phettest are failing in certain cases due to output-js, so I tried to just get past it. Will you please make sure it is as good as it should be? Perhaps we should check on package.json instead of just the presence of |
…ag supportsOutputJS, see phetsims/chipper#1073 and phetsims/chipper#1095
…ag supportsOutputJS, see phetsims/chipper#1073 and phetsims/chipper#1095
@samreid and I looked at #1073 (comment) together, and we realized that this commit should be reverted, and that changes to outputJS() weren't committed yesterday, so he committed them. |
Much of this work was put on master as part of https://github.com/phetsims/special-ops/issues/209 too (though most of the commits are linked here). @samreid, is there anything else for this issue? |
Nice work on https://github.com/phetsims/special-ops/issues/209, I think everything is working nicely here and in good shape. Next steps are in #1095. Closing. |
phettest needs a
grunt tsc -b
all step when pullingThe text was updated successfully, but these errors were encountered: