Skip to content

Commit

Permalink
[RHTAP-3026] Adds test groups (#159)
Browse files Browse the repository at this point in the history
* RHTAP-3026] Adds test groups

* [RHTAP-3026] Adds running tests to README
  • Loading branch information
jsmid1 authored Nov 12, 2024
1 parent 10c0722 commit 291e4a5
Show file tree
Hide file tree
Showing 28 changed files with 245 additions and 11 deletions.
14 changes: 12 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@
> [!WARNING]
> This tests are in very beta state yet. Before running them you need to perform some steps
* Install RHTAP from https://github.com/redhat-appstudio/rhtap-cli in CI mode.
## Setup
* Install RHTAP from https://github.com/redhat-appstudio/rhtap-cli in CI mode
* You need to change this [CI value](https://github.com/redhat-appstudio/rhtap-cli/blob/main/installer/charts/values.yaml.tpl#L13) to true.
* Update the environments needed in the [default.env](./default.env) file. After you create them just run: `source default.env`
* Run `yarn && yarn test`
* Run installation with `yarn`

## Running tests
To run **all tests** based on [jest confiuration](https://github.com/redhat-appstudio/rhtap-e2e/blob/main/jest.config.js) use:
`yarn test`

To run a **single test** use: `yarn test <test file>`

To run a specific **group** of tests use: `yarn test --group=<test group>`
(if you wish to exclude a group use: `--group=-<test file>`)
3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ module.exports = {
"expand": true,
"pageTitle": "Red Hat Trusted Application Pipeline e2e report",
}],
]
],
runner: "groups"
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"eslint-plugin-no-null": "^1.0.2",
"jest": "^29.7.0",
"jest-junit": "^16.0.0",
"jest-runner-groups": "^2.2.0",
"jest-stare": "^2.5.1",
"prettier": "^2.5.1",
"ts-jest": "^29.1.1",
Expand All @@ -41,4 +42,4 @@
"jest-html-reporters": "^3.1.7",
"unique-names-generator": "^4.7.1"
}
}
}
9 changes: 9 additions & 0 deletions tests/gpts/github/dotnet.jenkins.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ import { skipSuite } from "../../test-utils.ts";
import { loadSoftwareTemplatesTestsGlobals } from "./test-config/config.ts";
import { gitHubJenkinsBasicGoldenPathTemplateTests } from "./test-config/github_suite_jenkins.ts";

/**
* Tests dotnet template in GitHub with Jenkins
*
* @group jenkins
* @group dotnet
* @group github
* @group basic
*/

const dotNetTemplateName = 'dotnet-basic';
const stringOnRoute = 'Welcome';

Expand Down
9 changes: 9 additions & 0 deletions tests/gpts/github/dotnet.tekton.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ import { gitHubBasicGoldenPathTemplateTests } from "./test-config/github_positiv
import { skipSuite } from "../../test-utils.ts";
import { loadSoftwareTemplatesTestsGlobals } from "./test-config/config.ts";

/**
* Tests dotnet template in GitHub with Tekton
*
* @group tekton
* @group dotnet
* @group github
* @group basic
*/

const dotNetTemplateName = 'dotnet-basic';

const runDotNetBasicTests = () => {
Expand Down
9 changes: 9 additions & 0 deletions tests/gpts/github/go.jenkins.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ import { gitHubJenkinsBasicGoldenPathTemplateTests } from "./test-config/github_
import { skipSuite } from "../../test-utils.ts";
import { loadSoftwareTemplatesTestsGlobals } from "./test-config/config.ts";

/**
* Tests Go template in GitHub with Jenkins
*
* @group jenkins
* @group go
* @group github
* @group basic
*/

const golangTemplateName = 'go';
const stringOnRoute = 'Hello World!';

Expand Down
11 changes: 10 additions & 1 deletion tests/gpts/github/go.tekton.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,22 @@ import { gitHubBasicGoldenPathTemplateTests } from "./test-config/github_positiv
import { skipSuite } from "../../test-utils.ts";
import { loadSoftwareTemplatesTestsGlobals } from "./test-config/config.ts";

/**
* Tests Go template in GitHub with Tekton
*
* @group tekton
* @group go
* @group github
* @group basic
*/

const golangTemplateName = 'go';

const runGolangBasicTests = () => {
const configuration = loadSoftwareTemplatesTestsGlobals()

if (configuration.templates.includes(golangTemplateName) && configuration.github.active && configuration.github.tekton) {
gitHubBasicGoldenPathTemplateTests(golangTemplateName);
gitHubBasicGoldenPathTemplateTests(golangTemplateName);
} else {
skipSuite(golangTemplateName);
}
Expand Down
9 changes: 9 additions & 0 deletions tests/gpts/github/nodejs.jenkins.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ import { skipSuite } from "../../test-utils.ts";
import { loadSoftwareTemplatesTestsGlobals } from "./test-config/config.ts";
import { gitHubJenkinsBasicGoldenPathTemplateTests } from "./test-config/github_suite_jenkins.ts";

/**
* Tests Nodejs template in GitHub with Jenkins
*
* @group jenkins
* @group nodejs
* @group github
* @group basic
*/

const nodejsTemplateName = 'nodejs';
const stringOnRoute = 'Hello from Node.js Starter Application!';

Expand Down
9 changes: 9 additions & 0 deletions tests/gpts/github/nodejs.tekton.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ import { gitHubBasicGoldenPathTemplateTests } from "./test-config/github_positiv
import { skipSuite } from "../../test-utils.ts";
import { loadSoftwareTemplatesTestsGlobals } from "./test-config/config.ts";

/**
* Tests Nodejs template in GitHub with Tekton
*
* @group tekton
* @group nodejs
* @group github
* @group basic
*/

const nodejsTemplateName = 'nodejs';

const runNodeJSBasicTests = () => {
Expand Down
9 changes: 9 additions & 0 deletions tests/gpts/github/python.jenkins.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ import { skipSuite } from "../../test-utils.ts";
import { loadSoftwareTemplatesTestsGlobals } from "./test-config/config.ts";
import { gitHubJenkinsBasicGoldenPathTemplateTests } from "./test-config/github_suite_jenkins.ts";

/**
* Tests Python template in GitHub with Jenkins
*
* @group jenkins
* @group python
* @group github
* @group basic
*/

const pythonTemplateName = 'python';
const stringOnRoute = 'Hello World!';

Expand Down
9 changes: 9 additions & 0 deletions tests/gpts/github/python.tekton.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ import { gitHubBasicGoldenPathTemplateTests } from "./test-config/github_positiv
import { skipSuite } from "../../test-utils.ts";
import { loadSoftwareTemplatesTestsGlobals } from "./test-config/config.ts";

/**
* Tests Python template in GitHub with Tekton
*
* @group tekton
* @group python
* @group github
* @group basic
*/

const pythonTemplateName = 'python';

const runPythonBasicTests = () => {
Expand Down
9 changes: 9 additions & 0 deletions tests/gpts/github/quarkus.jenkins.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ import { skipSuite } from "../../test-utils.ts";
import { loadSoftwareTemplatesTestsGlobals } from "./test-config/config.ts";
import { gitHubJenkinsBasicGoldenPathTemplateTests } from "./test-config/github_suite_jenkins.ts";

/**
* Tests Quarkus template in GitHub with Jenkins
*
* @group jenkins
* @group quarkus
* @group github
* @group basic
*/

const quarkusTemplateName = 'java-quarkus';
const stringOnRoute = 'Congratulations, you have created a new Quarkus cloud application.';

Expand Down
9 changes: 9 additions & 0 deletions tests/gpts/github/quarkus.tekton.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ import { skipSuite } from "../../test-utils.ts";
import { loadSoftwareTemplatesTestsGlobals } from "./test-config/config.ts";
import { githubSoftwareTemplatesAdvancedScenarios } from "./test-config/github_advanced_scenario.ts";

/**
* Tests Quarkus template in Github with Tekton
*
* @group tekton
* @group quarkus
* @group github
* @group advanced
*/

const quarkusTemplateName = 'java-quarkus';

const runQuarkusBasicTests = () => {
Expand Down
9 changes: 9 additions & 0 deletions tests/gpts/github/springboot.jenkins.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ import { skipSuite } from "../../test-utils.ts";
import { loadSoftwareTemplatesTestsGlobals } from "./test-config/config.ts";
import { gitHubJenkinsBasicGoldenPathTemplateTests } from "./test-config/github_suite_jenkins.ts";

/**
* Tests SpringBoot template in GitHub with Jenkins
*
* @group jenkins
* @group springboot
* @group github
* @group basic
*/

const springBootTemplateName = 'java-springboot';
const stringOnRoute = 'Hello World!';

Expand Down
9 changes: 9 additions & 0 deletions tests/gpts/github/springboot.tekton.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ import { gitHubBasicGoldenPathTemplateTests } from "./test-config/github_positiv
import { skipSuite } from "../../test-utils.ts";
import { loadSoftwareTemplatesTestsGlobals } from "./test-config/config.ts";

/**
* Tests SpringBoot template in GitHub with Tekton
*
* @group tekton
* @group springboot
* @group github
* @group basic
*/

const springBootTemplateName = 'java-springboot';

const runSpringBootBasicTests = () => {
Expand Down
11 changes: 10 additions & 1 deletion tests/gpts/gitlab/dotnet.jenkins.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@ import { skipSuite } from "../../test-utils.ts";
import { loadSoftwareTemplatesTestsGlobals } from "../github/test-config/config.ts";
import { gitLabJenkinsBasicTests } from "./suites-config/gitlab_suite_jenkins.ts";

/**
* Tests Dotnet template in Gitlab with Jenkins
*
* @group jenkins
* @group dotnet
* @group gitlab
* @group basic
*/

const dotNetTemplateName = 'dotnet-basic';
const stringOnRoute = 'Welcome';
const stringOnRoute = 'Welcome';

const runDotNetBasicTests = () => {
const configuration = loadSoftwareTemplatesTestsGlobals()
Expand Down
9 changes: 9 additions & 0 deletions tests/gpts/gitlab/dotnet.tekton.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ import { gitLabProviderBasicTests } from "./suites-config/gitlab_positive_suite.
import { skipSuite } from "../../test-utils.ts";
import { loadSoftwareTemplatesTestsGlobals } from "../github/test-config/config.ts";

/**
* Tests dotnet template in GitLab with Tekton
*
* @group tekton
* @group dotnet
* @group gitlab
* @group basic
*/

const dotNetTemplateName = 'dotnet-basic';

const runDotNetBasicTests = () => {
Expand Down
11 changes: 10 additions & 1 deletion tests/gpts/gitlab/go.jenkins.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@ import { skipSuite } from "../../test-utils.ts";
import { loadSoftwareTemplatesTestsGlobals } from "../github/test-config/config.ts";
import { gitLabJenkinsBasicTests } from "./suites-config/gitlab_suite_jenkins.ts";

/**
* Tests Go template in Gitlab with Jenkins
*
* @group jenkins
* @group go
* @group gitlab
* @group basic
*/

const golangTemplateName = 'go';
const stringOnRoute = 'Hello World!';
const stringOnRoute = 'Hello World!';

const runGolangBasicTests = () => {
const configuration = loadSoftwareTemplatesTestsGlobals()
Expand Down
10 changes: 10 additions & 0 deletions tests/gpts/gitlab/go.tekton.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
import { gitLabProviderBasicTests } from "./suites-config/gitlab_positive_suite.ts";
import { skipSuite } from "../../test-utils.ts";
import { loadSoftwareTemplatesTestsGlobals } from "../github/test-config/config.ts";

/**
* Tests Go template in GitLab with Tekton
*
* @group tekton
* @group go
* @group gitlab
* @group basic
*/

const golangTemplateName = 'go';

const runGolangBasicTests = () => {
Expand Down
11 changes: 10 additions & 1 deletion tests/gpts/gitlab/nodejs.jenkins.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@ import { skipSuite } from "../../test-utils.ts";
import { loadSoftwareTemplatesTestsGlobals } from "../github/test-config/config.ts";
import { gitLabJenkinsBasicTests } from "./suites-config/gitlab_suite_jenkins.ts";

/**
* Tests Nodejs template in Gitlab with Jenkins
*
* @group jenkins
* @group nodejs
* @group gitlab
* @group basic
*/

const nodejsTemplateName = 'nodejs';
const stringOnRoute = 'Hello from Node.js Starter Application!';
const stringOnRoute = 'Hello from Node.js Starter Application!';

const runNodeJSBasicTests = () => {
const configuration = loadSoftwareTemplatesTestsGlobals()
Expand Down
9 changes: 9 additions & 0 deletions tests/gpts/gitlab/nodejs.tekton.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ import { gitLabProviderBasicTests } from "./suites-config/gitlab_positive_suite.
import { skipSuite } from "../../test-utils.ts";
import { loadSoftwareTemplatesTestsGlobals } from "../github/test-config/config.ts";

/**
* Tests Nodejs template in GitLab with Tekton
*
* @group tekton
* @group nodejs
* @group gitlab
* @group basic
*/

const nodejsTemplateName = 'nodejs';

const runNodeJSBasicTests = () => {
Expand Down
11 changes: 10 additions & 1 deletion tests/gpts/gitlab/python.jenkins.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@ import { skipSuite } from "../../test-utils.ts";
import { loadSoftwareTemplatesTestsGlobals } from "../github/test-config/config.ts";
import { gitLabJenkinsBasicTests } from "./suites-config/gitlab_suite_jenkins.ts";

/**
* Tests Python template in Gitlab with Jenkins
*
* @group jenkins
* @group python
* @group gitlab
* @group basic
*/

const pythonTemplateName = 'python';
const stringOnRoute = 'Hello World!';
const stringOnRoute = 'Hello World!';

const runPythonBasicTests = () => {
const configuration = loadSoftwareTemplatesTestsGlobals()
Expand Down
9 changes: 9 additions & 0 deletions tests/gpts/gitlab/python.tekton.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ import { gitLabProviderBasicTests } from "./suites-config/gitlab_positive_suite.
import { skipSuite } from "../../test-utils.ts";
import { loadSoftwareTemplatesTestsGlobals } from "../github/test-config/config.ts"

/**
* Tests Python template in GitLab with Tekton
*
* @group tekton
* @group python
* @group gitlab
* @group basic
*/

const pythonTemplateName = 'python';

const runPythonBasicTests = () => {
Expand Down
Loading

0 comments on commit 291e4a5

Please sign in to comment.