From 9f07c748ba2a344ef0a23d7a3e0cf213e4d4fe95 Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Sat, 15 Feb 2025 23:55:51 +0100 Subject: [PATCH 1/6] Add glob test case --- tests/flags.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/flags.js b/tests/flags.js index 227bb1a6..8c21d5a1 100644 --- a/tests/flags.js +++ b/tests/flags.js @@ -704,6 +704,12 @@ describe('flags', () => { ]); assert.strictEqual(runResult.status, 0); }).timeout(60000); + + it('Should find all Elm files inside the directory that a glob resolves to', () => { + // This is nice if two globs accidentally intersect. + const runResult = execElmTest(['tests/Pass*']); + assert.strictEqual(runResult.status, 0); + }).timeout(60000); }); describe('unknown flags', () => { From 1f855f478b74943802981308b41a47a1e2576818 Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Sun, 16 Feb 2025 00:00:36 +0100 Subject: [PATCH 2/6] Debug --- .github/workflows/test.yml | 10 +++++----- tests/flags.js | 14 +++++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 222955df..e72889b3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,12 +14,12 @@ jobs: matrix: # macOS-13 is the latest macOS version that is x86. # Node.js 12, 14 and 16 aren’t support on the arm64 runners. - os: [ubuntu-latest, macOS-13, windows-latest] - node-version: [12.x, 14.x, 16.x, 18.x, 20.x, 22.x] + os: [windows-latest] + node-version: [22.x] # Also have a test on macOS arm64. - include: - - os: macOS-latest - node-version: 22.x + # include: + # - os: macOS-latest + # node-version: 22.x env: ELM_HOME: '${{ github.workspace }}/elm-stuff/elm-home' diff --git a/tests/flags.js b/tests/flags.js index 8c21d5a1..d6f94804 100644 --- a/tests/flags.js +++ b/tests/flags.js @@ -705,11 +705,15 @@ describe('flags', () => { assert.strictEqual(runResult.status, 0); }).timeout(60000); - it('Should find all Elm files inside the directory that a glob resolves to', () => { - // This is nice if two globs accidentally intersect. - const runResult = execElmTest(['tests/Pass*']); - assert.strictEqual(runResult.status, 0); - }).timeout(60000); + it.only( + 'Should find all Elm files inside the directory that a glob resolves to', + () => { + // This is nice if two globs accidentally intersect. + const runResult = execElmTest(['tests/Pass*']); + console.log(runResult); + assert.strictEqual(runResult.status, 0); + } + ).timeout(60000); }); describe('unknown flags', () => { From 4a0803daeb620edf8ed541138a6178a6ac884f54 Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Sun, 16 Feb 2025 00:03:31 +0100 Subject: [PATCH 3/6] Print trailing char --- lib/FindTests.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/FindTests.js b/lib/FindTests.js index 58b0c4b2..518127f6 100644 --- a/lib/FindTests.js +++ b/lib/FindTests.js @@ -84,9 +84,10 @@ function resolveCliArgGlob( nodir: false, mark: true, }) - .flatMap((filePath) => - filePath.endsWith('/') ? findAllElmFilesInDir(filePath) : filePath - ); + .flatMap((filePath) => { + console.log('### filePath', filePath); + return filePath.endsWith('/') ? findAllElmFilesInDir(filePath) : filePath; + }); } // Recursively search for *.elm files. From 1084d62d8d25bb602ece2cb63e280a666f45b356 Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Sun, 16 Feb 2025 00:06:50 +0100 Subject: [PATCH 4/6] Try it with glob 8 --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e72889b3..c30e64a3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,7 +51,6 @@ jobs: NO_ELM_TOOLING_INSTALL: 1 - name: install glob 8 - if: steps.cache-node_modules.outputs.cache-hit != 'true' && (matrix.node-version == '12.x' || matrix.node-version == '14.x') run: npm install glob@8 - name: install mocha 9 From 830ccef2adf743c058e7e5b5cfeaaa782691622b Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Sun, 16 Feb 2025 00:08:36 +0100 Subject: [PATCH 5/6] Comment out glob 8 workaround to see what happens to Windows tests --- lib/FindTests.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/FindTests.js b/lib/FindTests.js index 518127f6..4fdaecef 100644 --- a/lib/FindTests.js +++ b/lib/FindTests.js @@ -71,7 +71,7 @@ function resolveCliArgGlob( // https://github.com/isaacs/minimatch/commit/9104d8d175bdd8843338103be1401f80774d2a10#diff-f41746899d033115e03bebe4fbde76acf2de4bf261bfb221744808f4c8a286cf const pattern = process.platform === 'win32' - ? globRelativeToProjectRoot.replace(/\\/g, '/') + ? globRelativeToProjectRoot //.replace(/\\/g, '/') : globRelativeToProjectRoot; return glob From 86ffdf1a68efab599d5e9454daba347cbce22926 Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Sun, 16 Feb 2025 00:11:37 +0100 Subject: [PATCH 6/6] Try all tests --- tests/flags.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tests/flags.js b/tests/flags.js index d6f94804..1d58073c 100644 --- a/tests/flags.js +++ b/tests/flags.js @@ -705,15 +705,12 @@ describe('flags', () => { assert.strictEqual(runResult.status, 0); }).timeout(60000); - it.only( - 'Should find all Elm files inside the directory that a glob resolves to', - () => { - // This is nice if two globs accidentally intersect. - const runResult = execElmTest(['tests/Pass*']); - console.log(runResult); - assert.strictEqual(runResult.status, 0); - } - ).timeout(60000); + it('Should find all Elm files inside the directory that a glob resolves to', () => { + // This is nice if two globs accidentally intersect. + const runResult = execElmTest(['tests/Pass*']); + console.log(runResult); + assert.strictEqual(runResult.status, 0); + }).timeout(60000); }); describe('unknown flags', () => {