From 7bc03416612c3dfa7344275455f81d5f9ab5e0ee Mon Sep 17 00:00:00 2001 From: harryadel Date: Sat, 13 Jan 2024 12:06:51 +0200 Subject: [PATCH 01/20] Replace validated method references with jam:method --- guide/source/methods.md | 44 ++++++++++++++++++---------------------- guide/source/security.md | 7 ++++--- 2 files changed, 24 insertions(+), 27 deletions(-) diff --git a/guide/source/methods.md b/guide/source/methods.md index a9689a2ef1..3db5ca7c3c 100644 --- a/guide/source/methods.md +++ b/guide/source/methods.md @@ -171,35 +171,35 @@ updateText.run.call({ userId: 'abcd' }, { As you can see, this approach to calling Methods results in a better development workflow - you can more easily deal with the different parts of the Method separately and test your code without having to deal with Meteor internals. But this approach requires you to write a lot of boilerplate on the Method definition side. -

Advanced Methods with mdg:validated-method

+

Advanced Methods with jam:method

-To alleviate some of the boilerplate that's involved in correct Method definitions, we've published a wrapper package called `mdg:validated-method` that does most of this for you. Here's the same Method as above, but defined with the package: +To alleviate some of the boilerplate that's involved in correct Method definitions, you can use a package called `jam:method` that does most of this for you. Here's the same Method as above, but defined with the package: ```js -import { ValidatedMethod } from 'meteor/mdg:validated-method'; +import { createMethod } from 'meteor/jam:method'; -export const updateText = new ValidatedMethod({ +export const updateText = createMethod({ name: 'todos.updateText', - validate: new SimpleSchema({ + schema: new SimpleSchema({ todoId: { type: String }, newText: { type: String } - }).validator(), - run({ todoId, newText }) { - const todo = Todos.findOne(todoId); - + }), + async run({ todoId, newText }) { + const todo = await Todos.findOneAsync(todoId); + if (!todo.editableBy(this.userId)) { throw new Meteor.Error('todos.updateText.unauthorized', 'Cannot edit todos in a private list that is not yours'); } - Todos.update(todoId, { + Todos.updateAsync(todoId, { $set: { text: newText } }); } }); ``` -You call it the same way you call the advanced Method above, but the Method definition is significantly simpler. We believe this style of Method lets you clearly see the important parts - the name of the Method sent over the wire, the format of the expected arguments, and the JavaScript namespace by which the Method can be referenced. Validated methods only accept a single argument and a callback function. +You call it the same way you call the advanced Method above, but the Method definition is significantly simpler. We believe this style of Method lets you clearly see the important parts - the name of the Method sent over the wire, the format of the expected arguments, and the JavaScript namespace by which the Method can be referenced.

Error handling

@@ -227,17 +227,13 @@ When the server was not able to complete the user's desired action because of a When a Method call fails because the arguments are of the wrong type, it's good to throw a `ValidationError`. This works like `Meteor.Error`, but is a custom constructor that enforces a standard error format that can be read by different form and validation libraries. In particular, if you are calling this Method from a form, throwing a `ValidationError` will make it possible to display nice error messages next to particular fields in the form. -When you use `mdg:validated-method` with `simpl-schema` as demonstrated above, this type of error is thrown for you. - -Read more about the error format in the [`mdg:validation-error` docs](https://atmospherejs.com/mdg/validation-error). -

Handling errors

When you call a Method, any errors thrown by it will be returned in the callback. At this point, you should identify which error type it is and display the appropriate message to the user. In this case, it is unlikely that the Method will throw a `ValidationError` or an internal server error, so we will only handle the unauthorized error: ```js // Call the Method -updateText.call({ +updateText({ todoId: '12345', newText: 'This is a todo item.' }, (err, res) => { @@ -261,7 +257,7 @@ We'll talk about how to handle the `ValidationError` in the section on forms bel

Errors in Method simulation

-When a Method is called, it usually runs twice---once on the client to simulate the result for Optimistic UI, and again on the server to make the actual change to the database. This means that if your Method throws an error, it will likely fail on the client _and_ the server. For this reason, `ValidatedMethod` turns on undocumented option in Meteor to avoid calling the server-side implementation if the simulation throws an error. +When a Method is called, it usually runs twice---once on the client to simulate the result for Optimistic UI, and again on the server to make the actual change to the database. This means that if your Method throws an error, it will likely fail on the client _and_ the server. For this reason, `jam:method` turns on [an option](https://github.com/jamauro/method#options-for-meteorapplyasync) in Meteor to avoid calling the server-side implementation if the simulation throws an error. While this behavior is good for saving server resources in cases where a Method will certainly fail, it's important to make sure that the simulation doesn't throw an error in cases where the server Method would have succeeded (for example, if you didn't load some data on the client that the Method needs to do the simulation properly). In this case, you can wrap server-side-only logic in a block that checks for a method simulation: @@ -283,13 +279,13 @@ const amountRegEx = /^\d*\.(\d\d)?$/; // This Method encodes the form validation requirements. // By defining them in the Method, we do client and server-side // validation in one place. -export const insert = new ValidatedMethod({ +export const insert = createMethod({ name: 'Invoices.methods.insert', - validate: new SimpleSchema({ + schema: new SimpleSchema({ email: { type: String, regEx: emailRegEx }, description: { type: String, min: 5 }, amount: { type: String, regEx: amountRegEx } - }).validator(), + }), run(newInvoice) { // In here, we can be sure that the newInvoice argument is // validated. @@ -299,7 +295,7 @@ export const insert = new ValidatedMethod({ 'Must be logged in to create an invoice.'); } - Invoices.insert(newInvoice) + Invoices.insertAsync(newInvoice) } }); ``` @@ -355,7 +351,7 @@ Template.Invoices_newInvoice.events({ amount: event.target.amount.value }; - insert.call(data, (err, res) => { + insert(data, (err, res) => { if (err) { if (err.error === 'validation-error') { // Initialize error object @@ -434,9 +430,9 @@ If we defined this Method in client and server code, as all Methods should be, a The client enters a special mode where it tracks all changes made to client-side collections, so that they can be rolled back later. When this step is complete, the user of your app sees their UI update instantly with the new content of the client-side database, but the server hasn't received any data yet. -If an exception is thrown from the Method simulation, then by default Meteor ignores it and continues to step (2). If you are using `ValidatedMethod` or pass a special `throwStubExceptions` option to `Meteor.apply`, then an exception thrown from the simulation will stop the server-side Method from running at all. +If an exception is thrown from the Method simulation, then by default Meteor ignores it and continues to step (2). If you are using `jam:method` or pass a special `throwStubExceptions` [option](https://github.com/jamauro/method#options-for-meteorapplyasync) to `Meteor.apply`, then an exception thrown from the simulation will stop the server-side Method from running at all. -The return value of the Method simulation is discarded, unless the `returnStubValue` option is passed when calling the Method, in which case it is returned to the Method caller. ValidatedMethod passes this option by default. +The return value of the Method simulation is discarded, unless the `returnStubValue` option is passed when calling the Method, in which case it is returned to the Method caller. `jam:method` passes this option by default.

2. A `method` DDP message is sent to the server

diff --git a/guide/source/security.md b/guide/source/security.md index a6060a4858..127ff13dc6 100644 --- a/guide/source/security.md +++ b/guide/source/security.md @@ -80,9 +80,9 @@ Meteor.methods({ If someone comes along and passes a non-ID selector like `{}`, they will end up deleting the entire collection. -

mdg:validated-method

+

jam:method

-To help you write good Methods that exhaustively validate their arguments, we've written a wrapper package for Methods that enforces argument validation. Read more about how to use it in the [Methods article](methods.html#validated-method). The rest of the code samples in this article will assume that you are using this package. If you aren't, you can still apply the same principles but the code will look a little different. +To help you write good Methods that exhaustively validate their arguments, you can use a community package for Methods that enforces argument validation. Read more about how to use it in the [Methods article](methods.html#jam-method). The rest of the code samples in this article will assume that you are using this package. If you aren't, you can still apply the same principles but the code will look a little different.

Don't pass userId from the client

@@ -200,7 +200,8 @@ if (Meteor.isServer) { This will make every Method only callable 5 times per second per connection. This is a rate limit that shouldn't be noticeable by the user at all, but will prevent a malicious script from totally flooding the server with requests. You will need to tune the limit parameters to match your app's needs. -If you're using validated methods, there's an available [ddp-rate-limiter-mixin](https://github.com/nlhuykhang/ddp-rate-limiter-mixin). +If you're using `jam:method`, it comes with built in [rate-limiting](https://github.com/jamauro/method#rate-limiting). +

Publications

From c03737c67bcf691d16aed0549133bfd732585315 Mon Sep 17 00:00:00 2001 From: Leonardo Venturini Date: Wed, 16 Oct 2024 14:44:34 -0400 Subject: [PATCH 02/20] bump to stable version --- packages/deprecated/http/package.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/deprecated/http/package.js b/packages/deprecated/http/package.js index 405387d200..b19ac4248e 100644 --- a/packages/deprecated/http/package.js +++ b/packages/deprecated/http/package.js @@ -1,6 +1,6 @@ Package.describe({ summary: "Make HTTP calls to remote servers", - version: '3.0.0-beta300.7', + version: '3.0.0', deprecated: 'Please use the fetch package' }); From 457ff50e02ccfa47a8a854d08bd0006dd717961f Mon Sep 17 00:00:00 2001 From: Leonardo Venturini Date: Fri, 18 Oct 2024 07:15:36 -0400 Subject: [PATCH 03/20] prevent generating dots which are not allowed in package names --- tools/utils/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/utils/utils.js b/tools/utils/utils.js index 8ccd4f5b5a..54bbfe0b31 100644 --- a/tools/utils/utils.js +++ b/tools/utils/utils.js @@ -202,7 +202,7 @@ exports.sleepMs = function (ms) { // Return a short, high entropy string without too many funny // characters in it. exports.randomToken = function () { - return (Math.random() * 0x100000000 + 1).toString(36); + return (Math.random() * 0x100000000 + 1).toString(36).replace('.', ''); }; // Like utils.randomToken, except a legal variable name, i.e. the first From 6f8b9f7900564ff9fc5ba46a4c3c060aa1bf2838 Mon Sep 17 00:00:00 2001 From: Leonardo Venturini Date: Fri, 18 Oct 2024 08:50:06 -0400 Subject: [PATCH 04/20] remove lodash --- packages/webapp/package.js | 1 - packages/webapp/webapp_server.js | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/webapp/package.js b/packages/webapp/package.js index d225d066db..9d5c36a641 100644 --- a/packages/webapp/package.js +++ b/packages/webapp/package.js @@ -13,7 +13,6 @@ Npm.depends({ send: "1.1.0", "stream-to-string": "1.2.1", qs: "6.13.0", - 'lodash.has': '4.5.2', "useragent-ng": "2.4.3", "tmp": "0.2.3", }); diff --git a/packages/webapp/webapp_server.js b/packages/webapp/webapp_server.js index 5b3ef24edf..5849c90642 100644 --- a/packages/webapp/webapp_server.js +++ b/packages/webapp/webapp_server.js @@ -19,7 +19,6 @@ import { } from './socket_file.js'; import cluster from 'cluster'; import { execSync } from 'child_process'; -import has from 'lodash.has'; var SHORT_SOCKET_TIMEOUT = 5 * 1000; var LONG_SOCKET_TIMEOUT = 120 * 1000; @@ -622,7 +621,7 @@ WebAppInternals.staticFilesMiddleware = async function( }; if ( - has(additionalStaticJs, pathname) && + pathname in additionalStaticJs && !WebAppInternals.inlineScriptsAllowed() ) { serveStaticJs(additionalStaticJs[pathname]); From 24d7a8dc3e053ecf24bba9bca95e59f0f40d1d73 Mon Sep 17 00:00:00 2001 From: Leonardo Venturini Date: Fri, 18 Oct 2024 09:51:17 -0400 Subject: [PATCH 05/20] fix test-helpers --- packages/test-helpers/async_multi.js | 18 +++++++++--------- packages/test-helpers/callback_logger.js | 19 ++++++++----------- packages/test-helpers/connection_server.js | 4 +--- packages/test-helpers/package.js | 6 ------ .../test-helpers/try_all_permutations_test.js | 2 +- 5 files changed, 19 insertions(+), 30 deletions(-) diff --git a/packages/test-helpers/async_multi.js b/packages/test-helpers/async_multi.js index 1286508fde..c9c09ac66e 100644 --- a/packages/test-helpers/async_multi.js +++ b/packages/test-helpers/async_multi.js @@ -53,31 +53,31 @@ var ExpectationManager = function (test, onComplete) { }; Object.assign(ExpectationManager.prototype, { - expect: function (...args) { + expect: function (/* arguments */) { var self = this; - if (typeof args[0] === "function") - var expected = args[0]; + if (typeof arguments[0] === "function") + var expected = arguments[0]; else - var expected = args; + var expected = Array.from(arguments); if (self.closed) throw new Error("Too late to add more expectations to the test"); self.outstanding++; - return async function (...args) { + return async function (/* arguments */) { if (self.dead) return; if (typeof expected === "function") { try { - await expected.apply({}, args); + await expected.apply({}, arguments); } catch (e) { if (self.cancel()) self.test.exception(e); } } else { - self.test.equal(args, expected); + self.test.equal(Array.from(arguments), expected); } self.outstanding--; @@ -115,12 +115,12 @@ testAsyncMulti = function (name, funcs, { isOnly = false } = {}) { const addFunction = isOnly ? Tinytest.onlyAsync : Tinytest.addAsync; addFunction(name, function (test, onComplete) { - var remaining = Object.assign({}, funcs); + var remaining = [...funcs] var context = {}; var i = 0; var runNext = function () { - var func = Object.values(remaining).shift(); + var func = remaining.shift(); if (!func) { delete test.extraDetails.asyncBlock; onComplete(); diff --git a/packages/test-helpers/callback_logger.js b/packages/test-helpers/callback_logger.js index 2f98cbe8de..299edf94e6 100644 --- a/packages/test-helpers/callback_logger.js +++ b/packages/test-helpers/callback_logger.js @@ -1,6 +1,3 @@ -import isEmpty from 'lodash.isempty'; -import isEqual from 'lodash.isequal'; - // This file allows you to write tests that expect certain callbacks to be // called in certain orders, or optionally in groups where the order does not // matter. It can be set up in either a synchronous manner, so that each @@ -24,11 +21,9 @@ var CallbackLogger = function (test, callbackNames) { var self = this; self._log = []; self._test = test; - self._yielded = false; callbackNames.forEach(function (callbackName) { - self[callbackName] = function () { - var args = Array.from(arguments); - self._log.push({callback: callbackName, args: args}); + self[callbackName] = function (...args) { + self._log.push({ callback: callbackName, args }); }; }); }; @@ -36,7 +31,7 @@ var CallbackLogger = function (test, callbackNames) { CallbackLogger.prototype.expectResult = async function (callbackName, args) { var self = this; await self._waitForLengthOrTimeout(1); - if (isEmpty(self._log)) { + if (self._log.length === 0) { self._test.fail(["Expected callback " + callbackName + " got none"]); return; } @@ -78,13 +73,15 @@ CallbackLogger.prototype.expectResultUnordered = async function (list) { await self._waitForLengthOrTimeout(list.length); - list = [...list]; // shallow copy. + list = [...list]; + var i = list.length; + while (i > 0) { var found = false; var dequeued = self._log.shift(); for (var j = 0; j < list.length; j++) { - if (isEqual(list[j], dequeued)) { + if (list[j] === dequeued) { list.splice(j, 1); found = true; break; @@ -114,4 +111,4 @@ CallbackLogger.prototype.expectNoResult = async function (fn) { await self._waitForLengthOrTimeout(0); self._expectNoResultImpl(); -}; \ No newline at end of file +}; diff --git a/packages/test-helpers/connection_server.js b/packages/test-helpers/connection_server.js index ffb15ad5bc..255bfed03d 100644 --- a/packages/test-helpers/connection_server.js +++ b/packages/test-helpers/connection_server.js @@ -1,5 +1,3 @@ -import isString from 'lodash.isstring'; - // Establish a connection from the server to the server, and wait // until the client side of the connection has received the session // id. On success call `succeeded` with two arguments, the client @@ -15,7 +13,7 @@ makeTestConnection = function (test, succeeded, failed) { // Add incoming connections to `serverConns`. var onConnectionHandle = Meteor.onConnection(function (serverConn) { - test.isTrue(isString(serverConn.id), "connection handle id exists and is a string"); + test.isTrue(typeof serverConn.id === 'string', "connection handle id exists and is a string"); if (serverConns[serverConn.id]) { test.fail("onConnection callback called multiple times for same session id"); failed(); diff --git a/packages/test-helpers/package.js b/packages/test-helpers/package.js index bb7f296c60..e8680d12ad 100644 --- a/packages/test-helpers/package.js +++ b/packages/test-helpers/package.js @@ -3,12 +3,6 @@ Package.describe({ version: "2.0.1", }); -Npm.depends({ - 'lodash.isequal': '4.5.0', - 'lodash.isempty': '4.4.0', - 'lodash.isstring': '4.0.1' -}); - Package.onUse(function (api) { api.use([ "ecmascript", diff --git a/packages/test-helpers/try_all_permutations_test.js b/packages/test-helpers/try_all_permutations_test.js index 4c9b451fff..91378b1bf8 100644 --- a/packages/test-helpers/try_all_permutations_test.js +++ b/packages/test-helpers/try_all_permutations_test.js @@ -61,7 +61,7 @@ Tinytest.add("test-helpers - try_all_permutations", function (test) { var seen = {}; for (var i = 0; i < n; i++) - fs.push(function (x) { seq += x + "_"; }.bind(null, i)); + fs.push((function (x) { seq += x + "_"; }).bind(null, i)); try_all_permutations( function () {seq = "";}, fs, From cbeb51fd203369585941450e4dc589eaf3fd935a Mon Sep 17 00:00:00 2001 From: Leonardo Venturini Date: Fri, 18 Oct 2024 09:52:06 -0400 Subject: [PATCH 06/20] adjust test-in-console --- .envrc | 4 ++ packages/test-in-console/package.js | 8 +-- packages/test-in-console/phantomRunner.js | 69 ------------------- ...puppeteerRunner.js => puppeteer_runner.js} | 11 ++- packages/test-in-console/reporter.js | 13 +--- packages/test-in-console/run.sh | 25 ++----- 6 files changed, 25 insertions(+), 105 deletions(-) delete mode 100644 packages/test-in-console/phantomRunner.js rename packages/test-in-console/{puppeteerRunner.js => puppeteer_runner.js} (94%) diff --git a/.envrc b/.envrc index a60b67f960..47ab5b6410 100644 --- a/.envrc +++ b/.envrc @@ -27,6 +27,10 @@ function @test-self { @meteor self-test "$@" } +function @test-in-console { + "$ROOT_DIR/packages/test-in-console/run.sh" "$@" +} + function @check-syntax { node "$ROOT_DIR/scripts/admin/check-legacy-syntax/check-syntax.js" } diff --git a/packages/test-in-console/package.js b/packages/test-in-console/package.js index 810f07e1f3..c2e880562a 100644 --- a/packages/test-in-console/package.js +++ b/packages/test-in-console/package.js @@ -4,7 +4,9 @@ Package.describe({ }); Package.onUse(function(api) { - api.use(['tinytest', 'random', 'ejson', 'check']); + api.versionsFrom('3.0.1'); + + api.use(['tinytest', 'random', 'ejson', 'check', 'ecmascript']); api.use('fetch', 'server'); api.export('TEST_STATUS', 'client'); @@ -13,9 +15,7 @@ Package.onUse(function(api) { api.addFiles(['reporter.js'], 'server'); - // This is to be run by phantomjs, not as part of normal package code. - api.addAssets('phantomRunner.js', 'server'); - api.addAssets('puppeteerRunner.js', 'server'); + api.addAssets('puppeteer_runner.js', 'server'); api.export('runTests'); }); diff --git a/packages/test-in-console/phantomRunner.js b/packages/test-in-console/phantomRunner.js deleted file mode 100644 index 43fc0b8c47..0000000000 --- a/packages/test-in-console/phantomRunner.js +++ /dev/null @@ -1,69 +0,0 @@ -var createPage = require('webpage').create; -var system = require('system'); -var platform = system.args[1] || 'local'; -var platformUrl = system.env.URL + platform; -var testUrls = [ - // Additional application URLs can be added here to re-run tests in - // PhantomJS with different query parameter-based configurations. - platformUrl -]; - -function runNextUrl() { - var url = testUrls.shift(); - if (!url) { - phantom.exit(0); - return; - } - - console.log('Running Meteor tests in PhantomJS... ' + url); - - var page = createPage(); - - page.onConsoleMessage = function(message) { - console.log(message); - }; - - page.open(url); - - function poll() { - if (isDone(page)) { - var failCount = getFailCount(page); - if (failCount > 0) { - phantom.exit(1); - } else { - page.close(); - setTimeout(runNextUrl, 1000); - } - } else { - setTimeout(poll, 1000); - } - } - - poll(); -} - -function isDone(page) { - return page.evaluate(function() { - if (typeof TEST_STATUS !== 'undefined') { - return TEST_STATUS.DONE; - } - - return typeof DONE !== 'undefined' && DONE; - }); -} - -function getFailCount(page) { - return page.evaluate(function() { - if (typeof TEST_STATUS !== 'undefined') { - return TEST_STATUS.FAILURES; - } - - if (typeof FAILURES === 'undefined') { - return 1; - } - - return 0; - }); -} - -runNextUrl(); diff --git a/packages/test-in-console/puppeteerRunner.js b/packages/test-in-console/puppeteer_runner.js similarity index 94% rename from packages/test-in-console/puppeteerRunner.js rename to packages/test-in-console/puppeteer_runner.js index d0a59ae9c9..7299fe66f8 100644 --- a/packages/test-in-console/puppeteerRunner.js +++ b/packages/test-in-console/puppeteer_runner.js @@ -5,6 +5,10 @@ let testNumber = 0; async function runNextUrl(browser) { const page = await browser.newPage(); + page.on('console', msg => { + console.log('PAGE LOG:', msg.text()); + }); + page.on('console', async msg => { // this is a way to make sure the travis does not timeout // if the test is running for too long without any output to the console (10 minutes) @@ -21,6 +25,8 @@ async function runNextUrl(browser) { const currentServerTest = await page.evaluate(async () => await __Tinytest._getCurrentRunningTestOnServer()); + console.log({ currentClientTest, currentServerTest }) + if (currentServerTest !== '') { console.log(`Currently running on the server test: ${ currentServerTest }`); return; @@ -58,7 +64,7 @@ async function runNextUrl(browser) { } } - poll(); + await poll(); } /** @@ -130,9 +136,10 @@ async function runTests() { '--disable-setuid-sandbox', '--disable-web-security', ], + headless: "new", }); console.log(`Using version: ${await browser.version()}`); - runNextUrl(browser); + await runNextUrl(browser) } runTests().catch((e) => diff --git a/packages/test-in-console/reporter.js b/packages/test-in-console/reporter.js index 099e43a81c..7fb49b28ce 100644 --- a/packages/test-in-console/reporter.js +++ b/packages/test-in-console/reporter.js @@ -1,14 +1,7 @@ -// A hacky way to extract the phantom runner script from the package. -if (process.env.WRITE_RUNNER_JS) { - Npm.require('fs').writeFileSync( - process.env.WRITE_RUNNER_JS, Buffer.from(Assets.getBinary('runner.js'))); -} +let url = null; -var url = null; -if (Meteor.settings && - Meteor.settings.public && - Meteor.settings.public.runId && - Meteor.settings.public.reportTo) { +if (Meteor.settings?.public?.runId && + Meteor.settings?.public?.reportTo) { url = Meteor.settings.public.reportTo + "/report/" + Meteor.settings.public.runId; diff --git a/packages/test-in-console/run.sh b/packages/test-in-console/run.sh index 38012a605d..9a6231d209 100755 --- a/packages/test-in-console/run.sh +++ b/packages/test-in-console/run.sh @@ -8,36 +8,21 @@ cd $(dirname $0)/../.. export METEOR_HOME=`pwd` -export phantom=$phantom - -# only install dependencies if required -if [ "$phantom" = true ] -then - # Just in case these packages haven't been installed elsewhere. - ./meteor npm install -g phantomjs-prebuilt browserstack-webdriver -else - # Installs into dev_bundle/lib/node_modules/puppeteer. - ./meteor npm install -g puppeteer@20.4.0 -fi +# Installs into dev_bundle/lib/node_modules/puppeteer. +./meteor npm install -g puppeteer@20.4.0 export PATH=$METEOR_HOME:$PATH -# synchronously get the dev bundle and NPM modules if they're not there. -./meteor --help || exit 1 export URL='http://127.0.0.1:4096/' export METEOR_PACKAGE_DIRS='packages/deprecated' -exec 3< <(meteor test-packages --driver-package test-in-console -p 4096 --exclude ${TEST_PACKAGES_EXCLUDE:-''} $1) +exec 3< <(./meteor test-packages --driver-package test-in-console -p 4096 --exclude ${TEST_PACKAGES_EXCLUDE:-''} $1) EXEC_PID=$! +trap "pkill -TERM -P $EXEC_PID; exit 1" SIGINT sed '/test-in-console listening$/q' <&3 -if [ "$phantom" = true ] -then - ./dev_bundle/bin/phantomjs "$METEOR_HOME/packages/test-in-console/phantomRunner.js" -else - node "$METEOR_HOME/packages/test-in-console/puppeteerRunner.js" -fi +node --trace-warnings "$METEOR_HOME/packages/test-in-console/puppeteer_runner.js" STATUS=$? From 4d39ba67c740337832c29ac96cc3e2edc57e87a5 Mon Sep 17 00:00:00 2001 From: Leonardo Venturini Date: Fri, 18 Oct 2024 09:52:25 -0400 Subject: [PATCH 07/20] shrinkwrap --- .../.npm/package/npm-shrinkwrap.json | 12 ++++++------ .../compileStylusBatch/npm-shrinkwrap.json | 18 +++++++++--------- .../email/.npm/package/npm-shrinkwrap.json | 6 +++--- .../webapp/.npm/package/npm-shrinkwrap.json | 11 +++-------- 4 files changed, 21 insertions(+), 26 deletions(-) diff --git a/packages/accounts-2fa/.npm/package/npm-shrinkwrap.json b/packages/accounts-2fa/.npm/package/npm-shrinkwrap.json index ebacac28ad..64d0411523 100644 --- a/packages/accounts-2fa/.npm/package/npm-shrinkwrap.json +++ b/packages/accounts-2fa/.npm/package/npm-shrinkwrap.json @@ -2,9 +2,9 @@ "lockfileVersion": 4, "dependencies": { "@types/node": { - "version": "22.7.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", - "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==" + "version": "22.7.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.6.tgz", + "integrity": "sha512-/d7Rnj0/ExXDMcioS78/kf1lMzYk4BZV8MZGTBKzTGZ6/406ukkbYlIsZmMPhcR5KlkunDHQLrtAVmSq7r+mSw==" }, "@types/notp": { "version": "2.0.5", @@ -32,9 +32,9 @@ "integrity": "sha512-OEI0IWCe+Dw46019YLl6V10Us5bi574EvlJEOcAkB29IzQ/mYD1A6RyNHLjZPiHCmuodxvgF6U+vZO1L15lxVA==" }, "tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.0.tgz", + "integrity": "sha512-jWVzBLplnCmoaTr13V9dYbiQ99wvZRd0vNWaDRg+aVYRcjDF3nDksxFDE/+fkXnKhpnUUkmx5pK/v8mCtLVqZA==" }, "undici-types": { "version": "6.19.8", diff --git a/packages/deprecated/stylus/.npm/plugin/compileStylusBatch/npm-shrinkwrap.json b/packages/deprecated/stylus/.npm/plugin/compileStylusBatch/npm-shrinkwrap.json index 4bc9ce2a15..1fe92eee26 100644 --- a/packages/deprecated/stylus/.npm/plugin/compileStylusBatch/npm-shrinkwrap.json +++ b/packages/deprecated/stylus/.npm/plugin/compileStylusBatch/npm-shrinkwrap.json @@ -32,9 +32,9 @@ "integrity": "sha512-fKSWtyNQTclfi1A+s2KU91/r1mfANG1ZibxTdCwJGfV1J9UwcV22plFOm0wkaq4WzqW87zxiAkyp2Ho1Wn1NnA==" }, "caniuse-db": { - "version": "1.0.30001640", - "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30001640.tgz", - "integrity": "sha512-K8/5iWoH/NULlqJz/iaopQJraQCHGcFGvs8dmTpAH7GyvoQu2Xq8ht3jq2c+wNck4bgQu/PHu2GN2mJfUj9qtw==" + "version": "1.0.30001669", + "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30001669.tgz", + "integrity": "sha512-GK+G6CnRZ7IY2J2H3bcm9kshwHcJ4ZWDC5u9WaIh7DQAAHHeuxIPtaZd15GMTmGvGbDx/u1AcQs3MYur9Tem7A==" }, "concat-map": { "version": "0.0.1", @@ -47,9 +47,9 @@ "integrity": "sha512-OI38lO4JQQX2GSisTqwiSFxiWNmLajXdW4tCCxAuiwGKjusHALQadSHBSxGlU8lrFp47IkLuU2AfSYz31qpETQ==" }, "debug": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", - "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==" + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", + "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==" }, "fs.realpath": { "version": "1.0.0", @@ -97,9 +97,9 @@ "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==" }, "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, "multi-stage-sourcemap": { "version": "0.2.1", diff --git a/packages/email/.npm/package/npm-shrinkwrap.json b/packages/email/.npm/package/npm-shrinkwrap.json index fcc8fd64c8..68404a03da 100644 --- a/packages/email/.npm/package/npm-shrinkwrap.json +++ b/packages/email/.npm/package/npm-shrinkwrap.json @@ -2,9 +2,9 @@ "lockfileVersion": 4, "dependencies": { "@types/node": { - "version": "22.7.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", - "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==" + "version": "22.7.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.6.tgz", + "integrity": "sha512-/d7Rnj0/ExXDMcioS78/kf1lMzYk4BZV8MZGTBKzTGZ6/406ukkbYlIsZmMPhcR5KlkunDHQLrtAVmSq7r+mSw==" }, "@types/nodemailer": { "version": "6.4.14", diff --git a/packages/webapp/.npm/package/npm-shrinkwrap.json b/packages/webapp/.npm/package/npm-shrinkwrap.json index 39ebcd33bb..e904107de5 100644 --- a/packages/webapp/.npm/package/npm-shrinkwrap.json +++ b/packages/webapp/.npm/package/npm-shrinkwrap.json @@ -32,9 +32,9 @@ "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==" }, "@types/node": { - "version": "22.7.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", - "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==" + "version": "22.7.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.6.tgz", + "integrity": "sha512-/d7Rnj0/ExXDMcioS78/kf1lMzYk4BZV8MZGTBKzTGZ6/406ukkbYlIsZmMPhcR5KlkunDHQLrtAVmSq7r+mSw==" }, "@types/qs": { "version": "6.9.16", @@ -514,11 +514,6 @@ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==" }, - "undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" - }, "unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", From 6112f87102a7147df74b05f86c333c534791be8a Mon Sep 17 00:00:00 2001 From: Leonardo Venturini Date: Fri, 18 Oct 2024 09:55:21 -0400 Subject: [PATCH 08/20] cleanup --- packages/test-in-console/puppeteer_runner.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/test-in-console/puppeteer_runner.js b/packages/test-in-console/puppeteer_runner.js index 7299fe66f8..0ad644d070 100644 --- a/packages/test-in-console/puppeteer_runner.js +++ b/packages/test-in-console/puppeteer_runner.js @@ -5,9 +5,9 @@ let testNumber = 0; async function runNextUrl(browser) { const page = await browser.newPage(); - page.on('console', msg => { - console.log('PAGE LOG:', msg.text()); - }); + // page.on('console', msg => { + // console.log('PAGE LOG:', msg.text()); + // }); page.on('console', async msg => { // this is a way to make sure the travis does not timeout @@ -25,8 +25,6 @@ async function runNextUrl(browser) { const currentServerTest = await page.evaluate(async () => await __Tinytest._getCurrentRunningTestOnServer()); - console.log({ currentClientTest, currentServerTest }) - if (currentServerTest !== '') { console.log(`Currently running on the server test: ${ currentServerTest }`); return; From bb4ca37afde8ce149599718aa19cd01298e7a521 Mon Sep 17 00:00:00 2001 From: Leonardo Venturini Date: Fri, 18 Oct 2024 09:56:25 -0400 Subject: [PATCH 09/20] cannot use it here --- packages/test-in-console/package.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/test-in-console/package.js b/packages/test-in-console/package.js index c2e880562a..04a0729eb2 100644 --- a/packages/test-in-console/package.js +++ b/packages/test-in-console/package.js @@ -4,8 +4,6 @@ Package.describe({ }); Package.onUse(function(api) { - api.versionsFrom('3.0.1'); - api.use(['tinytest', 'random', 'ejson', 'check', 'ecmascript']); api.use('fetch', 'server'); From 5c11763385d1b6fab282bc57363b675c246aa653 Mon Sep 17 00:00:00 2001 From: Leonardo Venturini Date: Mon, 21 Oct 2024 08:43:58 -0400 Subject: [PATCH 10/20] replace travis with github workflow --- .../workflows/test-deprecated-packages.yml | 40 +++++++++++++++++++ .travis.yml | 32 --------------- 2 files changed, 40 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/test-deprecated-packages.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/test-deprecated-packages.yml b/.github/workflows/test-deprecated-packages.yml new file mode 100644 index 0000000000..c5722582ad --- /dev/null +++ b/.github/workflows/test-deprecated-packages.yml @@ -0,0 +1,40 @@ +name: Test Deprecated Packages + +on: + push: + branches: + - main + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + env: + PUPPETEER_DOWNLOAD_PATH: ~/.npm/chromium + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 20.15.1 + + - name: Cache Node.js modules + uses: actions/cache@v3 + with: + path: | + ~/.npm + .meteor + .babel-cache + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Install dependencies + run: npm install + + - name: Run tests + run: ./packages/test-in-console/run.sh \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4d9997a4d7..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -language: node_js -os: linux -dist: jammy -sudo: required -services: xvfb -node_js: - - "20.15.1" -cache: - directories: - - ".meteor" - - ".babel-cache" -script: - - travis_retry ./packages/test-in-console/run.sh -env: - global: - - CXX=g++-12 - - phantom=false - - PUPPETEER_DOWNLOAD_PATH=~/.npm/chromium -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-12 - - libnss3 - -before_install: - - cat /etc/apt/sources.list - - python3 --version - - echo "deb http://archive.ubuntu.com/ubuntu jammy main universe" | sudo tee -a /etc/apt/sources.list - - sudo apt-get update - - sudo apt-get install -y libnss3 From bcfaa06f03f52a170469ac863ac16473a3877f73 Mon Sep 17 00:00:00 2001 From: Leonardo Venturini Date: Mon, 21 Oct 2024 08:47:40 -0400 Subject: [PATCH 11/20] add chromium --- .github/workflows/test-deprecated-packages.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-deprecated-packages.yml b/.github/workflows/test-deprecated-packages.yml index c5722582ad..9bdee3b6ff 100644 --- a/.github/workflows/test-deprecated-packages.yml +++ b/.github/workflows/test-deprecated-packages.yml @@ -10,13 +10,18 @@ jobs: build: runs-on: ubuntu-latest - env: - PUPPETEER_DOWNLOAD_PATH: ~/.npm/chromium - steps: - name: Checkout code uses: actions/checkout@v3 + - name: Install Chromium + run: | + sudo apt-get update + sudo apt-get install -y chromium-browser + + - name: Set PUPPETEER_EXECUTABLE_PATH + run: echo "PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser" >> $GITHUB_ENV + - name: Set up Node.js uses: actions/setup-node@v3 with: From 5d676fb9f2b7f81edfe58a6014e7612024c7ffc1 Mon Sep 17 00:00:00 2001 From: Leonardo Venturini Date: Mon, 21 Oct 2024 09:03:41 -0400 Subject: [PATCH 12/20] try this --- .github/workflows/test-deprecated-packages.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-deprecated-packages.yml b/.github/workflows/test-deprecated-packages.yml index 9bdee3b6ff..d1a0c402e6 100644 --- a/.github/workflows/test-deprecated-packages.yml +++ b/.github/workflows/test-deprecated-packages.yml @@ -8,20 +8,15 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 + + env: + PUPPETEER_DOWNLOAD_PATH: .npm/chromium steps: - name: Checkout code uses: actions/checkout@v3 - - name: Install Chromium - run: | - sudo apt-get update - sudo apt-get install -y chromium-browser - - - name: Set PUPPETEER_EXECUTABLE_PATH - run: echo "PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser" >> $GITHUB_ENV - - name: Set up Node.js uses: actions/setup-node@v3 with: From ae0afae9e486416b6e022da5a8d3f5d4f0673db9 Mon Sep 17 00:00:00 2001 From: Leonardo Venturini Date: Mon, 21 Oct 2024 09:06:24 -0400 Subject: [PATCH 13/20] needs to be absolute --- .github/workflows/test-deprecated-packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-deprecated-packages.yml b/.github/workflows/test-deprecated-packages.yml index d1a0c402e6..b16ee7177a 100644 --- a/.github/workflows/test-deprecated-packages.yml +++ b/.github/workflows/test-deprecated-packages.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-20.04 env: - PUPPETEER_DOWNLOAD_PATH: .npm/chromium + PUPPETEER_DOWNLOAD_PATH: /home/runner/.npm/chromium steps: - name: Checkout code From 64f272241abad525be048921b097fe808c36103b Mon Sep 17 00:00:00 2001 From: Leonardo Venturini Date: Mon, 21 Oct 2024 09:08:59 -0400 Subject: [PATCH 14/20] cancel previous runs on new pushes --- .github/workflows/meteor-selftest-windows.yml | 3 +++ .github/workflows/test-deprecated-packages.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/meteor-selftest-windows.yml b/.github/workflows/meteor-selftest-windows.yml index d78f633ec3..187b20be0f 100644 --- a/.github/workflows/meteor-selftest-windows.yml +++ b/.github/workflows/meteor-selftest-windows.yml @@ -22,6 +22,9 @@ env: jobs: test: runs-on: windows-2019-meteor + concurrency: + group: ${{ github.head_ref }} + cancel-in-progress: true steps: - name: Checkout code diff --git a/.github/workflows/test-deprecated-packages.yml b/.github/workflows/test-deprecated-packages.yml index b16ee7177a..3463fdea19 100644 --- a/.github/workflows/test-deprecated-packages.yml +++ b/.github/workflows/test-deprecated-packages.yml @@ -9,6 +9,9 @@ on: jobs: build: runs-on: ubuntu-20.04 + concurrency: + group: ${{ github.head_ref }} + cancel-in-progress: true env: PUPPETEER_DOWNLOAD_PATH: /home/runner/.npm/chromium From f46d9059adb9d3abdda7f48a33d2309d80411d05 Mon Sep 17 00:00:00 2001 From: Leonardo Venturini Date: Mon, 21 Oct 2024 09:17:46 -0400 Subject: [PATCH 15/20] fix test --- packages/test-helpers/callback_logger.js | 4 +++- packages/test-helpers/package.js | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/test-helpers/callback_logger.js b/packages/test-helpers/callback_logger.js index 299edf94e6..0cac2c825c 100644 --- a/packages/test-helpers/callback_logger.js +++ b/packages/test-helpers/callback_logger.js @@ -1,3 +1,5 @@ +import isEqual from 'lodash.isequal'; + // This file allows you to write tests that expect certain callbacks to be // called in certain orders, or optionally in groups where the order does not // matter. It can be set up in either a synchronous manner, so that each @@ -81,7 +83,7 @@ CallbackLogger.prototype.expectResultUnordered = async function (list) { var found = false; var dequeued = self._log.shift(); for (var j = 0; j < list.length; j++) { - if (list[j] === dequeued) { + if (isEqual(list[j], dequeued)) { list.splice(j, 1); found = true; break; diff --git a/packages/test-helpers/package.js b/packages/test-helpers/package.js index e8680d12ad..8eea18c3f9 100644 --- a/packages/test-helpers/package.js +++ b/packages/test-helpers/package.js @@ -3,6 +3,10 @@ Package.describe({ version: "2.0.1", }); +Npm.depends({ + 'lodash.isequal': '4.5.0', +}) + Package.onUse(function (api) { api.use([ "ecmascript", From 7a83d69b34abf083acbb85c72006059dd3a9c7ce Mon Sep 17 00:00:00 2001 From: Leonardo Venturini Date: Mon, 21 Oct 2024 09:18:53 -0400 Subject: [PATCH 16/20] install deps --- .github/workflows/test-deprecated-packages.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test-deprecated-packages.yml b/.github/workflows/test-deprecated-packages.yml index 3463fdea19..b5d8aa839b 100644 --- a/.github/workflows/test-deprecated-packages.yml +++ b/.github/workflows/test-deprecated-packages.yml @@ -17,6 +17,9 @@ jobs: PUPPETEER_DOWNLOAD_PATH: /home/runner/.npm/chromium steps: + - name: Update and install dependencies + run: sudo apt-get update && sudo apt-get install -y libnss3 g++-12 + - name: Checkout code uses: actions/checkout@v3 From c6354d8604ef17d0d4220030224b330c01daf8bc Mon Sep 17 00:00:00 2001 From: Leonardo Venturini Date: Mon, 21 Oct 2024 09:22:23 -0400 Subject: [PATCH 17/20] adjust group --- .github/workflows/meteor-selftest-windows.yml | 2 +- .github/workflows/test-deprecated-packages.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/meteor-selftest-windows.yml b/.github/workflows/meteor-selftest-windows.yml index 187b20be0f..2935532c1b 100644 --- a/.github/workflows/meteor-selftest-windows.yml +++ b/.github/workflows/meteor-selftest-windows.yml @@ -23,7 +23,7 @@ jobs: test: runs-on: windows-2019-meteor concurrency: - group: ${{ github.head_ref }} + group: ${{ github.head_ref }}-meteor-selftest-windows cancel-in-progress: true steps: diff --git a/.github/workflows/test-deprecated-packages.yml b/.github/workflows/test-deprecated-packages.yml index b5d8aa839b..8d033b91aa 100644 --- a/.github/workflows/test-deprecated-packages.yml +++ b/.github/workflows/test-deprecated-packages.yml @@ -10,7 +10,7 @@ jobs: build: runs-on: ubuntu-20.04 concurrency: - group: ${{ github.head_ref }} + group: ${{ github.head_ref }}-test-deprecated-packages cancel-in-progress: true env: From b593ef42fa99525cdb2ebbdb58bb160a392936c7 Mon Sep 17 00:00:00 2001 From: Leonardo Venturini Date: Mon, 21 Oct 2024 09:36:04 -0400 Subject: [PATCH 18/20] use latest --- .github/workflows/test-deprecated-packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-deprecated-packages.yml b/.github/workflows/test-deprecated-packages.yml index 8d033b91aa..d3d1cf29a9 100644 --- a/.github/workflows/test-deprecated-packages.yml +++ b/.github/workflows/test-deprecated-packages.yml @@ -8,7 +8,7 @@ on: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest concurrency: group: ${{ github.head_ref }}-test-deprecated-packages cancel-in-progress: true From ad9ea2a533cded596ee433a5d7fc7b4eb4aa6fa1 Mon Sep 17 00:00:00 2001 From: Leonardo Venturini Date: Mon, 21 Oct 2024 09:45:28 -0400 Subject: [PATCH 19/20] set timeout and add dev_bundle to cache --- .github/workflows/test-deprecated-packages.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-deprecated-packages.yml b/.github/workflows/test-deprecated-packages.yml index d3d1cf29a9..e19be07913 100644 --- a/.github/workflows/test-deprecated-packages.yml +++ b/.github/workflows/test-deprecated-packages.yml @@ -12,6 +12,7 @@ jobs: concurrency: group: ${{ github.head_ref }}-test-deprecated-packages cancel-in-progress: true + timeout-minutes: 60 env: PUPPETEER_DOWNLOAD_PATH: /home/runner/.npm/chromium @@ -35,7 +36,9 @@ jobs: ~/.npm .meteor .babel-cache - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + dev_bundle + /home/runner/.npm/chromium + key: ${{ runner.os }}-node-${{ hashFiles('meteor', '**/package-lock.json') }} restore-keys: | ${{ runner.os }}-node- From 230a3c2eb3236047728562d38f37577033983661 Mon Sep 17 00:00:00 2001 From: Leonardo Venturini Date: Mon, 21 Oct 2024 09:53:18 -0400 Subject: [PATCH 20/20] add travis ci back until we figure out how the github workflow should work --- .../workflows/test-deprecated-packages.yml | 13 +++++--- .travis.yml | 32 +++++++++++++++++++ 2 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 .travis.yml diff --git a/.github/workflows/test-deprecated-packages.yml b/.github/workflows/test-deprecated-packages.yml index e19be07913..e4ed12fe92 100644 --- a/.github/workflows/test-deprecated-packages.yml +++ b/.github/workflows/test-deprecated-packages.yml @@ -1,10 +1,13 @@ name: Test Deprecated Packages -on: - push: - branches: - - main - pull_request: +# Disabled until we figure out how to fix the error from puppeteer +# Runs on Travis CI for now +# +#on: +# push: +# branches: +# - main +# pull_request: jobs: build: diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..4d9997a4d7 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,32 @@ +language: node_js +os: linux +dist: jammy +sudo: required +services: xvfb +node_js: + - "20.15.1" +cache: + directories: + - ".meteor" + - ".babel-cache" +script: + - travis_retry ./packages/test-in-console/run.sh +env: + global: + - CXX=g++-12 + - phantom=false + - PUPPETEER_DOWNLOAD_PATH=~/.npm/chromium +addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-12 + - libnss3 + +before_install: + - cat /etc/apt/sources.list + - python3 --version + - echo "deb http://archive.ubuntu.com/ubuntu jammy main universe" | sudo tee -a /etc/apt/sources.list + - sudo apt-get update + - sudo apt-get install -y libnss3