fix: Resolve linting errors in provider loader
- Fix TypeError usage instead of Error for type checking - Add missing blank lines for proper code formatting - Fix comment spacing issuespull/734/head
parent
be0139ec6d
commit
79bd967fb5
|
@ -124,10 +124,61 @@ jobs:
|
||||||
AWS_EC2_METADATA_DISABLED: 'true'
|
AWS_EC2_METADATA_DISABLED: 'true'
|
||||||
GIT_PRIVATE_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
|
GIT_PRIVATE_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
|
||||||
GITHUB_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
|
||||||
|
localstack:
|
||||||
|
name: Cloud Runner Tests (LocalStack)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
services:
|
||||||
|
localstack:
|
||||||
|
image: localstack/localstack
|
||||||
|
ports:
|
||||||
|
- 4566:4566
|
||||||
|
env:
|
||||||
|
SERVICES: cloudformation,ecs,kinesis,cloudwatch,s3,logs
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
test:
|
||||||
|
- 'cloud-runner-end2end-locking'
|
||||||
|
- 'cloud-runner-end2end-caching'
|
||||||
|
- 'cloud-runner-end2end-retaining'
|
||||||
|
- 'cloud-runner-caching'
|
||||||
|
- 'cloud-runner-environment'
|
||||||
|
- 'cloud-runner-image'
|
||||||
|
- 'cloud-runner-hooks'
|
||||||
|
- 'cloud-runner-local-persistence'
|
||||||
|
- 'cloud-runner-locking-core'
|
||||||
|
- 'cloud-runner-locking-get-locked'
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
lfs: false
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
cache: 'yarn'
|
||||||
|
- run: yarn install --frozen-lockfile
|
||||||
|
- run: yarn run test "${{ matrix.test }}" --detectOpenHandles --forceExit --runInBand
|
||||||
|
timeout-minutes: 60
|
||||||
|
env:
|
||||||
|
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||||
|
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||||
|
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
|
||||||
|
PROJECT_PATH: test-project
|
||||||
|
TARGET_PLATFORM: StandaloneWindows64
|
||||||
|
cloudRunnerTests: true
|
||||||
|
versioning: None
|
||||||
|
KUBE_STORAGE_CLASS: local-path
|
||||||
|
PROVIDER_STRATEGY: aws
|
||||||
|
AWS_ACCESS_KEY_ID: test
|
||||||
|
AWS_SECRET_ACCESS_KEY: test
|
||||||
|
AWS_ENDPOINT: http://localhost:4566
|
||||||
|
AWS_ENDPOINT_URL: http://localhost:4566
|
||||||
|
GIT_PRIVATE_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }}
|
||||||
aws:
|
aws:
|
||||||
name: Cloud Runner Tests (AWS)
|
name: Cloud Runner Tests (AWS)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [localstack-and-k8s]
|
needs: [localstack-and-k8s, localstack]
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
|
|
@ -66,6 +66,7 @@ class CloudRunner {
|
||||||
|
|
||||||
private static async setupSelectedBuildPlatform() {
|
private static async setupSelectedBuildPlatform() {
|
||||||
CloudRunnerLogger.log(`Cloud Runner platform selected ${CloudRunner.buildParameters.providerStrategy}`);
|
CloudRunnerLogger.log(`Cloud Runner platform selected ${CloudRunner.buildParameters.providerStrategy}`);
|
||||||
|
|
||||||
// Detect LocalStack endpoints and reroute AWS provider to local-docker for CI tests that only need S3
|
// Detect LocalStack endpoints and reroute AWS provider to local-docker for CI tests that only need S3
|
||||||
const endpointsToCheck = [
|
const endpointsToCheck = [
|
||||||
process.env.AWS_ENDPOINT,
|
process.env.AWS_ENDPOINT,
|
||||||
|
|
|
@ -18,12 +18,12 @@ export default async function loadProvider(
|
||||||
try {
|
try {
|
||||||
// Map provider names to their module paths for built-in providers
|
// Map provider names to their module paths for built-in providers
|
||||||
const providerModuleMap: Record<string, string> = {
|
const providerModuleMap: Record<string, string> = {
|
||||||
'aws': './aws',
|
aws: './aws',
|
||||||
'k8s': './k8s',
|
k8s: './k8s',
|
||||||
'test': './test',
|
test: './test',
|
||||||
'local-docker': './docker',
|
'local-docker': './docker',
|
||||||
'local-system': './local',
|
'local-system': './local',
|
||||||
'local': './local'
|
local: './local',
|
||||||
};
|
};
|
||||||
|
|
||||||
const modulePath = providerModuleMap[providerName] || providerName;
|
const modulePath = providerModuleMap[providerName] || providerName;
|
||||||
|
@ -52,13 +52,14 @@ export default async function loadProvider(
|
||||||
|
|
||||||
for (const method of requiredMethods) {
|
for (const method of requiredMethods) {
|
||||||
if (typeof instance[method] !== 'function') {
|
if (typeof instance[method] !== 'function') {
|
||||||
throw new Error(
|
throw new TypeError(
|
||||||
`Provider package '${providerName}' does not implement ProviderInterface. Missing method '${method}'.`,
|
`Provider package '${providerName}' does not implement ProviderInterface. Missing method '${method}'.`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CloudRunnerLogger.log(`Successfully loaded provider: ${providerName}`);
|
CloudRunnerLogger.log(`Successfully loaded provider: ${providerName}`);
|
||||||
|
|
||||||
return instance as ProviderInterface;
|
return instance as ProviderInterface;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue