Skip to content

Commit

Permalink
Merge pull request #2334 from codefori/fix/encodingissuewith284
Browse files Browse the repository at this point in the history
Add encoding tests for CCSID handling
  • Loading branch information
worksofliam authored Nov 26, 2024
2 parents b13e390 + 2af3700 commit aa171eb
Show file tree
Hide file tree
Showing 29 changed files with 1,521 additions and 653 deletions.
33 changes: 26 additions & 7 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ jobs:
release:
name: Validation
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'build')
steps:
- name: Use Node.js 20
uses: actions/setup-node@v3
Expand All @@ -15,8 +14,10 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- run: npm install
- run: npm run lint
- run: npm ci

- name: Build types
run: npm run typings

- run: npm install -g @vscode/vsce
- name: Create build
Expand All @@ -27,17 +28,35 @@ jobs:
with:
name: code-for-ibmi-pr-build
path: ./*.vsix


- name: Find Comment
uses: peter-evans/find-comment@v1
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: new build is available

- name: Post comment
if: steps.fc.outputs.comment-id == ''
uses: actions/github-script@v5
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '👋 A new build is available for this PR based on ${{ github.event.pull_request.head.sha }}.\n * [Download here.](https://github.com/codefori/vscode-ibmi/actions/runs/${{ github.run_id }})\n* [Read more about how to test](https://github.com/codefori/vscode-ibmi/blob/master/.github/pr_testing_template.md)'
body: '👋 A new build is available for this PR based on ${{ github.event.pull_request.head.sha }}.\n * [Download here.](https://github.com/codefori/vscode-ibmi/actions/runs/${{ github.run_id }})\n* [Read more about how to test](https://github.com/codefori/vscode-ibmi/blob/master/.github/pr_testing_template.md)'
})
- name: Build types
run: npm run typings
- name: Update comment
if: steps.fc.outputs.comment-id != ''
uses: peter-evans/create-or-update-comment@v1
with:
edit-mode: replace
comment-id: ${{ steps.fc.outputs.comment-id }}
body: |
👋 A new build is available for this PR based on ${{ github.event.pull_request.head.sha }}.
* [Download here.](https://github.com/codefori/vscode-ibmi/actions/runs/${{ github.run_id }})
* [Read more about how to test](https://github.com/codefori/vscode-ibmi/blob/master/.github/pr_testing_template.md)
38 changes: 36 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,41 @@
"sourceMaps": true,
"preLaunchTask": "${defaultBuildTask}",
"env": {
"testing": "true"
"base_testing": "true"
}
},
{
"name": "Extension Tests (All simultaneously)",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"sourceMaps": true,
"preLaunchTask": "${defaultBuildTask}",
"env": {
"base_testing": "true",
"simultaneous": "true"
}
},
{
"name": "Extension Tests (Encoding suite)",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"sourceMaps": true,
"preLaunchTask": "${defaultBuildTask}",
"env": {
"base_testing": "true",
"specific": "encoding"
}
},
{
Expand All @@ -47,7 +81,7 @@
"sourceMaps": true,
"preLaunchTask": "${defaultBuildTask}",
"env": {
"testing": "true",
"base_testing": "true",
"individual": "true"
}
},
Expand Down
48 changes: 25 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 21 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"icon": "icon.png",
"displayName": "Code for IBM i",
"description": "Maintain your RPGLE, CL, COBOL, C/CPP on IBM i right from Visual Studio Code.",
"version": "2.13.10-dev.0",
"version": "2.13.19-dev.0",
"keywords": [
"ibmi",
"rpgle",
Expand Down Expand Up @@ -1692,6 +1692,13 @@
"category": "IBM i",
"icon": "$(keyboard)",
"enablement": "code-for-ibmi:connected"
},
{
"command": "code-for-ibmi.testing.connectWithFixture",
"title": "Connect with Fixture",
"category": "IBM i",
"icon": "$(debug)",
"enablement": "code-for-ibmi:testing"
}
],
"keybindings": [
Expand Down Expand Up @@ -1938,6 +1945,10 @@
}
],
"commandPalette": [
{
"command": "code-for-ibmi.testing.connectWithFixture",
"when": "never"
},
{
"command": "code-for-ibmi.userLibraryList.enable",
"when": "never"
Expand Down Expand Up @@ -2503,6 +2514,11 @@
"when": "view == connectionBrowser && !listMultiSelection && viewItem == server",
"group": "inline"
},
{
"command": "code-for-ibmi.testing.connectWithFixture",
"when": "view == connectionBrowser && code-for-ibmi:testing && !listMultiSelection && viewItem == server",
"group": "inline"
},
{
"command": "code-for-ibmi.connectToAndReload",
"when": "view == connectionBrowser && !listMultiSelection && viewItem == server",
Expand Down Expand Up @@ -2949,7 +2965,7 @@
"devDependencies": {
"@types/adm-zip": "^0.5.5",
"@types/glob": "^7.1.3",
"@types/node": "^12.20.55",
"@types/node": "^18.0.0",
"@types/source-map-support": "^0.5.6",
"@types/tar": "^6.1.4",
"@types/tmp": "^0.2.3",
Expand All @@ -2969,14 +2985,14 @@
"@bendera/vscode-webview-elements": "^0.12.0",
"@ibm/ibmi-eventf-parser": "^1.0.2",
"adm-zip": "^0.5.14",
"crc-32": "https://cdn.sheetjs.com/crc-32-latest/crc-32-latest.tgz",
"csv": "^6.2.1",
"escape-string-regexp": "^5.0.0",
"ignore": "^5.1.9",
"node-ssh": "^13.1.0",
"tar": "^6.2.1",
"tmp": "^0.2.1",
"vscode-diff": "^2.0.2",
"crc-32": "https://cdn.sheetjs.com/crc-32-latest/crc-32-latest.tgz",
"escape-string-regexp": "^5.0.0"
"vscode-diff": "^2.0.2"
},
"extensionDependencies": [
"barrettotte.ibmi-languages",
Expand Down
8 changes: 4 additions & 4 deletions src/api/CompileTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ export namespace CompileTools {
command: [
...options.noLibList? [] : buildLiblistCommands(connection, ileSetup),
...commands.map(command =>
`${`system ${GlobalConfiguration.get(`logCompileOutput`) ? `` : `-s`} "${command.replace(/[$]/g, `\\$&`)}"`}`,
`${`system "${IBMi.escapeForShell(command)}"`}`,
)
].join(` && `),
directory: cwd,
Expand Down Expand Up @@ -817,9 +817,9 @@ export namespace CompileTools {

function buildLiblistCommands(connection: IBMi, config: ILELibrarySettings): string[] {
return [
`liblist -d ${Tools.sanitizeLibraryNames(connection.defaultUserLibraries).join(` `)}`,
`liblist -c ${Tools.sanitizeLibraryNames([config.currentLibrary])}`,
`liblist -a ${Tools.sanitizeLibraryNames(buildLibraryList(config)).join(` `)}`
`liblist -d ${IBMi.escapeForShell(Tools.sanitizeObjNamesForPase(connection.defaultUserLibraries).join(` `))}`,
`liblist -c ${IBMi.escapeForShell(Tools.sanitizeObjNamesForPase([config.currentLibrary])[0])}`,
`liblist -a ${IBMi.escapeForShell(Tools.sanitizeObjNamesForPase(buildLibraryList(config)).join(` `))}`
];
}
}
Loading

0 comments on commit aa171eb

Please sign in to comment.