25 Commits

Author SHA1 Message Date
Iain Sproat ff56aeb1c1 chore(error): improve error handling to include message from cause of error (#307)
* Refresh yarn.lock and node_modules to fix yarn test --coverage
- based on https://github.com/vitest-dev/vitest/issues/4668#issuecomment-1840998029

* HttpError message included in the Error message
2024-01-09 19:58:53 +00:00
Iain Sproat c5d080d60d Refresh yarn.lock and node_modules to fix yarn test --coverage (#306)
- based on https://github.com/vitest-dev/vitest/issues/4668#issuecomment-1840998029
2024-01-09 16:12:14 +00:00
Iain Sproat d5c4844583 docs(README): adds descriptions for all inputs (#305) 2024-01-09 16:00:45 +00:00
dependabot[bot] 2a971c6f16 build(deps-dev): bump eslint-plugin-import from 2.29.0 to 2.29.1 (#294)
Bumps [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import) from 2.29.0 to 2.29.1.
- [Release notes](https://github.com/import-js/eslint-plugin-import/releases)
- [Changelog](https://github.com/import-js/eslint-plugin-import/blob/main/CHANGELOG.md)
- [Commits](https://github.com/import-js/eslint-plugin-import/compare/v2.29.0...v2.29.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-import
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-09 10:31:27 +00:00
dependabot[bot] 67d44ba23f build(deps-dev): bump @typescript-eslint/eslint-plugin (#304)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.14.0 to 6.18.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.18.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-09 10:30:58 +00:00
dependabot[bot] 7fdec8e7fc build(deps-dev): bump eslint from 8.55.0 to 8.56.0 (#296)
Bumps [eslint](https://github.com/eslint/eslint) from 8.55.0 to 8.56.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.55.0...v8.56.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-09 10:23:24 +00:00
dependabot[bot] 5493d6f271 build(deps-dev): bump eslint-plugin-vitest from 0.3.17 to 0.3.20 (#299)
Bumps [eslint-plugin-vitest](https://github.com/veritem/eslint-plugin-vitest) from 0.3.17 to 0.3.20.
- [Release notes](https://github.com/veritem/eslint-plugin-vitest/releases)
- [Commits](https://github.com/veritem/eslint-plugin-vitest/compare/v0.3.17...v0.3.20)

---
updated-dependencies:
- dependency-name: eslint-plugin-vitest
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-09 10:22:51 +00:00
dependabot[bot] 775a02139f build(deps-dev): bump vite from 5.0.9 to 5.0.11 (#302)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.0.9 to 5.0.11.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.0.11/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-09 10:21:47 +00:00
dependabot[bot] e68d24406e build(deps-dev): bump @types/node from 18.19.2 to 18.19.3 (#291)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.19.2 to 18.19.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-14 17:46:44 +00:00
dependabot[bot] e87630d731 build(deps-dev): bump vite from 5.0.8 to 5.0.9 (#293)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.0.8 to 5.0.9.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.0.9/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-14 17:46:15 +00:00
dependabot[bot] 5c55ca7ea8 build(deps-dev): bump eslint-plugin-vitest from 0.3.9 to 0.3.17 (#292)
Bumps [eslint-plugin-vitest](https://github.com/veritem/eslint-plugin-vitest) from 0.3.9 to 0.3.17.
- [Release notes](https://github.com/veritem/eslint-plugin-vitest/releases)
- [Commits](https://github.com/veritem/eslint-plugin-vitest/compare/v0.3.9...v0.3.17)

---
updated-dependencies:
- dependency-name: eslint-plugin-vitest
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-14 17:45:56 +00:00
dependabot[bot] 970e0f066b build(deps-dev): bump vite from 4.5.1 to 5.0.8 (#287)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.5.1 to 5.0.8.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.0.8/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-12 17:36:38 +00:00
dependabot[bot] df92d9c409 build(deps-dev): bump @vercel/ncc from 0.36.1 to 0.38.1 (#267)
* build(deps-dev): bump @vercel/ncc from 0.36.1 to 0.38.1

Bumps [@vercel/ncc](https://github.com/vercel/ncc) from 0.36.1 to 0.38.1.
- [Release notes](https://github.com/vercel/ncc/releases)
- [Commits](https://github.com/vercel/ncc/compare/0.36.1...0.38.1)

---
updated-dependencies:
- dependency-name: "@vercel/ncc"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore(package): repackage using new version of ncc

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Iain Sproat <68657+iainsproat@users.noreply.github.com>
2023-12-12 17:36:16 +00:00
dependabot[bot] f2adde5085 build(deps-dev): bump @typescript-eslint/eslint-plugin (#286)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 6.10.0 to 6.14.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.14.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-12 16:55:40 +00:00
dependabot[bot] 8ea1a1bc8e build(deps-dev): bump vitest from 0.34.6 to 1.0.4 (#289)
Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 0.34.6 to 1.0.4.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v1.0.4/packages/vitest)

---
updated-dependencies:
- dependency-name: vitest
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-12 16:55:11 +00:00
dependabot[bot] a13b1e49e5 build(deps-dev): bump @typescript-eslint/parser from 6.10.0 to 6.14.0 (#285)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 6.10.0 to 6.14.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v6.14.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-12 16:46:18 +00:00
dependabot[bot] 6b66e1479d build(deps-dev): bump msw from 2.0.10 to 2.0.11 (#288)
Bumps [msw](https://github.com/mswjs/msw) from 2.0.10 to 2.0.11.
- [Release notes](https://github.com/mswjs/msw/releases)
- [Changelog](https://github.com/mswjs/msw/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mswjs/msw/compare/v2.0.10...v2.0.11)

---
updated-dependencies:
- dependency-name: msw
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-12 16:45:54 +00:00
dependabot[bot] ade5dbf5cd build(deps-dev): bump eslint from 8.53.0 to 8.55.0 (#284)
Bumps [eslint](https://github.com/eslint/eslint) from 8.53.0 to 8.55.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.53.0...v8.55.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-12 16:39:11 +00:00
dependabot[bot] 0a39db82dc build(deps-dev): bump prettier from 3.0.3 to 3.1.1 (#282)
Bumps [prettier](https://github.com/prettier/prettier) from 3.0.3 to 3.1.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.0.3...3.1.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-11 17:02:02 +00:00
dependabot[bot] be8fb87593 build(deps-dev): bump @vitest/coverage-istanbul from 0.34.6 to 1.0.4 (#283)
Bumps [@vitest/coverage-istanbul](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-istanbul) from 0.34.6 to 1.0.4.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v1.0.4/packages/coverage-istanbul)

---
updated-dependencies:
- dependency-name: "@vitest/coverage-istanbul"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-11 16:59:56 +00:00
dependabot[bot] e4a948b322 build(deps-dev): bump @types/js-yaml from 4.0.5 to 4.0.9 (#265)
Bumps [@types/js-yaml](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/js-yaml) from 4.0.5 to 4.0.9.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/js-yaml)

---
updated-dependencies:
- dependency-name: "@types/js-yaml"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-11 16:55:30 +00:00
dependabot[bot] 5eefa5a400 build(deps-dev): bump msw from 2.0.5 to 2.0.10 (#278)
Bumps [msw](https://github.com/mswjs/msw) from 2.0.5 to 2.0.10.
- [Release notes](https://github.com/mswjs/msw/releases)
- [Changelog](https://github.com/mswjs/msw/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mswjs/msw/compare/v2.0.5...v2.0.10)

---
updated-dependencies:
- dependency-name: msw
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-11 16:54:50 +00:00
dependabot[bot] 374d08671f build(deps-dev): bump @types/node from 18.18.8 to 18.19.2 (#277)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.18.8 to 18.19.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-06 17:04:30 +00:00
dependabot[bot] 45de2b5144 build(deps-dev): bump vite from 4.5.0 to 4.5.1 (#279)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.5.0 to 4.5.1.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v4.5.1/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.5.1/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-06 17:03:56 +00:00
Iain Sproat 94cd180e64 Update README to match actual intent of release tag (#262) 2023-11-12 17:31:54 +00:00
8 changed files with 25661 additions and 2508 deletions
+9 -1
View File
@@ -37,9 +37,17 @@ Associates this new version with the given ID of a Speckle Function.
Your Speckle Token must have write permissions for the Speckle Function with this ID, otherwise the publish will fail.
#### `speckle_function_input_schema_file_path`
*Optional.* The path to the JSON Schema file that describes the input schema for this version of the Speckle Function. This file is used to define the input form that will be presented to users when they compose an Automation based on this Function. If not provided, no input form will be presented to users.
#### `speckle_function_command`
The command to run when this version of the Speckle Function is invoked. This command must be a valid command for the Docker image that contains the Speckle Function. This command must be a single string.
#### `speckle_function_release_tag`
The release tag for this version of the Speckle Function. This is intended to provide a more human understandable name for this version, and we recommend using the [Semver](https://semver.org) naming conventions. The name must conform to the following:
The release tag for this version of the Speckle Function. This is intended to provide a more human understandable name for this version, and we recommend using the Git SHA of the commit used to generate this function version. The name must conform to the following:
- A minimum of 1 character is required.
- A maximum of 128 characters are permitted.
+1 -1
View File
File diff suppressed because one or more lines are too long
Generated Vendored
+24406 -235
View File
File diff suppressed because one or more lines are too long
Generated Vendored
+1 -1
View File
File diff suppressed because one or more lines are too long
+13 -13
View File
@@ -29,26 +29,26 @@
"zod": "^3.22.3"
},
"devDependencies": {
"@types/js-yaml": "^4.0.5",
"@types/node": "^18.18.8",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"@vercel/ncc": "^0.36.1",
"@vitest/coverage-istanbul": "^0.34.6",
"eslint": "^8.53.0",
"@types/js-yaml": "^4.0.9",
"@types/node": "^18.19.3",
"@typescript-eslint/eslint-plugin": "^6.18.1",
"@typescript-eslint/parser": "^6.14.0",
"@vercel/ncc": "^0.38.1",
"@vitest/coverage-istanbul": "^1.0.4",
"eslint": "^8.56.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-filenames": "latest",
"eslint-plugin-github": "^4.10.1",
"eslint-plugin-i18n-text": "^1.0.1",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-no-only-tests": "^3.1.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-vitest": "^0.3.9",
"msw": "^2.0.5",
"prettier": "^3.0.3",
"eslint-plugin-vitest": "^0.3.20",
"msw": "^2.0.11",
"prettier": "^3.1.1",
"typescript": "^5.2.2",
"vite": "^4.5.0",
"vitest": "^0.34.6"
"vite": "^5.0.11",
"vitest": "^1.0.4"
}
}
+14 -3
View File
@@ -173,9 +173,20 @@ const registerNewVersionForTheSpeckleAutomateFunction = async (
if (parsedResult.success) return parsedResult.data
throw parsedResult.error
} catch (err) {
throw Error('Failed to register new function version to the automate server', {
cause: err
})
if (err instanceof Error) {
throw Error(
`Failed to register new function version to the automate server. ${err.message}`,
{
cause: err
}
)
}
throw Error(
`Failed to register new function version to the automate server. ${err}`,
{
cause: err
}
)
}
}
+78 -3
View File
@@ -20,6 +20,49 @@ describe('Register new version', () => {
let tmpDir: string
let countHappyPath = 0
let count500Errors = 0
let count422Errors = 0
const error422 = {
type: 'H3Error',
message: 'Body parsing failed',
stack: `Error: Body parsing failed
at createError...`,
statusCode: 422,
fatal: false,
unhandled: false,
statusMessage: 'Body parsing failed',
data: {
type: 'ZodError',
message:
'[\n {\n "code": "custom",\n "message": "Invalid JSON schema: strict mode: unknown keyword: \\"IAmInvalid\\"",\n "path": [\n "inputSchema"\n ]\n }\n]',
stack: {
ZodError: [
{
code: 'custom',
message: 'Invalid JSON schema: strict mode: unknown keyword: "IAmInvalid"',
path: ['inputSchema']
}
]
},
aggregateErrors: [
{
type: 'Object',
message: 'Invalid JSON schema: strict mode: unknown keyword: "IAmInvalid"',
stack: {},
code: 'custom',
path: ['inputSchema']
}
],
issues: [
{
code: 'custom',
message: 'Invalid JSON schema: strict mode: unknown keyword: "IAmInvalid"',
path: ['inputSchema']
}
],
name: 'ZodError'
}
}
const server = setupServer(
http.post(
@@ -44,15 +87,29 @@ describe('Register new version', () => {
return HttpResponse.error() // simulates a network error
}
),
http.post(
'http://myfakeautomate.speckle.internal/api/v1/functions/422_response/versions',
async ({ request }) => {
const parseResult = FunctionVersionRequestSchema.safeParse(await request.json())
expect(parseResult.success).to.be.true
count422Errors++
return HttpResponse.json(error422, {
status: 422
})
}
),
http.post(
'http://myfakeautomate.speckle.internal/api/v1/functions/500_response/versions',
async ({ request }) => {
const parseResult = FunctionVersionRequestSchema.safeParse(await request.json())
expect(parseResult.success).to.be.true
count500Errors++
return new HttpResponse(null, {
status: 500
})
return HttpResponse.json(
{},
{
status: 500
}
)
}
)
)
@@ -123,6 +180,24 @@ describe('Register new version', () => {
expect(count500Errors).to.toBeGreaterThan(1) // we expect the action to retry the request
count500Errors = 0
})
it('handles 422 responses', async () => {
writeFileSync(join(tmpDir, 'schema.json'), '{}')
vi.stubEnv('INPUT_SPECKLE_FUNCTION_ID', '422_response')
vi.stubEnv('INPUT_SPECKLE_TOKEN', '{token}')
vi.stubEnv('INPUT_SPECKLE_FUNCTION_COMMAND', 'echo "hello automate"')
vi.stubEnv('HOME', tmpDir) // the input schema file path is assumed to be relative to the home directory
vi.stubEnv('INPUT_SPECKLE_FUNCTION_INPUT_SCHEMA_FILE_PATH', './schema.json')
vi.stubEnv('INPUT_SPECKLE_FUNCTION_RELEASE_TAG', 'v1.0.0')
vi.stubEnv('INPUT_SPECKLE_AUTOMATE_URL', 'http://myfakeautomate.speckle.internal')
vi.stubEnv('GITHUB_SHA', 'commitSha')
vi.stubEnv('GITHUB_REF_TYPE', 'commit')
vi.stubEnv('GITHUB_REF_NAME', 'version')
await expect(run()).rejects.toThrow(
'Failed to register new function version to the automate server'
)
expect(count422Errors).to.eq(1) // we expect the action not to retry the request
count422Errors = 0 // reset the count after the test
})
it('errors if the token is empty', async () => {
writeFileSync(join(tmpDir, 'schema.json'), '{}')
vi.stubEnv('INPUT_SPECKLE_FUNCTION_ID', 'fake_function_id')
+1139 -2251
View File
File diff suppressed because it is too large Load Diff