Skip to content

Commit

Permalink
feat: updated PodOverridesAPI.spec.ts to work with aigap cluster
Browse files Browse the repository at this point in the history
Signed-off-by: mdolhalo <[email protected]>
  • Loading branch information
mdolhalo committed Aug 22, 2023
1 parent 385afa4 commit b61ee43
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
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
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

0 comments on commit b61ee43

Please sign in to comment.