Skip to content

Commit

Permalink
Test: Devtool workspace scanning
Browse files Browse the repository at this point in the history
  • Loading branch information
deribaucourt committed Dec 15, 2023
1 parent b765018 commit ac1081c
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
32 changes: 31 additions & 1 deletion client/src/__tests__/unit-tests/driver/scanner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,23 @@ describe('BitBakeProjectScanner', () => {
bitBakeProjectScanner.onChange.on(('scanReady'), () => {
DoneCallback()
})
void bitBakeProjectScanner.rescanProject()
bitBakeProjectScanner.bitbakeDriver.spawnBitbakeProcess('devtool modify busybox').then((child) => {
child.on('close', () => {
void bitBakeProjectScanner.rescanProject()
})
}, (error) => {
throw error
})
}, 300000)

afterAll((done) => {
bitBakeProjectScanner.bitbakeDriver.spawnBitbakeProcess('devtool reset busybox').then((child) => {
child.on('close', () => {
done()
})
}, (error) => {
throw error
})
}, 300000)

it('can get a list of layers', async () => {
Expand Down Expand Up @@ -86,4 +102,18 @@ describe('BitBakeProjectScanner', () => {
])
)
})

it('can get a list of devtool workspaces', async () => {
const devtoolWorkspaces = bitBakeProjectScanner.scanResult._workspaces
expect(devtoolWorkspaces.length).toBeGreaterThan(0)
expect(devtoolWorkspaces).toEqual(
expect.arrayContaining([
expect.objectContaining(
{
name: 'busybox'
}
)
])
)
})
})
2 changes: 1 addition & 1 deletion integration-tests/src/tests/bitbake-commands.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ suite('Bitbake Commands Test Suite', () => {
const files = await vscode.workspace.findFiles('build/workspace/sources/busybox/README')
return files.length === 1
})
})
}).timeout(300000)
})
2 changes: 1 addition & 1 deletion integration-tests/src/tests/bitbake-parse.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ suite('Bitbake Parsing Test Suite', () => {
let buildFolder: vscode.Uri

suiteSetup(async function (this: Mocha.Context) {
this.timeout(100000)
this.timeout(300000)
await assertWorkspaceWillBeOpen()
workspaceURI = (vscode.workspace.workspaceFolders as vscode.WorkspaceFolder[])[0].uri
buildFolder = vscode.Uri.joinPath(workspaceURI, 'build')
Expand Down

0 comments on commit ac1081c

Please sign in to comment.