Skip to content

Commit

Permalink
Merge branch 'main' into update-complaint-analysis-gemini
Browse files Browse the repository at this point in the history
  • Loading branch information
JanethL authored Jan 6, 2025
2 parents 606b69d + ebbd9d7 commit 23382e9
Show file tree
Hide file tree
Showing 109 changed files with 12,476 additions and 8,501 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ jobs:
- name: Run Playwright tests
if: ${{ steps.load-files.outputs.tests_exists == 'true' }}
run: |
export CI_BRANCH=${{ github.head_ref || github.ref_name }}
npx playwright test
- name: Delete test environments
if: ${{always() && steps.load-files.outputs.tests_exists == 'true'}}
Expand Down
2 changes: 2 additions & 0 deletions .tests/environments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ export class Environments {
public readonly envName: string;
public readonly region: string;
public readonly password: string;
public isBranchSet: boolean;

public envDetails: any;

constructor(evnName: string, region: string, password: string) {
this.envName = evnName;
this.region = region;
this.password = password;
this.isBranchSet = false;
}
public list() {
return axios.get(url, {
Expand Down
420 changes: 57 additions & 363 deletions .tests/package-lock.json

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions .tests/tests/jupytertest.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const envPool = new EnvPool(Math.floor(CSAE_WORKERS_COUNT / CSAE_PARALLEL_TESTS_

const CSAE_CI_JOB_IDX = parseInt(process.env.CSAE_CI_JOB_IDX || '0');
const CSAE_CI_JOB_COUNT = parseInt(process.env.CSAE_CI_JOB_COUNT || '1');
const CI_BRANCH = process.env.CI_BRANCH || 'main';

const sleep = (ms) => new Promise(r => setTimeout(r, ms));

Expand Down Expand Up @@ -46,7 +47,9 @@ function loadTestData(filename): Input[] {
const filenameArray = filename.split('/')
filenameArray[filenameArray.length - 1] = '.'+filenameArray[filenameArray.length - 1].replace(/.ipynb$/, '.yaml');
const testDataFilename = filenameArray.join('/');
console.log('Checking if test data(.yaml) file exists: ' + testDataFilename);
if (fs.existsSync(testDataFilename)){
console.log('Found test data(.yaml) file, Loading into memory: ' + testDataFilename);
return (yamlParse(fs.readFileSync(testDataFilename, 'utf8')) as TestData).inputs;
}
return []
Expand Down Expand Up @@ -83,6 +86,27 @@ for (let i = 0; i < testCount; i++) {

// Create Env or get existing Env
const env = await envPool.getEnv(testInfo.parallelIndex);

//Checkout to correct branch
if(env.isBranchSet === false && CI_BRANCH !== 'main'){
console.log('Checking out to branch: ' + CI_BRANCH);
await page.goto(env.getJuypterUrl('Demo.index'));
await page.locator('#jp-main-dock-panel').getByText('Demo.index').waitFor({ timeout: 600000 })
try{
await page.locator('#jp-main-dock-panel').getByText('Launcher').click({timeout: 5000});
await page.locator('#launcher-0').getByText('Terminal').click();
}catch(e){
if (!(e instanceof errors.TimeoutError)) {
throw e;
}
}

await page.locator('#jp-main-dock-panel').getByText('jovyan@').click();
await page.keyboard.type(`git checkout ${CI_BRANCH}`);
await page.keyboard.press('Enter');
}
env.isBranchSet = true;

console.log('url:' + env.getJuypterUrl(name.substring(3)));
await page.goto(env.getJuypterUrl(name.substring(3)));

Expand Down
24 changes: 24 additions & 0 deletions .tests/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"types": [
"node",
"jest"
],
"compilerOptions": {
"lib": [
"es2019"
],
"rootDir": ".",
"outDir": "build",
"resolveJsonModule": true,
"esModuleInterop": true,
},
"include": [
"src/**/*.ts",
"test/**/*.ts",
"test-helpers/**/*.ts",
"./package.json",
"./package-lock.json",
"./templates/**/*.mustache"
],
"exclude": ["node_modules"]
}
Loading

0 comments on commit 23382e9

Please sign in to comment.