Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add coverage for containerapps-albumapi-csharp test #706

Open
wants to merge 57 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
1461d47
Refactor ingress tests to use test workspace
MicroFish91 May 24, 2024
50cc37f
Update package.json
MicroFish91 May 24, 2024
dc53932
Fix prepublish
MicroFish91 May 24, 2024
f235e50
Update testProjects folder name
MicroFish91 May 24, 2024
7aa9d80
Use blank pretest script
MicroFish91 Jun 13, 2024
c93618e
Update tools deps
MicroFish91 Jun 13, 2024
da2544b
SharedResourcesNameStep
MicroFish91 Jun 13, 2024
d889656
EnvironmentVariablesListStep
MicroFish91 Jun 13, 2024
b6a1ebb
settingUtils
MicroFish91 Jun 13, 2024
d86efde
Use path lib for TarFileStep
MicroFish91 Jun 13, 2024
2a5a692
Update getRootWorkspaceFolder
MicroFish91 Jun 13, 2024
0f21b64
Revert
MicroFish91 Jun 13, 2024
51592b3
Update comment
MicroFish91 Jun 13, 2024
c06d1b2
Update SharedResourcesNameStep
MicroFish91 Jun 13, 2024
38c457c
Monorepo test scaffold
MicroFish91 Jun 13, 2024
a819e8c
Add method for cleaning workspace folder settings
MicroFish91 Jun 13, 2024
9831624
Add delete resource groups functionality
MicroFish91 Jun 13, 2024
5918519
Add test workspace fields
MicroFish91 Jun 13, 2024
5d52072
Revert scripts
MicroFish91 Jun 13, 2024
a92417e
Add monorepo-basic test project
MicroFish91 Jun 13, 2024
4609473
Add resource groups to delete
MicroFish91 Jun 13, 2024
0beb67f
Merge with main
MicroFish91 Jun 14, 2024
2636f2e
Fix test workspace paths
MicroFish91 Jun 14, 2024
af1d275
Use different port numbers
MicroFish91 Jun 14, 2024
7df2569
Timeout test
MicroFish91 Jun 14, 2024
ecb2787
Test with delete rg
MicroFish91 Jun 14, 2024
92e7f69
Update skip logic
MicroFish91 Jun 14, 2024
34acb22
Test rg activation
MicroFish91 Jun 14, 2024
2622bf2
Test log statements
MicroFish91 Jun 14, 2024
feb3530
Test upgrade arm package
MicroFish91 Jun 14, 2024
1311350
Your guess is as good as mine
MicroFish91 Jun 14, 2024
e0858c2
Add timeout
MicroFish91 Jun 14, 2024
a2ccc28
Add timeout
MicroFish91 Jun 14, 2024
f2dd372
Clean up delete logic and increase timeout
MicroFish91 Jun 14, 2024
2f92f2b
Uset set instead of a list
MicroFish91 Jun 14, 2024
de7ce3d
Merge with main
MicroFish91 Jun 14, 2024
495d00b
Merge branch 'mwf/nightly-test-prep' of https://github.com/microsoft/…
MicroFish91 Jun 14, 2024
0b2a1de
Update arm dep
MicroFish91 Jun 14, 2024
48ab51e
Merge branch 'mwf/nightly-test-prep' of https://github.com/microsoft/…
MicroFish91 Jun 14, 2024
6039db4
Update timeouts
MicroFish91 Jun 14, 2024
04b73ff
Add monorepo test project
MicroFish91 Jun 14, 2024
f1cd5ee
Update readme title
MicroFish91 Jun 14, 2024
39c507e
Merge with parent pr
MicroFish91 Jun 14, 2024
973d4a0
Update timeouts
MicroFish91 Jun 14, 2024
c8fb59b
Update ports
MicroFish91 Jun 14, 2024
73dae15
Merge branch 'mwf/add-monorepo-test-project' of https://github.com/mi…
MicroFish91 Jun 14, 2024
d1bf0cf
Add albumapi-js repo
MicroFish91 Jun 17, 2024
9c4a757
Update ms learn test cases
MicroFish91 Jun 17, 2024
27943e6
Update names of things
MicroFish91 Jun 17, 2024
c93349b
Misc changes
MicroFish91 Jun 17, 2024
98b174e
Merge branch 'mwf/monorepo-tests' of https://github.com/microsoft/vsc…
MicroFish91 Jun 17, 2024
b56ac07
initial commit
motm32 Jun 25, 2024
272d818
uncomment code
motm32 Jun 26, 2024
c81700c
more changes
motm32 Jun 26, 2024
1dd0da0
remove comma
motm32 Jun 26, 2024
0eeab6e
merge main
motm32 Jun 28, 2024
6c18cbc
update
motm32 Jun 28, 2024
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
6 changes: 6 additions & 0 deletions test/nightly/deployWorkspaceProject/dwpTestScenarios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Licensed under the MIT License. See LICENSE.md in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { generateAlbumApiCsharpTestCases } from "./testCases/albumApiCsharpTestCases";
import { generateAlbumApiGolangTestCases } from "./testCases/albumApiGolangTestCases";
import { generateAlbumApiJavaScriptTestCases } from "./testCases/albumApiJavaScriptTestCases";
import { type DeployWorkspaceProjectTestCase } from "./testCases/DeployWorkspaceProjectTestCase";
Expand Down Expand Up @@ -30,4 +31,9 @@ export const dwpTestScenarios: DeployWorkspaceProjectTestScenario[] = [
folderName: 'monorepo-basic',
testCases: generateMonoRepoBasicTestCases()
},
{
label: 'albumapi-csharp',
folderName: 'albumapi-csharp',
testCases: generateAlbumApiCsharpTestCases()
}
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.md in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { randomUtils } from "@microsoft/vscode-azext-utils";
import { type DeploymentConfigurationSettings } from "../../../../extension.bundle";
import { type StringOrRegExpProps } from "../../../typeUtils";
import { dwpTestUtils } from "../dwpTestUtils";
import { type DeployWorkspaceProjectTestCase } from "./DeployWorkspaceProjectTestCase";
import path = require("path");

export function generateAlbumApiCsharpTestCases(): DeployWorkspaceProjectTestCase[] {
const folderName: string = 'albumapi-csharp';
const appResourceName: string = 'album-api';
const sharedResourceName: string = appResourceName + randomUtils.getRandomHexString(4);
const acrResourceName: string = sharedResourceName.replace(/[^a-zA-Z0-9]+/g, '');

return [
{
label: 'Deploy App',
inputs: [
new RegExp(folderName, 'i'),
new RegExp('Create new container apps environment', 'i'),
'Continue',
sharedResourceName,
appResourceName,
`.${path.sep}src`,
'East US',
'Save'
],
expectedResults: dwpTestUtils.generateExpectedResults(sharedResourceName, acrResourceName, appResourceName),
expectedVSCodeSettings: {
deploymentConfigurations: [
generateExpectedDeploymentConfiguration(sharedResourceName, acrResourceName, appResourceName)
]
},
postTestAssertion: dwpTestUtils.generatePostTestAssertion({ targetPort: 8080, env: undefined })
},
{
label: 'Re-deploy App',
inputs: [
new RegExp(folderName, 'i'),
appResourceName,
'Continue'
],
expectedResults: dwpTestUtils.generateExpectedResults(sharedResourceName, acrResourceName, appResourceName),
expectedVSCodeSettings: {
deploymentConfigurations: [
generateExpectedDeploymentConfiguration(sharedResourceName, acrResourceName, appResourceName)
]
},
postTestAssertion: dwpTestUtils.generatePostTestAssertion({ targetPort: 8080, env: undefined })
}
];
}

function generateExpectedDeploymentConfiguration(sharedResourceName: string, acrResourceName: string, appResourceName: string): StringOrRegExpProps<DeploymentConfigurationSettings> {
return {
label: appResourceName,
type: 'AcrDockerBuildRequest',
dockerfilePath: path.join('src', 'Dockerfile'),
srcPath: 'src',
envPath: '',
resourceGroup: sharedResourceName,
containerApp: appResourceName,
containerRegistry: new RegExp(`${acrResourceName}.{6}`, 'i'),
};
}

6 changes: 5 additions & 1 deletion test/test.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@
"name": "albumapi-js",
"path": "./testProjects/containerapps-albumapi-javascript"
},
{
"name": "albumapi-csharp",
"path": "./testProjects/containerapps-albumapi-csharp"
},
{
"name": "dockerfiles",
"path": "./testProjects/dockerfiles"
},
{
"name": "monorepo-basic",
"path": "./testProjects/monorepo-basic"
},
}
]
}
Loading