-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3,215 changed files
with
1,088,400 additions
and
2 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: e2e | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- 'ui' | ||
- '.github/workflows/ui-e2e.yaml' | ||
|
||
jobs: | ||
cypress-run: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Cypress run | ||
uses: cypress-io/github-action@v5 | ||
with: | ||
working-directory: ui | ||
start: npm start | ||
wait-on: 'npx wait-on --timeout 180000 http://0.0.0.0:4200' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# See http://help.github.com/ignore-files/ for more about ignoring files. | ||
|
||
# Compiled output | ||
/dist | ||
/tmp | ||
/out-tsc | ||
/bazel-out | ||
|
||
# Node | ||
/node_modules | ||
npm-debug.log | ||
yarn-error.log | ||
|
||
# IDEs and editors | ||
.idea/ | ||
.project | ||
.classpath | ||
.c9/ | ||
*.launch | ||
.settings/ | ||
*.sublime-workspace | ||
|
||
# Visual Studio Code | ||
.vscode/* | ||
!.vscode/settings.json | ||
!.vscode/tasks.json | ||
!.vscode/launch.json | ||
!.vscode/extensions.json | ||
.history/* | ||
|
||
# Miscellaneous | ||
/.angular/cache | ||
.sass-cache/ | ||
/connect.lock | ||
/coverage | ||
/libpeerconnection.log | ||
testem.log | ||
/typings | ||
|
||
# System files | ||
.DS_Store | ||
Thumbs.db | ||
|
||
/cypress/videos | ||
|
||
.odo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
build-wasm: | ||
( \ | ||
cd wasm/ && \ | ||
GOOS=js GOARCH=wasm go build -o ../src/assets/devfile.wasm && \ | ||
HASH=$$(md5sum ../src/assets/devfile.wasm | awk '{ print $$1 }') && \ | ||
echo $${HASH} && \ | ||
mv ../src/assets/devfile.wasm ../src/assets/devfile.$${HASH}.wasm && \ | ||
sed -i "s/devfile\.[a-z0-9]*\.wasm/devfile\.$${HASH}.wasm/" ../src/app/app.module.ts \ | ||
) | ||
|
||
deploy: | ||
npm run deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Devfile Builder | ||
|
||
Devfile Builder is a tool to help users edit and create Devfile (https://devfile.io). | ||
|
||
## Development with Devfile | ||
|
||
Run `odo dev --platform podman` from this directory to start a development session. | ||
|
||
## Development (generic, from Angular documentation) | ||
|
||
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.2.2. | ||
|
||
### Development server | ||
|
||
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files. | ||
|
||
### Code scaffolding | ||
|
||
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. | ||
|
||
### Build | ||
|
||
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. | ||
|
||
### Running unit tests | ||
|
||
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). | ||
|
||
### Running end-to-end tests | ||
|
||
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities. | ||
|
||
### Further help | ||
|
||
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
{ | ||
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", | ||
"version": 1, | ||
"newProjectRoot": "projects", | ||
"projects": { | ||
"devfile-builder": { | ||
"projectType": "application", | ||
"schematics": {}, | ||
"root": "", | ||
"sourceRoot": "src", | ||
"prefix": "app", | ||
"architect": { | ||
"build": { | ||
"builder": "@angular-devkit/build-angular:browser", | ||
"options": { | ||
"outputPath": "dist/devfile-builder", | ||
"index": "src/index.html", | ||
"main": "src/main.ts", | ||
"polyfills": [ | ||
"zone.js" | ||
], | ||
"tsConfig": "tsconfig.app.json", | ||
"assets": [ | ||
"src/favicon.ico", | ||
"src/CNAME", | ||
"src/assets" | ||
], | ||
"styles": [ | ||
"@angular/material/prebuilt-themes/indigo-pink.css", | ||
"src/styles.css" | ||
], | ||
"scripts": [ | ||
"src/assets/wasm_exec.js" | ||
] | ||
}, | ||
"configurations": { | ||
"production": { | ||
"budgets": [ | ||
{ | ||
"type": "initial", | ||
"maximumWarning": "1500kb", | ||
"maximumError": "2mb" | ||
}, | ||
{ | ||
"type": "anyComponentStyle", | ||
"maximumWarning": "2kb", | ||
"maximumError": "4kb" | ||
} | ||
], | ||
"outputHashing": "all" | ||
}, | ||
"development": { | ||
"buildOptimizer": false, | ||
"optimization": false, | ||
"vendorChunk": true, | ||
"extractLicenses": false, | ||
"sourceMap": true, | ||
"namedChunks": true | ||
} | ||
}, | ||
"defaultConfiguration": "production" | ||
}, | ||
"serve": { | ||
"builder": "@angular-devkit/build-angular:dev-server", | ||
"configurations": { | ||
"production": { | ||
"browserTarget": "devfile-builder:build:production" | ||
}, | ||
"development": { | ||
"browserTarget": "devfile-builder:build:development" | ||
} | ||
}, | ||
"defaultConfiguration": "development" | ||
}, | ||
"extract-i18n": { | ||
"builder": "@angular-devkit/build-angular:extract-i18n", | ||
"options": { | ||
"browserTarget": "devfile-builder:build" | ||
} | ||
}, | ||
"test": { | ||
"builder": "@angular-devkit/build-angular:karma", | ||
"options": { | ||
"polyfills": [ | ||
"zone.js", | ||
"zone.js/testing" | ||
], | ||
"tsConfig": "tsconfig.spec.json", | ||
"assets": [ | ||
"src/favicon.ico", | ||
"src/assets" | ||
], | ||
"styles": [ | ||
"@angular/material/prebuilt-themes/indigo-pink.css", | ||
"src/styles.css" | ||
], | ||
"scripts": [] | ||
} | ||
}, | ||
"deploy": { | ||
"builder": "angular-cli-ghpages:deploy" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { defineConfig } from "cypress"; | ||
|
||
export default defineConfig({ | ||
e2e: { | ||
setupNodeEvents(on, config) { | ||
// implement node event listeners here | ||
}, | ||
}, | ||
viewportWidth: 1080, | ||
viewportHeight: 660, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const TAB_YAML = 0; | ||
export const TAB_CHART = 1; | ||
export const TAB_METADATA = 2; | ||
export const TAB_COMMANDS = 3; | ||
export const TAB_VOLUMES = 4; | ||
export const TAB_CONTAINERS = 5; | ||
export const TAB_IMAGES = 6; | ||
export const TAB_RESOURCES = 7; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
import { TAB_COMMANDS, TAB_CONTAINERS, TAB_IMAGES, TAB_RESOURCES } from "./consts"; | ||
|
||
describe('devfile editor errors handling', () => { | ||
|
||
it('fails when YAML is not valid', () => { | ||
cy.visit('http://localhost:4200'); | ||
cy.clearDevfile(); | ||
cy.setDevfile("wrong yaml content"); | ||
cy.getByDataCy("yaml-error").should('contain.text', 'error parsing devfile YAML'); | ||
}); | ||
|
||
it('fails when adding a container with an already used name', () => { | ||
cy.visit('http://localhost:4200'); | ||
cy.clearDevfile(); | ||
cy.fixture('input/with-container.yaml').then(yaml => { | ||
cy.setDevfile(yaml); | ||
}); | ||
cy.selectTab(TAB_CONTAINERS); | ||
cy.getByDataCy('add').click(); | ||
cy.getByDataCy('container-name').type('container1'); | ||
cy.getByDataCy('container-image').type('an-image'); | ||
cy.getByDataCy('container-create').click(); | ||
cy.on('window:alert', (str) => { | ||
expect(str).to.contain(`container1 already exists`) | ||
}); | ||
}); | ||
|
||
it('fails when adding an image with an already used name', () => { | ||
cy.visit('http://localhost:4200'); | ||
cy.clearDevfile(); | ||
cy.fixture('input/with-container.yaml').then(yaml => { | ||
cy.setDevfile(yaml); | ||
}); | ||
cy.selectTab(TAB_IMAGES); | ||
cy.getByDataCy('image-name').type('container1'); | ||
cy.getByDataCy('image-image-name').type('an-image-name'); | ||
cy.getByDataCy('image-build-context').type('/path/to/build/context'); | ||
cy.getByDataCy('image-dockerfile-uri').type('/path/to/dockerfile'); | ||
cy.getByDataCy('image-create').click(); | ||
cy.on('window:alert', (str) => { | ||
expect(str).to.contain(`container1 already exists`) | ||
}); | ||
}); | ||
|
||
it('fails when adding a resource with an already used name', () => { | ||
cy.visit('http://localhost:4200'); | ||
cy.clearDevfile(); | ||
cy.fixture('input/with-container.yaml').then(yaml => { | ||
cy.setDevfile(yaml); | ||
}); | ||
cy.selectTab(TAB_RESOURCES); | ||
cy.getByDataCy('resource-name').type('container1'); | ||
cy.getByDataCy('resource-toggle-inlined').click(); | ||
cy.getByDataCy('resource-manifest').type('a-resource-manifest'); | ||
cy.getByDataCy('resource-create').click(); | ||
cy.on('window:alert', (str) => { | ||
expect(str).to.contain(`container1 already exists`) | ||
}); | ||
}); | ||
|
||
it('fails when adding an exec command with an already used name', () => { | ||
cy.visit('http://localhost:4200'); | ||
cy.clearDevfile(); | ||
cy.fixture('input/with-exec-command.yaml').then(yaml => { | ||
cy.setDevfile(yaml); | ||
}); | ||
cy.selectTab(TAB_COMMANDS); | ||
cy.getByDataCy('add').click(); | ||
cy.getByDataCy('new-command-exec').click(); | ||
|
||
cy.getByDataCy('command-exec-name').type('command1'); | ||
cy.getByDataCy('command-exec-command-line').type('a-cmdline'); | ||
cy.getByDataCy('command-exec-working-dir').type('/path/to/working/dir'); | ||
cy.getByDataCy('select-container').click().get('mat-option').contains('container1').click(); | ||
cy.getByDataCy('command-exec-create').click(); | ||
cy.on('window:alert', (str) => { | ||
expect(str).to.contain(`command1 already exists`) | ||
}); | ||
}); | ||
|
||
it('fails when adding an apply command with an already used name', () => { | ||
cy.visit('http://localhost:4200'); | ||
cy.clearDevfile(); | ||
cy.fixture('input/with-apply-command.yaml').then(yaml => { | ||
cy.setDevfile(yaml); | ||
}); | ||
cy.selectTab(TAB_COMMANDS); | ||
cy.getByDataCy('add').click(); | ||
cy.getByDataCy('new-command-apply').click(); | ||
|
||
cy.getByDataCy('command-apply-name').type('command1'); | ||
cy.getByDataCy('select-container').click().get('mat-option').contains('resource1').click(); | ||
cy.getByDataCy('command-apply-create').click(); | ||
cy.on('window:alert', (str) => { | ||
expect(str).to.contain(`command1 already exists`) | ||
}); | ||
}); | ||
|
||
it('fails when adding an image command with an already used name', () => { | ||
cy.visit('http://localhost:4200'); | ||
cy.clearDevfile(); | ||
cy.fixture('input/with-image-command.yaml').then(yaml => { | ||
cy.setDevfile(yaml); | ||
}); | ||
cy.selectTab(TAB_COMMANDS); | ||
cy.getByDataCy('add').click(); | ||
cy.getByDataCy('new-command-image').click(); | ||
|
||
cy.getByDataCy('command-image-name').type('command1'); | ||
cy.getByDataCy('select-container').click().get('mat-option').contains('image1').click(); | ||
cy.getByDataCy('command-image-create').click(); | ||
cy.on('window:alert', (str) => { | ||
expect(str).to.contain(`command1 already exists`) | ||
}); | ||
}); | ||
|
||
it('fails when adding a composite command with an already used name', () => { | ||
cy.visit('http://localhost:4200'); | ||
cy.clearDevfile(); | ||
cy.fixture('input/with-image-command.yaml').then(yaml => { | ||
cy.setDevfile(yaml); | ||
}); | ||
cy.selectTab(TAB_COMMANDS); | ||
cy.getByDataCy('add').click(); | ||
cy.getByDataCy('new-command-composite').click(); | ||
|
||
cy.getByDataCy('command-composite-name').type('command1'); | ||
cy.getByDataCy('command-composite-create').click(); | ||
cy.on('window:alert', (str) => { | ||
expect(str).to.contain(`command1 already exists`) | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.