From 3a64636d343517b65bbe2b6518af3eb0b0077480 Mon Sep 17 00:00:00 2001 From: Josef Kopriva Date: Mon, 30 Sep 2024 10:33:00 +0200 Subject: [PATCH] Fixes after rebase Signed-off-by: Josef Kopriva --- src/utils/test.utils.ts | 6 +-- tests/gpts/github/go.unregister.test.ts | 4 +- .../test-config/github_import_template.ts | 8 +-- yarn.lock | 49 ++++++++++--------- 4 files changed, 34 insertions(+), 33 deletions(-) diff --git a/src/utils/test.utils.ts b/src/utils/test.utils.ts index cb9caa7d..37e02b01 100644 --- a/src/utils/test.utils.ts +++ b/src/utils/test.utils.ts @@ -28,7 +28,6 @@ export async function cleanAfterTestGitLab(gitLabProvider: GitLabProvider, kubeC await kubeClient.deleteApplicationFromNamespace(rootNamespace, `${repositoryName}-app-of-apps`) } -<<<<<<< HEAD export async function waitForStringInPageContent( url: string, searchString: string, @@ -57,7 +56,7 @@ export async function waitForStringInPageContent( // Return false if the timeout is reached and the string was not found return false; } -======= + export async function beforeChecks(componentRootNamespace: string, githubOrganization: string, quayImageOrg: string, developmentNamespace: string, kubeClient: Kubernetes) { if (componentRootNamespace === '') { throw new Error("The 'APPLICATION_TEST_NAMESPACE' environment variable is not set. Please ensure that the environment variable is defined properly or you have cluster connection."); @@ -99,6 +98,3 @@ export async function checkComponentInBackstage(backstageClient: DeveloperHubCli const componentUid = await backstageClient.getComponentUid(repositoryName); expect(componentUid).toBeDefined() } - - ->>>>>>> f38895f (Sonar fixes) diff --git a/tests/gpts/github/go.unregister.test.ts b/tests/gpts/github/go.unregister.test.ts index a759fa8b..89b59641 100644 --- a/tests/gpts/github/go.unregister.test.ts +++ b/tests/gpts/github/go.unregister.test.ts @@ -1,4 +1,4 @@ -import { gitHubBasicGoldenPathTemplateTests } from "./test-config/github_import_template.ts"; +import { gitHubImportTemplateTests } from "./test-config/github_import_template.ts"; import { skipSuite } from "../../test-utils.ts"; import { loadSoftwareTemplatesTestsGlobals } from "./test-config/config.ts"; @@ -9,7 +9,7 @@ const runGolangBasicTests = () => { if (configuration.templates.includes(golangTemplateName) && configuration.github.active) { - gitHubBasicGoldenPathTemplateTests(golangTemplateName); + gitHubImportTemplateTests(golangTemplateName); } else { skipSuite(golangTemplateName); } diff --git a/tests/gpts/github/test-config/github_import_template.ts b/tests/gpts/github/test-config/github_import_template.ts index 4b12333a..dea35a47 100644 --- a/tests/gpts/github/test-config/github_import_template.ts +++ b/tests/gpts/github/test-config/github_import_template.ts @@ -15,7 +15,7 @@ import { beforeChecks, checkComponentInBackstage, cleanAfterTestGitHub } from ". * 5. Add component/location to RHDH * 6. Check that components gets created successfully in Red Hat Developer Hub */ -export const gitHubBasicGoldenPathTemplateTests = (gptTemplate: string) => { +export const gitHubImportTemplateTests = (gptTemplate: string) => { describe(`Red Hat Trusted Application Pipeline ${gptTemplate} GPT tests GitHub provider with public/private image registry`, () => { jest.retryTimes(2); @@ -29,6 +29,7 @@ export const gitHubBasicGoldenPathTemplateTests = (gptTemplate: string) => { const quayImageName = "rhtap-qe"; const quayImageOrg = process.env.QUAY_IMAGE_ORG || ''; + const imageRegistry = process.env.IMAGE_REGISTRY || 'quay.io'; let developerHubTask: TaskIdReponse; let gitHubClient: GitHubProvider; @@ -78,12 +79,13 @@ export const gitHubBasicGoldenPathTemplateTests = (gptTemplate: string) => { hostType: 'GitHub', imageName: quayImageName, imageOrg: quayImageOrg, - imageRegistry: 'quay.io', + imageRegistry: imageRegistry, name: repositoryName, namespace: componentRootNamespace, owner: "user:guest", repoName: repositoryName, - repoOwner: githubOrganization + repoOwner: githubOrganization, + ciType: "tekton" } }; diff --git a/yarn.lock b/yarn.lock index 110c0176..77537419 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1174,12 +1174,16 @@ cross-fetch "^4.0.0" uri-template "^2.0.0" -<<<<<<< HEAD "@backstage/catalog-model@1.5.0", "@backstage/catalog-model@^1.5.0": version "1.5.0" resolved "https://registry.yarnpkg.com/@backstage/catalog-model/-/catalog-model-1.5.0.tgz#7f5c4a80a3341555db5209fbc6fc2d25f6500707" integrity sha512-CfLO5/DMGahneuLU4KTQEs1tgNhBciUtyGUDZB4Ii9i1Uha1poWcqp4HKg61lj1hmXNDUHmlbFqY9W7kmzRC0A== -======= + dependencies: + "@backstage/errors" "^1.2.4" + "@backstage/types" "^1.1.1" + ajv "^8.10.0" + lodash "^4.17.21" + "@backstage/catalog-model@^1.4.3": version "1.4.3" resolved "https://registry.yarnpkg.com/@backstage/catalog-model/-/catalog-model-1.4.3.tgz#64abf34071d1cad6372f905b92e1d831e480750c" @@ -1194,7 +1198,6 @@ version "1.4.5" resolved "https://registry.yarnpkg.com/@backstage/catalog-model/-/catalog-model-1.4.5.tgz#b8f6309ff12b72dffdfe852d615c553ae13452c0" integrity sha512-I4QOCy0pSXJikQWgC8MWj2zDRCgQnnmvnNOOnPFcg7hIIIzeV0sGp6d3Qi7bc2tvzXt3fT3biSOCgGOWi1IJKA== ->>>>>>> 0a961e7 (RHTAP-2547) dependencies: "@backstage/errors" "^1.2.4" "@backstage/types" "^1.1.1" @@ -1264,7 +1267,7 @@ "@types/react" "^16.13.1 || ^17.0.0 || ^18.0.0" history "^5.0.0" -"@backstage/errors@^1.2.4": +"@backstage/errors@^1.2.3", "@backstage/errors@^1.2.4": version "1.2.4" resolved "https://registry.yarnpkg.com/@backstage/errors/-/errors-1.2.4.tgz#2ba79c6308e87b0de99edf499e1c82477d3d6e8a" integrity sha512-JBhKn9KwZTzp/AaOC0vBncKCM1vI9Z8rKKyr9vj3wt3SSgCnDPxNwVz7SlXa2Rc9TOQq0Yk3olkmQE9U+S5uWg== @@ -1366,7 +1369,6 @@ lodash "^4.17.21" luxon "^3.0.0" -<<<<<<< HEAD "@backstage/plugin-kubernetes-common@^0.8.0": version "0.8.1" resolved "https://registry.yarnpkg.com/@backstage/plugin-kubernetes-common/-/plugin-kubernetes-common-0.8.1.tgz#9fe97ccfdb6b9f4fcabc846f5cb9c9bfeae410e5" @@ -1408,16 +1410,22 @@ xterm-addon-attach "^0.9.0" xterm-addon-fit "^0.8.0" -"@backstage/plugin-permission-common@^0.7.14": +"@backstage/plugin-permission-common@^0.7.11", "@backstage/plugin-permission-common@^0.7.14": version "0.7.14" resolved "https://registry.yarnpkg.com/@backstage/plugin-permission-common/-/plugin-permission-common-0.7.14.tgz#ecb12877c412ff271124af54fca46ec06d9c812f" integrity sha512-fHbxhX9ZoT8bTVuGycfTeU/6TE2yjZ6YNvm/2ko1bcxGnvYe1p5Ug5JW+iWjDZS+F6F152tWzhRcg05wQlPNKQ== -======= + dependencies: + "@backstage/config" "^1.2.0" + "@backstage/errors" "^1.2.4" + "@backstage/types" "^1.1.1" + cross-fetch "^4.0.0" + uuid "^9.0.0" + zod "^3.22.4" + "@backstage/plugin-permission-common@^0.7.13": version "0.7.13" resolved "https://registry.yarnpkg.com/@backstage/plugin-permission-common/-/plugin-permission-common-0.7.13.tgz#ea8509d2a38063309b8726ee6be8b95e1f99e5b9" integrity sha512-FGC6qrQc96SuovRCWQARDKss7TRenusMX9i0k0Devx/0+h2jM0TYYtuJ52jAFSAx9Db3BRRSlj9M5AQFgjoNmg== ->>>>>>> 0a961e7 (RHTAP-2547) dependencies: "@backstage/config" "^1.2.0" "@backstage/errors" "^1.2.4" @@ -1449,19 +1457,6 @@ "@types/react" "^16.13.1 || ^17.0.0 || ^18.0.0" swr "^2.0.0" -"@backstage/plugin-scaffolder-common@^1.5.1", "@backstage/plugin-scaffolder-common@^1.5.4": - version "1.5.4" - resolved "https://registry.yarnpkg.com/@backstage/plugin-scaffolder-common/-/plugin-scaffolder-common-1.5.4.tgz#b1fed2735b1a373f8e56e4d99d8e1af972e11f4c" - integrity sha512-oSyKLv+055SIOKge1NrQQrnwb9944Ov1aWm9jWCcQ20+ejWCc9STJWtiZ0POZbtbo6fVpJiBLdzQDqnmLzyuLA== - dependencies: -<<<<<<< HEAD - "@backstage/catalog-model" "^1.5.0" - "@backstage/plugin-permission-common" "^0.8.0" -======= - "@backstage/catalog-model" "^1.4.3" - "@backstage/plugin-permission-common" "^0.7.11" - "@backstage/types" "^1.1.1" - "@backstage/plugin-scaffolder-common@^1.5.1": version "1.5.1" resolved "https://registry.yarnpkg.com/@backstage/plugin-scaffolder-common/-/plugin-scaffolder-common-1.5.1.tgz#cd79c2b222ae03a6906f1599d71c1ef385710f57" @@ -1469,7 +1464,15 @@ dependencies: "@backstage/catalog-model" "^1.4.5" "@backstage/plugin-permission-common" "^0.7.13" ->>>>>>> 0a961e7 (RHTAP-2547) + "@backstage/types" "^1.1.1" + +"@backstage/plugin-scaffolder-common@^1.5.4": + version "1.5.4" + resolved "https://registry.yarnpkg.com/@backstage/plugin-scaffolder-common/-/plugin-scaffolder-common-1.5.4.tgz#b1fed2735b1a373f8e56e4d99d8e1af972e11f4c" + integrity sha512-oSyKLv+055SIOKge1NrQQrnwb9944Ov1aWm9jWCcQ20+ejWCc9STJWtiZ0POZbtbo6fVpJiBLdzQDqnmLzyuLA== + dependencies: + "@backstage/catalog-model" "^1.5.0" + "@backstage/plugin-permission-common" "^0.8.0" "@backstage/types" "^1.1.1" "@backstage/plugin-scaffolder-react@^1.7.0": @@ -8075,4 +8078,4 @@ zod@^3.22.4: zwitch@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-2.0.4.tgz#c827d4b0acb76fc3e685a4c6ec2902d51070e9d7" - integrity sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A== \ No newline at end of file + integrity sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==