Skip to content
Merged
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
51 changes: 51 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ jobs:
- name: Build
run: npm run build

- uses: actions/upload-artifact@v4
with:
name: build
path: dist

- name: Audit
run: npm audit

Expand All @@ -46,6 +51,29 @@ jobs:
- name: Test (Formatting)
run: npm run test:formatting

test_service:
name: Test (Service Client)
runs-on: ubuntu-latest
environment: QA
needs: build

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2

- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/

- name: Install dependencies
run: npm ci

- uses: actions/download-artifact@v4
with:
name: build

- name: Test (Service Client)
env:
ITP_API_URL: ${{ vars.ITP_API_URL }}
Expand All @@ -55,6 +83,29 @@ jobs:
ITP_MAILINATOR_API_KEY: ${{ secrets.ITP_MAILINATOR_API_KEY }}
run: npm run test:service

test_native:
name: Test (Native Client)
runs-on: ubuntu-latest
environment: QA
needs: build

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2

- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/

- name: Install dependencies
run: npm ci

- uses: actions/download-artifact@v4
with:
name: build

- name: Test (Native Client)
env:
ITP_API_URL: ${{ vars.ITP_API_URL }}
Expand Down
10 changes: 7 additions & 3 deletions integration-tests/itwin/list.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ const tests = () => describe('list', () => {
});

after(async () => {
await runCommand(`itwin delete --itwin-id ${testITwin1Child.id}`);
await runCommand(`itwin delete --itwin-id ${testITwin1.id}`);
await runCommand(`itwin delete --itwin-id ${testITwin2.id}`);
const deleteResult1 = await runCommand(`itwin delete --itwin-id ${testITwin1Child.id}`);
const deleteResult2 = await runCommand(`itwin delete --itwin-id ${testITwin1.id}`);
const deleteResult3 = await runCommand(`itwin delete --itwin-id ${testITwin2.id}`);

expect(deleteResult1.result).to.have.property('result', 'deleted');
expect(deleteResult2.result).to.have.property('result', 'deleted');
expect(deleteResult3.result).to.have.property('result', 'deleted');
})

it('should fail when provided bad subClass', async () => {
Expand Down
5 changes: 4 additions & 1 deletion integration-tests/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,10 @@ export const isNativeAuthAccessTokenCached = (): boolean => {
const getTokenPathByOS = () => {
switch (os.type()) {
case 'Linux': {
return `${os.homedir()}/.cache/itp/token.json`
const cachePath = `${os.homedir()}/.cache/itp`
if(!fs.existsSync(cachePath))
fs.mkdirSync(cachePath, {recursive: true})
return `${cachePath}/token.json`
}

case 'Windows_NT': {
Expand Down