Skip to content

Commit

Permalink
Modifications proposal - naming, structure, labeling, ...
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Jelinek <[email protected]>
  • Loading branch information
djelinek committed Jan 11, 2024
1 parent fab0390 commit f3d7dc8
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 74 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Productized CI
name: Camel Version CI

on:
pull_request:
Expand All @@ -10,22 +10,22 @@ concurrency:
cancel-in-progress: true

jobs:
main:
camel:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-13, windows-latest ]
version: [ max ] # [ "x.x.x" | latest | max ]
type: [ stable ] # [ stable | insider ]
camelversion: [ "4.0.0", "4.0.0.redhat-00031"]
camel-version: [ "4.0.0", "4.0.0.redhat-00031" ]

env:
CODE_VERSION: ${{ matrix.version }}
CODE_TYPE: ${{ matrix.type }}
CODE_VERSION: max
CODE_TYPE: stable
TEST_RESOURCES: test-resources
CAMEL_VERSION: ${{ matrix.camelversion }}
CAMEL_VERSION: ${{ matrix.camel-version }}

runs-on: ${{ matrix.os }}
name: ${{ matrix.camel-version }} / ${{ matrix.os }}

steps:
- name: Checkout Repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -68,9 +68,6 @@ jobs:
- name: npm-ci
run: npm ci

- name: npm-vscode:prepublish
run: npm run vscode:prepublish

- name: ui test (ubuntu)
id: uiTest_Ubuntu
if: matrix.os == 'ubuntu-latest'
Expand All @@ -88,18 +85,12 @@ jobs:
uses: actions/upload-artifact@v3
if: failure() && matrix.os != 'windows-latest'
with:
name: ${{ matrix.os }}-${{ matrix.version }}-camel-lsp-log
name: ${{ matrix.os }}-${{ matrix.camel-version }}-camel-lsp-log
path: |
/tmp/log-camel-lsp.log
/tmp/log-camel*.log.gz
- name: Store VS Code Logs
uses: actions/upload-artifact@v3
if: failure()
with:
name: ${{ matrix.os }}-${{ matrix.version }}-test-logs
path: .vscode-test/logs/*
- name: Store UI test log
- name: Store UI test logs
uses: actions/upload-artifact@v3
if: |
(failure() || cancelled()) &&
Expand All @@ -108,7 +99,7 @@ jobs:
steps.uiTest_Ubuntu.outcome == 'cancelled' ||
steps.uiTest_MacOS_Windows.outcome == 'cancelled')
with:
name: ${{ matrix.os }}-${{ matrix.version }}-ui-test-logs
name: ${{ matrix.os }}-${{ matrix.camel-version }}-ui-test-logs
path: test-resources/settings/logs/*

- name: Store UI Test Screenshots
Expand All @@ -120,25 +111,5 @@ jobs:
steps.uiTest_Ubuntu.outcome == 'cancelled' ||
steps.uiTest_MacOS_Windows.outcome == 'cancelled')
with:
name: ${{ matrix.os }}-${{ matrix.version }}-ui-test-screenshots
name: ${{ matrix.os }}-${{ matrix.camel-version }}-ui-test-screenshots
path: test-resources/screenshots/*.png

check:
if: always()
runs-on: ubuntu-latest
name: Status Check
needs: [ main ]
steps:
- name: Test Matrix Result
run: |
echo result = ${{ needs.main.result }}
- name: Status Check - success
if: ${{ needs.main.result == 'success' }}
run: |
echo "All tests successfully completed!"
exit 0
- name: Status Check - failure
if: ${{ needs.main.result != 'success' }}
run: |
echo "Status Check failed!"
exit 1
8 changes: 4 additions & 4 deletions src/ui-test/tests/camel.settings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ describe('User preferences', function () {
await new EditorView().closeAllEditors();
if(process.env.CAMEL_VERSION != null){
await setCamelCatalogVersion(process.env.CAMEL_VERSION);
await driver.wait(async function () {
return readUserSetting(CATALOG_VERSION_ID) === (process.env.CAMEL_VERSION);
}, 15000, `Camel Version not set in time limit.`, 1500);
await driver.wait(async function () {
return readUserSetting(CATALOG_VERSION_ID) === process.env.CAMEL_VERSION;
}, 15000, `Camel Version - '${process.env.CAMEL_VERSION}' not set in time limit.`, 1500);

} else {
resetUserSettings(CATALOG_VERSION_ID);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@
* limitations under the License.
*/
import { assert } from "chai";
import { CATALOG_VERSION_ID, readUserSetting } from "../utils/testUtils";
import { CATALOG_VERSION_ID, readUserSetting } from "../../utils/testUtils";

describe('check camel version at end', function () {
describe('Camel version', function () {
this.timeout(15000);

it('actual version at end ', async function () {
const testDescription = process.env.CAMEL_VERSION ? `Check actual version is ${process.env.CAMEL_VERSION}` : 'Nothing to check';

if(process.env.CAMEL_VERSION == null || process.env.CAMEL_VERSION.length == 0){
it(testDescription, async function () {

if (process.env.CAMEL_VERSION == null || process.env.CAMEL_VERSION.length == 0) {
this.skip();
}
}

assert.equal(readUserSetting(CATALOG_VERSION_ID), process.env.CAMEL_VERSION)
});
assert.equal(readUserSetting(CATALOG_VERSION_ID), process.env.CAMEL_VERSION)
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,25 @@ import {
closeEditor,
readUserSetting,
waitUntilExtensionIsActivated
} from '../utils/testUtils';
} from '../../utils/testUtils';
import {
ActivityBar,
before,
VSBrowser,
WebDriver,
TextSetting,
Workbench
TextSetting,
Workbench
} from 'vscode-uitests-tooling';
import * as pjson from '../../../package.json';
import { assert } from 'chai';
import * as pjson from '../../../../package.json';

describe('set camel version', function () {
describe('Camel version', function () {
this.timeout(150000);

let driver: WebDriver;
const testDescription = process.env.CAMEL_VERSION ? `Set ${process.env.CAMEL_VERSION}` : 'Use default';

before(async function () {
let driver: WebDriver;

before(async function () {
this.timeout(40000);
driver = VSBrowser.instance.driver;
await VSBrowser.instance.openResources(RESOURCES);
Expand All @@ -48,15 +49,11 @@ describe('set camel version', function () {
await (await new ActivityBar().getViewControl('Explorer')).openView();
});

const testDescription = process.env.CAMEL_VERSION
? `set camel version ${process.env.CAMEL_VERSION} and check`
: 'use default version';

it(testDescription, async function () {

if(process.env.CAMEL_VERSION == null || process.env.CAMEL_VERSION.length == 0){ // no env variable set or is empty
// no env variable set or is empty
if (process.env.CAMEL_VERSION == null || process.env.CAMEL_VERSION.length == 0) {
this.skip();
}
}

// set version in ui
const settings = await new Workbench().openSettings();
Expand All @@ -65,10 +62,8 @@ describe('set camel version', function () {
await closeEditor('Settings', true);

// wait until change is available in settings file
await driver.wait(async function () {
return readUserSetting(CATALOG_VERSION_ID) === (process.env.CAMEL_VERSION);
}, 15000, `Camel Version not set in time limit.`, 1500);

assert.equal(readUserSetting(CATALOG_VERSION_ID), process.env.CAMEL_VERSION)
});
await driver.wait(async function () {
return readUserSetting(CATALOG_VERSION_ID) === process.env.CAMEL_VERSION;
}, 15000, `Camel Version - '${process.env.CAMEL_VERSION}' not set in time limit.`, 1500);
});
});
7 changes: 6 additions & 1 deletion src/ui-test/uitest_runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ const extensionFolder = path.join(projectPath, '.test-extensions');

async function main(): Promise<void> {
const tester = new ExTester(storageFolder, releaseType, extensionFolder);
await tester.setupAndRunTests('out/src/ui-test/tests/*.test.js',
await tester.setupAndRunTests(
[
'out/src/ui-test/tests/env/set.camel.version.js',
'out/src/ui-test/tests/*.test.js',
'out/src/ui-test/tests/env/check.camel.version.js'
],
process.env.CODE_VERSION,
{
'installDependencies': true
Expand Down

0 comments on commit f3d7dc8

Please sign in to comment.