Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreeman committed Nov 15, 2023
1 parent 8d0816b commit e65dc7d
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 85 deletions.
164 changes: 82 additions & 82 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,89 +20,89 @@ env:
CI: true

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 14
- name: Locate Yarn Cache
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint
- name: Build
run: yarn build
- name: Run Tests
uses: coactions/setup-xvfb@v1
with:
run: yarn test
# test:
# name: Test
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Code
# uses: actions/checkout@v3
# - name: Install Node
# uses: actions/setup-node@v3
# with:
# node-version: 14
# - name: Locate Yarn Cache
# id: yarn-cache-dir-path
# run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
# - uses: actions/cache@v3
# with:
# path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
# key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
# restore-keys: |
# ${{ runner.os }}-yarn-
# - name: Install Dependencies
# run: yarn install --frozen-lockfile
# - name: Lint
# run: yarn lint
# - name: Build
# run: yarn build
# - name: Run Tests
# uses: coactions/setup-xvfb@v1
# with:
# run: yarn test

# The Windows runner can be super flaky both with Yarn installs and
# when launching browser tests, so we allow for retries in those steps.
test-windows:
name: Test Windows
runs-on: windows-2022
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 14
- name: Install Dependencies
uses: nick-fields/retry@v2
with:
max_attempts: 2
timeout_minutes: 10
command: yarn install --frozen-lockfile
- name: Build
run: yarn build
- name: Test @glint/core
uses: nick-fields/retry@v2
with:
max_attempts: 2
timeout_minutes: 20
command: yarn workspace @glint/core test
- name: Test glint-vscode
uses: nick-fields/retry@v2
with:
max_attempts: 2
timeout_minutes: 10
command: yarn workspace glint-vscode test
- name: Test @glint/scripts
run: yarn workspace @glint/scripts test
# # The Windows runner can be super flaky both with Yarn installs and
# # when launching browser tests, so we allow for retries in those steps.
# test-windows:
# name: Test Windows
# runs-on: windows-2022
# steps:
# - name: Checkout Code
# uses: actions/checkout@v3
# - name: Install Node
# uses: actions/setup-node@v3
# with:
# node-version: 14
# - name: Install Dependencies
# uses: nick-fields/retry@v2
# with:
# max_attempts: 2
# timeout_minutes: 10
# command: yarn install --frozen-lockfile
# - name: Build
# run: yarn build
# - name: Test @glint/core
# uses: nick-fields/retry@v2
# with:
# max_attempts: 2
# timeout_minutes: 20
# command: yarn workspace @glint/core test
# - name: Test glint-vscode
# uses: nick-fields/retry@v2
# with:
# max_attempts: 2
# timeout_minutes: 10
# command: yarn workspace glint-vscode test
# - name: Test @glint/scripts
# run: yarn workspace @glint/scripts test

test-floating-deps:
name: Test Floating Dependencies
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 14
- name: Install Dependencies
run: yarn install --no-lockfile
- name: Build
run: yarn build
- name: Run Tests
uses: coactions/setup-xvfb@v1
with:
run: yarn test
# test-floating-deps:
# name: Test Floating Dependencies
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Code
# uses: actions/checkout@v3
# - name: Install Node
# uses: actions/setup-node@v3
# with:
# node-version: 14
# - name: Install Dependencies
# run: yarn install --no-lockfile
# - name: Build
# run: yarn build
# - name: Run Tests
# uses: coactions/setup-xvfb@v1
# with:
# run: yarn test

test-ts-nightly:
name: Test TypeScript Nightly
Expand Down Expand Up @@ -130,4 +130,4 @@ jobs:
- name: Run Tests
uses: coactions/setup-xvfb@v1
with:
run: yarn test
run: yarn workspace @glint/core test
4 changes: 1 addition & 3 deletions packages/core/__tests__/cli/custom-extensions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ describe('CLI: custom extensions', () => {
);

await watch.writeAndAwaitOutput('other.gjs', 'export const foo = 123;', 'Found 0 errors.');
console.log(stripAnsi(watch.allOutput));
await watch.terminate();
});

Expand All @@ -99,7 +100,6 @@ describe('CLI: custom extensions', () => {
'Watching for file changes.'
);

console.log(stripAnsi(watch.allOutput));
expect(output).toMatch('Found 1 error.');
expect(output).toMatch('TS2362');

Expand All @@ -114,11 +114,9 @@ describe('CLI: custom extensions', () => {

expect(output).toMatch('Found 0 errors.');

await new Promise((r) => setTimeout(r, 250));
project.remove('other.gjs');
output = await watch.awaitOutput('Watching for file changes.');

console.log(stripAnsi(watch.allOutput));
expect(output).toMatch('Found 1 error.');
expect(output).toMatch(
"Cannot find module './other' or its corresponding type declarations."
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/common/transform-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ export default class TransformManager {
}

let callback: ts.DirectoryWatcherCallback = (filename) => {
console.log('watchDirectoryCallback', filename, this.getScriptPathForTS(filename));
// Adding or removing a file invalidates most of what we think we know about module resolution
this.moduleResolutionCache.clear();
originalCallback(this.getScriptPathForTS(filename));
Expand Down

0 comments on commit e65dc7d

Please sign in to comment.