Skip to content

Commit

Permalink
dadsadsazD
Browse files Browse the repository at this point in the history
  • Loading branch information
danielrozenberg committed Mar 11, 2024
1 parent f2504d3 commit 7e17795
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 171 deletions.
170 changes: 0 additions & 170 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -526,178 +526,8 @@ workflows:
- initialize_repository:
name: 'Initialize Repository'
<<: *push_and_pr_builds
- initialize_mac_os:
name: 'Initialize for Mac OS'
<<: *push_and_pr_builds
- checks:
name: 'Checks'
<<: *push_and_pr_builds
requires:
- 'Initialize Repository'
- unminified_build:
name: 'Unminified Build (Test)'
<<: *push_and_pr_builds
requires:
- 'Initialize Repository'
- dist:
matrix:
parameters:
module: ['Module', 'Nomodule']
purpose: ['Test', 'Bundle Size']
name: '⛓️ << matrix.module >> Build (<< matrix.purpose >>)'
<<: *push_and_pr_builds
requires:
- 'Initialize Repository'
- dist_3p:
matrix:
parameters:
module: ['Module', 'Nomodule']
purpose: ['Test', 'Bundle Size']
name: '<< matrix.module >> 3p Build (<< matrix.purpose >>)'
<<: *push_and_pr_builds
requires:
- 'Initialize Repository'
- bundle_size:
name: 'Bundle Size'
<<: *push_and_pr_builds
requires:
- '⛓️ Nomodule Build (Bundle Size)'
- 'Nomodule 3p Build (Bundle Size)'
- '⛓️ Module Build (Bundle Size)'
- 'Module 3p Build (Bundle Size)'
- validator_tests:
name: 'Validator Tests'
<<: *push_and_pr_builds
requires:
- 'Initialize Repository'
- visual_diff_tests:
name: 'Visual Diff Tests'
<<: *push_and_pr_builds
requires:
- '⛓️ Module Build (Test)'
- 'Module 3p Build (Test)'
- '⛓️ Nomodule Build (Test)'
- 'Nomodule 3p Build (Test)'
- local_unit_tests:
name: 'Local Unit Tests'
<<: *push_and_pr_builds
requires:
- 'Initialize Repository'
- all_unit_tests:
name: '⛓️ All Unit Tests'
<<: *push_and_pr_builds
requires:
- 'Local Unit Tests'
- unminified_tests:
name: 'Unminified Tests'
<<: *push_and_pr_builds
requires:
- 'Unminified Build (Test)'
- nomodule_tests:
name: 'Nomodule Tests (<< matrix.config >>)'
matrix:
parameters:
config: ['prod', 'canary']
<<: *push_and_pr_builds
requires:
- '⛓️ Nomodule Build (Test)'
- 'Nomodule 3p Build (Test)'
- module_tests:
name: 'Module Tests (<< matrix.config >>)'
matrix:
parameters:
config: ['prod', 'canary']
<<: *push_and_pr_builds
requires:
- '⛓️ Module Build (Test)'
- 'Module 3p Build (Test)'
- '⛓️ Nomodule Build (Test)'
- 'Nomodule 3p Build (Test)'
- end_to_end_tests:
name: '⛓️ End-to-End Tests'
<<: *push_and_pr_builds
requires:
- '⛓️ Nomodule Build (Test)'
- 'Nomodule 3p Build (Test)'
- browser_tests_safari:
name: '<< matrix.test_type >> Tests (Safari)'
matrix:
parameters:
test_type: ['Unit', 'Integration', 'End-to-End']
<<: *push_and_pr_builds
requires:
- 'Initialize for Mac OS'
- '⛓️ Nomodule Build (Test)'
- 'Nomodule 3p Build (Test)'
- browser_tests_firefox:
name: '<< matrix.test_type >> Tests (Firefox)'
matrix:
parameters:
test_type: ['Unit', 'Integration', 'End-to-End']
<<: *push_and_pr_builds
requires:
- '⛓️ Nomodule Build (Test)'
- 'Nomodule 3p Build (Test)'
- browser_tests_edge:
name: '<< matrix.test_type >> Tests (Edge)'
matrix:
parameters:
# Note: we can't run e2e tests on Edge.
test_type: ['Unit', 'Integration']
<<: *push_and_pr_builds
requires:
- '⛓️ Nomodule Build (Test)'
- 'Nomodule 3p Build (Test)'
- experiment_build:
name: 'Experiment << matrix.exp >> Build'
matrix:
parameters:
exp: ['A', 'B', 'C']
<<: *push_and_pr_builds
requires:
- 'Initialize Repository'
- experiment_integration_tests:
name: 'Exp. << matrix.exp >> Integration Tests'
matrix:
parameters:
exp: ['A', 'B', 'C']
<<: *push_and_pr_builds
requires:
- 'Experiment << matrix.exp >> Build'
- experiment_end_to_end_tests:
name: '⛓️ Exp. << matrix.exp >> End-to-End Tests'
matrix:
parameters:
exp: ['A', 'B', 'C']
<<: *push_and_pr_builds
requires:
- 'Experiment << matrix.exp >> Build'

'Release':
jobs:
- initialize_repository:
name: 'Initialize Repository'
<<: *release_builds_only
- amp_release:
name: '<< matrix.flavor >> << matrix.esm >>'
matrix:
parameters:
flavor: ['base', 'experimentA', 'experimentB', 'experimentC']
esm: ['no-esm', 'esm']
<<: *release_builds_only
requires:
- 'Initialize Repository'
- upload_release:
name: 'Upload Release'
<<: *release_builds_only
requires:
- amp_release
context:
- release-build-uploader
- trigger_promote:
name: 'Trigger Promote'
<<: *release_builds_only
requires:
- 'Upload Release'
context:
- release-build-uploader
2 changes: 2 additions & 0 deletions build-system/tasks/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ async function esbuildCompile(srcDir, srcFilename, destDir, options) {
* @return {Promise<void>}
*/
async function build(startTime) {
console.log('QWEQWEQWE: build() start');
if (!esbuildContext) {
esbuildContext = await esbuild.context({
entryPoints: [entryPoint],
Expand Down Expand Up @@ -415,6 +416,7 @@ async function esbuildCompile(srcDir, srcFilename, destDir, options) {
await esbuildContext.dispose();
esbuildContext = null;
}
console.log('QWEQWEQWE: build() end');
}

try {
Expand Down
11 changes: 10 additions & 1 deletion build-system/tasks/runtime-test/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,16 @@ async function createKarmaServer(config) {

karmaServer
.on('browser_start', karmaBrowserStart_)
.on('browser_complete', karmaBrowserComplete_);
.on('browser_complete', karmaBrowserComplete_)
.on('browser_error', (browser, err) => {
console.error('QWEQWEQWE:', browser, err);
})
.on('browser_register', (browser) => {
console.log('QWEQWEQWE: A new browser was registered', browser);
})
.on('run_complete', (browsers, results) => {
console.log('QWEQWEQWE: Run completed:', browsers, results);
});

karmaServer.start();

Expand Down
6 changes: 6 additions & 0 deletions build-system/tasks/runtime-test/runtime-test-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ class RuntimeTestRunner {
* @return {Promise<void>}
*/
async setup() {
console.log('QWEQWEQWE: setup() start');
await this.maybeBuild();
await startServer({
name: 'AMP Test Server',
Expand All @@ -323,26 +324,31 @@ class RuntimeTestRunner {
});
const handlerProcess = createCtrlcHandler(`amp ${this.config.testType}`);
this.env = new Map().set('handlerProcess', handlerProcess);
console.log('QWEQWEQWE: setup() end');
}

/**
* @return {Promise<void>}
*/
async run() {
console.log('QWEQWEQWE: run() start');
this.exitCode = await createKarmaServer(this.config);
console.log('QWEQWEQWE: run() done');
}

/**
* @return {Promise<void>}
*/
async teardown() {
console.log('QWEQWEQWE: teardown() start');
await stopServer();
exitCtrlcHandler(/** @type {Map} */ (this.env).get('handlerProcess'));
if (this.exitCode != 0) {
const message = `Karma test failed with exit code ${this.exitCode}`;
log(red('ERROR:'), yellow(message));
throw new Error(message);
}
console.log('QWEQWEQWE: teardown() end');
}
}

Expand Down
9 changes: 9 additions & 0 deletions build-system/tasks/unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ class Runner extends RuntimeTestRunner {

/** @override */
async maybeBuild() {
console.log('QWEQWEQWE: maybeBuild() start');
await analyticsVendorConfigs();
await css();
await compileJison();
console.log('QWEQWEQWE: maybeBuild() end');
}
}

Expand All @@ -39,10 +41,17 @@ async function unit() {

const config = new RuntimeTestConfig('unit');
const runner = new Runner(config);
console.log('QWEQWEQWE: unit():', {config, runner});

console.log('QWEQWEQWE: runner.setup(): start');
await runner.setup();
console.log('QWEQWEQWE: runner.setup(): end; runner.run() start');
await runner.run();
console.log(
'QWEQWEQWE: runner.setup(): runner.run() end; runner.teardown() start'
);
await runner.teardown();
console.log('QWEQWEQWE: runner.teardown(): end');
}

module.exports = {
Expand Down
21 changes: 21 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"@types/eslint": "8.56.5",
"@types/estree": "1.0.5",
"@types/fs-extra": "11.0.4",
"@types/karma": "6.3.8",
"@types/klaw": "3.0.6",
"@types/minimist": "1.2.5",
"@types/mocha": "10.0.6",
Expand Down

0 comments on commit 7e17795

Please sign in to comment.