From 128957ad0099cd06b25d9d44391793f3721d13fe Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Fri, 11 Nov 2022 14:16:54 -0800 Subject: [PATCH 1/3] Fix smoke test substitution --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 308e803d77804..efda52fcbd926 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -112,7 +112,7 @@ jobs: npx tsc --version echo '{"seq": 1, "command": "status"}' | npx tsserver - cat > smoke.js << EOF + cat > smoke.js << 'EOF' const { __importDefault, __importStar } = require("tslib"); const ts = require(process.argv[2]); From 915d054e00e6813d2d76bb401d183171231487f3 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Fri, 11 Nov 2022 15:52:28 -0800 Subject: [PATCH 2/3] Do some logging --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index efda52fcbd926..a28f263f6f395 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -132,7 +132,10 @@ jobs: success = !!fn(); } catch {} - if (success !== shouldSucceed) { + if (success === shouldSucceed) { + console.log(`${fn.toString()} behaved as expected.`); + } + else { if (success) { console.error(`${fn.toString()} unexpectedly succeeded.`); } @@ -142,6 +145,7 @@ jobs: process.exitCode = 1; } } + console.log("ok"); EOF node ./smoke.js typescript From 6aa685088a287a363546a0fa22f1b9ab32843a1c Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Fri, 11 Nov 2022 16:09:47 -0800 Subject: [PATCH 3/3] One last wording tweak --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a28f263f6f395..d17e16da6ca5f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -109,10 +109,14 @@ jobs: npm init --yes npm install $PACKAGE tslib + echo "Testing tsc..." npx tsc --version + + echo "Testing tsserver..." echo '{"seq": 1, "command": "status"}' | npx tsserver cat > smoke.js << 'EOF' + console.log(`Testing ${process.argv[2]}...`); const { __importDefault, __importStar } = require("tslib"); const ts = require(process.argv[2]); @@ -132,16 +136,12 @@ jobs: success = !!fn(); } catch {} + const status = success ? "succeeded" : "failed"; if (success === shouldSucceed) { - console.log(`${fn.toString()} behaved as expected.`); + console.log(`${fn.toString()} ${status} as expected.`); } else { - if (success) { - console.error(`${fn.toString()} unexpectedly succeeded.`); - } - else { - console.error(`${fn.toString()} did not succeed.`); - } + console.log(`${fn.toString()} unexpectedly ${status}.`); process.exitCode = 1; } }