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

feat: updated PodOverridesAPI.spec.ts to work with aigap cluster #22447

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions tests/e2e/constants/BaseTestConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export const BaseTestConstants: any = {
*/
TS_SELENIUM_BASE_URL: !process.env.TS_SELENIUM_BASE_URL ? 'http://sample-url' : process.env.TS_SELENIUM_BASE_URL.replace(/\/$/, ''),

IS_CLUSTER_DISCONNECTED: () => BaseTestConstants.TS_SELENIUM_BASE_URL.includes('airgap'),

/**
* Choose the platform where "che" application deployed, "openshift" by default.
*/
Expand Down
37 changes: 37 additions & 0 deletions tests/e2e/resources/pod-overrides-airgap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
kind: DevWorkspace
apiVersion: workspace.devfile.io/v1alpha2
metadata:
name: code-latest-pod-overrides
spec:
started: true
template:
attributes:
pod-overrides:
metadata:
annotations:
io.openshift.userns: "true"
io.kubernetes.cri-o.userns-mode: "auto:size=65536;map-to-root=true" # <-- user namespace
openshift.io/scc: container-build
spec:
runtimeClassName: kata
schedulerName: stork
projects:
- name: web-nodejs-sample
git:
remotes:
origin: "https://github.com/che-samples/web-nodejs-sample.git"
commands:
- id: say-hello
exec:
component: che-code-runtime-description
commandLine: echo "Hello from $(pwd)"
workingDir: ${PROJECT_SOURCE}/app
contributions:
- name: che-code
uri: http://plugin-registry.openshift-devspaces.svc.cluster.local:8080/v3/plugins/che-incubator/che-code/latest/devfile.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if it will work with Eclipse Che Next

components:
- name: che-code-runtime-description
container:
env:
- name: CODE_HOST
value: 0.0.0.0
3 changes: 2 additions & 1 deletion tests/e2e/specs/api/PodOverridesAPI.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import path from 'path';
import YAML from 'yaml';
import { expect } from 'chai';
import { ShellExecutor } from '../../utils/ShellExecutor';
import { BaseTestConstants } from '../../constants/BaseTestConstants';

suite(`Test defining pod overrides via attribute.`, async function(): Promise<void> {
const pathToSampleFile: string = path.resolve('resources/pod-overrides.yaml');
const pathToSampleFile: string = path.resolve(`resources/pod-overrides${BaseTestConstants.IS_CLUSTER_DISCONNECTED() ? '-airgap' : ''}.yaml`);
const workspaceName: string = YAML.parse(fs.readFileSync(pathToSampleFile, 'utf8')).metadata.name;
const kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor = new KubernetesCommandLineToolsExecutor(workspaceName);

Expand Down
Loading