You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by ar...@apache.org on 2024/01/25 01:04:04 UTC

(daffodil-vscode) branch main updated: Make CI more similar to (failing) nightly builds.

This is an automated email from the ASF dual-hosted git repository.

arosien pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/daffodil-vscode.git


The following commit(s) were added to refs/heads/main by this push:
     new 9cb1cef  Make CI more similar to (failing) nightly builds.
9cb1cef is described below

commit 9cb1cefee6f911660519123b4ca6c9332862f877
Author: Adam Rosien <ad...@rosien.net>
AuthorDate: Mon Jan 22 12:26:47 2024 -0800

    Make CI more similar to (failing) nightly builds.
    
    Nightly uses `vscode: [ 'stable', 'insiders' ]`, whereas CI doesn't specify the vscode version, which defaults to the `package.json` vscode engine version, currently set to `^1.67.2`, which I'm not sure what it gets resolved to.
    
    However, let's make the builds as similar as possible to provoke the same failures in CI as nightly.
    
    The actual fix: avoid deleting debugger backend, it is not needed since the build cleans the extraction directory.
---
 .github/workflows/CI.yml                 |  3 +++
 src/daffodilDebugger/utils.ts            | 11 +++++++----
 src/tests/suite/daffodilDebugger.test.ts | 17 ++++-------------
 3 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml
index d011ac0..423b309 100644
--- a/.github/workflows/CI.yml
+++ b/.github/workflows/CI.yml
@@ -133,11 +133,14 @@ jobs:
         java_version: [ 8, 11, 17 ]
         os: [ macos-11, ubuntu-20.04, windows-2019 ]
         node: [ '16', '18' ]
+        vscode: [ 'stable' ]
       fail-fast: false  # don't immediately fail all other jobs if a single job fails
     runs-on: ${{ matrix.os }}
     defaults:
       run:
         shell: bash
+    env:
+      DAFFODIL_TEST_VSCODE_VERSION: ${{ matrix.vscode }}
     steps:
       ############################################################
       # Setup
diff --git a/src/daffodilDebugger/utils.ts b/src/daffodilDebugger/utils.ts
index 7eed960..5e2a90f 100644
--- a/src/daffodilDebugger/utils.ts
+++ b/src/daffodilDebugger/utils.ts
@@ -124,9 +124,12 @@ function latestJdk(jdkHomes: IJavaHomeInfo[]): IJavaHomeInfo | undefined {
 
 // Function for stopping debugging
 export async function stopDebugging() {
-  vscode.debug.stopDebugging()
-  deactivate()
-  vscode.window.activeTerminal?.processId.then(async (id) => {
-    await stopDebugger(id)
+  vscode.debug.stopDebugging().then(async () => {
+    deactivate()
+    for (const t of vscode.window.terminals) {
+      await t.processId?.then(async (id) => {
+        await stopDebugger(id)
+      })
+    }
   })
 }
diff --git a/src/tests/suite/daffodilDebugger.test.ts b/src/tests/suite/daffodilDebugger.test.ts
index 28bce50..944f818 100644
--- a/src/tests/suite/daffodilDebugger.test.ts
+++ b/src/tests/suite/daffodilDebugger.test.ts
@@ -21,23 +21,13 @@ import * as path from 'path'
 import * as fs from 'fs'
 import { PROJECT_ROOT, PACKAGE_PATH, TEST_SCHEMA } from './common'
 import { getConfig, killProcess } from '../../utils'
-import {
-  daffodilArtifact,
-  daffodilVersion,
-  runDebugger,
-  stopDebugging,
-} from '../../daffodilDebugger'
+import { runDebugger, stopDebugging } from '../../daffodilDebugger'
 import { before, after } from 'mocha'
 import { DFDLDebugger } from '../../classes/dfdlDebugger'
 import { DataEditorConfig } from '../../classes/dataEditor'
 
 // Not using the debug adapter like adapter.test.ts as it will not fully connect the debugger
 suite('Daffodil Debugger', () => {
-  const dfdlVersion = daffodilVersion(PACKAGE_PATH)
-  const artifact = daffodilArtifact(dfdlVersion)
-
-  const EXTRACTED_FOLDER = path.join(PROJECT_ROOT, artifact.name)
-
   // debugger options
   const DATA = path.join(PROJECT_ROOT, 'src/tests/data/test.txt')
   const XML_INFOSET_PATH = path.join(PROJECT_ROOT, 'testinfoset.xml')
@@ -101,9 +91,10 @@ suite('Daffodil Debugger', () => {
   after(async () => {
     await stopDebugging()
     for (const d of debuggers) {
-      await d.processId?.then(killProcess)
+      const pid = await d.processId
+      await killProcess(pid)
     }
-    fs.rmSync(EXTRACTED_FOLDER, { recursive: true })
+    // No need to deleted the debugging server because upon re-run, webpack cleans and re-extracts it.
     if (fs.existsSync(XML_INFOSET_PATH)) fs.rmSync(XML_INFOSET_PATH)
     if (fs.existsSync(JSON_INFOSET_PATH)) fs.rmSync(JSON_INFOSET_PATH)
     dfdlDebuggers.forEach((dfdlDebugger) => {