Skip to content

Commit 923a920

Browse files
fix(cloudformation): fix a few testing issues for CloudFormation changes (#8319)
## Problem fix(cloudformation): fix a few testing issues ## Solution - Remove `**/cloudformation-languageserver/**` from tests coverage - Drop an integration test for SAM schema downloads --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license. Co-authored-by: Laxman Reddy <[email protected]>
1 parent dd1ba33 commit 923a920

File tree

2 files changed

+7
-35
lines changed

2 files changed

+7
-35
lines changed

packages/core/src/testInteg/schema/schema.test.ts

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import globals from '../../shared/extensionGlobals'
7-
import { GlobalStorage } from '../../shared/globalStorage'
8-
import { getDefaultSchemas, samAndCfnSchemaUrl } from '../../shared/schemas'
96
import {
107
getCITestSchemas,
118
JSONObject,
@@ -15,9 +12,6 @@ import {
1512
assertRef,
1613
assertDefinition,
1714
} from '../../test/shared/schema/testUtils'
18-
import { assertTelemetry } from '../../test/testUtil'
19-
import { waitUntil } from '../../shared/utilities/timeoutUtils'
20-
import { fs } from '../../shared'
2115

2216
describe('Sam Schema Regression', function () {
2317
let samSchema: JSONObject
@@ -67,31 +61,3 @@ describe('Sam Schema Regression', function () {
6761
assertDefinitionProperty(samSchema, 'AWS::Serverless::Api.Auth', 'AddDefaultAuthorizerToCorsPreflight')
6862
})
6963
})
70-
71-
describe('getDefaultSchemas()', () => {
72-
beforeEach(async () => {})
73-
74-
it('uses cache after initial fetch for CFN/SAM schema', async () => {
75-
await fs.delete(GlobalStorage.samAndCfnSchemaDestinationUri().fsPath)
76-
await globals.telemetry.setTelemetryEnabled(true)
77-
globals.telemetry.clearRecords()
78-
globals.telemetry.logger.clear()
79-
await getDefaultSchemas()
80-
await getDefaultSchemas()
81-
await getDefaultSchemas()
82-
await waitUntil(
83-
async () => {
84-
return await fs.exists(GlobalStorage.samAndCfnSchemaDestinationUri().fsPath)
85-
},
86-
{ truthy: true, interval: 200, timeout: 5000 }
87-
)
88-
assertTelemetry('toolkit_getExternalResource', [
89-
// Initial retrieval.
90-
// (Technically, this is done on activation, not any of the getDefaultSchemas() calls above.)
91-
{ url: samAndCfnSchemaUrl, passive: true, result: 'Succeeded' },
92-
// Use cache after initial fetch.
93-
{ url: samAndCfnSchemaUrl, passive: true, result: 'Cancelled', reason: 'Cache hit' },
94-
{ url: samAndCfnSchemaUrl, passive: true, result: 'Cancelled', reason: 'Cache hit' },
95-
])
96-
})
97-
})

packages/toolkit/.c8rc.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,11 @@
22
"report-dir": "../../coverage/toolkit",
33
"reporter": ["lcov"],
44
"all": true,
5-
"exclude": ["**/test*/**", "**/node_modules/**", "**/ssmServer.js", "**/ssmDocument/external *"]
5+
"exclude": [
6+
"**/test*/**",
7+
"**/node_modules/**",
8+
"**/ssmServer.js",
9+
"**/ssmDocument/external *",
10+
"**/cloudformation-languageserver/**"
11+
]
612
}

0 commit comments

Comments
 (0)