Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run test dir as folder type in ablunit.json config #199

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"warn", {
"vars": "all",
"args": "none",
"argsIgnorePattern": "^_",
"ignoreRestSiblings": false
}
],
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,5 @@ test_projects/proj7_load_performance/src/classes
# Dowloaded test files
test_projects/proj7_load_performance/v*.tar.gz
test_projects/proj7_load_performance/src/ADE-*

.worktrees/
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"files.exclude": {
"./dist/**": true,
// "**/*{.js,.test.js}": { "when": "$(basename).ts" }
"**/.worktrees": true
},
"files.watcherExclude": {
".git/objects": true,
Expand Down
59 changes: 1 addition & 58 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,3 @@
# 🥳 [1.0.0](https://github.com/kenherring/ablunit-test-runner/releases/tag/1.0.0) - 2024-10-24

* Finally, a non-preview release!
* Various fixes and updates
* Improved test run output, including call stacks with test failure messages

**Full Changelog**: [0.2.0...1.0.0](https://github.com/kenherring/ablunit-test-runner/compare/0.2.17...1.0.0)

<!--
# [0.2.17](https://github.com/kenherring/ablunit-test-runner/releases/tag/0.2.17) - 2024-10-14 (pre-release)

* add `timeout` key to test config (#217)
* Unskip tests and ensure they pass (#216)
* Read `openedge-project.json` profile by name consistently (#212)

**Full Changelog**: [0.2.15...0.2.17](https://github.com/kenherring/ablunit-test-runner/compare/0.2.15...0.2.17)

# [0.2.15](https://github.com/kenherring/ablunit-test-runner/releases/tag/0.2.15) - 2024-10-08 (pre-release)

* Use `TestMesssage.stackTrace` instead of custom display (#213)
* Minor script and test cleanup (#178)

**Full Changelog**: [0.2.13...0.2.15](https://github.com/kenherring/ablunit-test-runner/compare/0.2.13...0.2.15)

# [0.2.13](https://github.com/kenherring/ablunit-test-runner/releases/tag/0.2.13) - 2024-10-03 (pre-release)

* Unskip proj7 tests for large projects (#194)

**Full Changelog**: [0.2.11...0.2.13](https://github.com/kenherring/ablunit-test-runner/compare/0.2.11...0.2.13)

# [0.2.11](https://github.com/kenherring/ablunit-test-runner/releases/tag/0.2.11) - 2024-09-30 (pre-release)

* Upload artifact to gh release automatically (#209)
* Restore watcher for file create, update, delete (#207)
* Add snippets for the `@BeforeAll`, `@BeforeEach`, `@AfterEach`, `@AfrerAll` annotations (#205)
* Use vsce as a development dependency instead of globally installing (#206)

**Full Changelog**: [0.2.7...0.2.11](https://github.com/kenherring/ablunit-test-runner/compare/0.2.7...0.2.11)

# [0.2.7](https://github.com/kenherring/ablunit-test-runner/releases/tag/0.2.7) - 2024-09-24 (pre-release)

This is a release candidate for 1.0.0. There is one open PR ([#194](https://github.com/kenherring/ablunit-test-runner/pull/194)), but if there are other issues reported they may be addressed as well.

* Show incremental test results during test run (#195)
* Chore: fix emoji use in issue templates (#197)
* Add OE 12.8.4 test target (#196)
* Fix coverage reporting on first line and line after executed line (#193)
* Improve test name parsing when using `#` character (#190)
* npm update (#192)
* Add xref options to test profile configuration (#191)
* Use `charset` and `extraParameters` from `openedge-project.json` (#189)
* Replace `${DLC}` in executed command and generated ini file (#188)

**Full Changelog**: [0.2.5...0.2.7](https://github.com/kenherring/ablunit-test-runner/compare/0.2.5...0.2.7)

# [0.2.5](https://github.com/kenherring/ablunit-test-runner/releases/tag/0.2.5) - 2024-09-03 (pre-release)

* Update test parsing to find skipped/ignored tests (#184)
Expand Down Expand Up @@ -105,9 +50,7 @@ This is a release candidate for 1.0.0. There is one open PR ([#194](https://git

**Full Changelog**: [0.2.0...0.2.1](https://github.com/kenherring/ablunit-test-runner/compare/0.2.0...0.2.1)

-->

# 🥇 [0.2.0](https://github.com/kenherring/ablunit-test-runner/releases/tag/0.2.0) - 2024-01-22
# [0.2.0](https://github.com/kenherring/ablunit-test-runner/releases/tag/0.2.0) - 2024-01-22

Initial release to marketplace

Expand Down
14 changes: 7 additions & 7 deletions esbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const watch = process.argv.includes('--watch')

let logtag = '[build]'
if (watch) {
logtag = '[watch]'
logtag = '[watch]'
}

async function main () {
Expand All @@ -26,7 +26,7 @@ async function main () {
]
})
if (watch) {
console.log(logtag + ' watching...')
console.log(logtag + ' watching...')
await ctx.watch()
} else {
await ctx.rebuild()
Expand All @@ -47,11 +47,11 @@ const esbuildProblemMatcherPlugin = {
build.onEnd(result => {
result.errors.forEach(({ text, location }) => {
console.error(`✘ [ERROR] ${text}`)
if (location) {
console.error(` ${location.file}:${location.line}:${location.column}:`)
} else {
console.error(' location unknown')
}
if (location) {
console.error(` ${location.file}:${location.line}:${location.column}:`)
} else {
console.error(' location unknown')
}
})
console.log(logtag + ' build finished')
})
Expand Down
17 changes: 14 additions & 3 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
"@types/mocha": "^9.1.1",
"@types/node": "20.X",
"@types/vscode": "^1.94.0",
"@types/xml2js": "^0.4.14",
"@typescript-eslint/eslint-plugin": "^8.8.1",
"@typescript-eslint/parser": "^8.8.1",
"@vscode/test-cli": "^0.0.10",
Expand Down
20 changes: 10 additions & 10 deletions src/ABLPromsgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export class ABLPromsgs {
async loadPromsgFile (msgfile: Uri) {
const lines = await workspace.fs.readFile(msgfile).then((buffer) => {
return Buffer.from(buffer).toString('utf8').split('\n')
}, (err) => {
throw new Error('Cannot read promsgs file \'' + msgfile + '\', err=' + err)
}, (e: unknown) => {
throw new Error('Cannot read promsgs file \'' + msgfile + '\', err=' + e)
})


Expand Down Expand Up @@ -93,10 +93,10 @@ export class ABLPromsgs {
}).then(() => {
log.info('promsgs loaded from DLC')
return
}, (err) => {
throw new Error('Cannot read promsgs directory \'' + promsgDir + '\', err=' + err)
}, (e: unknown) => {
throw new Error('Cannot read promsgs directory \'' + promsgDir + '\', err=' + e)
})
// }, (err) => {
// }, (e: unknown) => {
// log.info('Cannot find DLC directory \'' + this.dlc.uri.fsPath + '"')
// throw new Error('Cannot find DLC directory \'' + this.dlc.uri.fsPath + '", err=' + err)
// })
Expand All @@ -107,8 +107,8 @@ export class ABLPromsgs {
await workspace.fs.readFile(cacheUri).then((buffer) => {
this.promsgs = JSON.parse(Buffer.from(buffer).toString('utf8')) as IPromsg[]
return
}, (err) => {
throw new Error('Cannot read promsgs file \'' + cacheUri.fsPath + '\', err=' + err)
}, (e: unknown) => {
throw new Error('Cannot read promsgs file \'' + cacheUri.fsPath + '\', err=' + e)
})
}

Expand All @@ -121,8 +121,8 @@ export class ABLPromsgs {
return workspace.fs.writeFile(cacheUri, Buffer.from(JSON.stringify(this.promsgs, null, 2))).then(() => {
log.info('saved promsgs cache successfully \'' + cacheUri.fsPath + '\'')
return
}, (err) => {
throw new Error('error writing promsgs cache file: ' + err)
}, (e: unknown) => {
throw new Error('error writing promsgs cache file: ' + e)
})
}

Expand Down Expand Up @@ -152,7 +152,7 @@ export function getPromsgText (text: string) {
}
})
return stackString
} catch (e) {
} catch (_e) {
return text
}
}
31 changes: 30 additions & 1 deletion src/ABLPropath.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Uri, workspace, WorkspaceFolder } from 'vscode'
import { IProjectJson } from './parse/OpenedgeProjectParser'
import { getOpenEdgeProfileConfig, IBuildPathEntry, IProjectJson } from './parse/OpenedgeProjectParser'
import { isRelativePath } from './ABLUnitCommon'
import { log } from './ChannelLogger'

Expand Down Expand Up @@ -44,6 +44,35 @@ export class PropathParser {
this.buildmap = new Map()
}

setPropathFromProjectJson () {
if (!workspace.workspaceFolders) {
return
}
const conf = getOpenEdgeProfileConfig(this.workspaceFolder.uri)

if (conf && conf.buildPath.length > 0) {
const pathObj: IBuildPathEntry[] = []
for (const e of conf.buildPath) {
pathObj.push({
path: e.path,
type: e.type.toLowerCase(),
buildDir: e.buildDir,
xrefDir: e.xrefDir
})
}
this.setPropath({ propathEntry: pathObj })
} else {
this.setPropath({ propathEntry: [{
path: '.',
type: 'source',
buildDir: '.',
xrefDir: '.'
}]})
}

log.info('set propath=\'' + this.toString() + '\'')
}

setPropath (importedPropath: IProjectJson) {
log.debug('importedPropath.length=' + importedPropath.propathEntry.length)

Expand Down
Loading