use fresher node and debian version (#1255)

This moves to node 22 and debian bookworm, since the versions we've been building and testing with are getting old.

There is some old material kept around for (speaks very quietly) Python 2 (looks around hoping no-one heard) which we continue to support for some long-time users but really really should drop soon.

The changes for the node upgrade were all test related. I did them in a way that shouldn't impair running on older versions of node, and did spot checks for this. This is to give some breathing room for upgrading Grist Lab's grist-saas as follow up work.
This commit is contained in:
Paul Fitzpatrick
2024-10-10 16:59:03 -04:00
committed by GitHub
parent 1a527d74a0
commit aa69652a33
11 changed files with 127 additions and 61 deletions

View File

@@ -19,6 +19,10 @@ describe('Importer', function() {
// have tests go faster. Each successful test case should leave the document unchanged.
if (!docUrl || !await gu.testCurrentUrl(docUrl)) {
const session = await gu.session().teamSite.login();
// TODO: tests check colors literally, so need to be in
// light theme - but calling gu.setGristTheme results in
// some problems so right now if you are a dev you just
// need to run these tests in light mode, sorry.
await session.tempDoc(cleanup, 'Hello.grist');
docUrl = await driver.getCurrentUrl();
}
@@ -450,9 +454,9 @@ describe('Importer', function() {
assert.equal(await driver.findWait('.test-importer-preview', 2000).isPresent(), true);
// Check that the merge field select button has a red outline.
assert.equal(
assert.match(
await driver.find('.test-importer-merge-fields-select').getCssValue('border'),
'1px solid rgb(208, 2, 27)'
/solid rgb\(208, 2, 27\)/
);
// Select a merge field, and check that the red outline is gone.
@@ -461,9 +465,9 @@ describe('Importer', function() {
'.test-multi-select-menu .test-multi-select-menu-option',
/Name/
).click();
assert.equal(
assert.match(
await driver.find('.test-importer-merge-fields-select').getCssValue('border'),
'1px solid rgb(217, 217, 217)'
/solid rgb\(217, 217, 217\)/
);
// Hide dropdown
await gu.sendKeys(Key.ESCAPE);
@@ -584,9 +588,9 @@ describe('Importer', function() {
await driver.findContent('.test-importer-source', /UploadedData2Extended.csv/).click();
// Check that it failed, and that the merge fields select button is outlined in red.
assert.equal(
assert.match(
await driver.find('.test-importer-merge-fields-select').getCssValue('border'),
'1px solid rgb(208, 2, 27)'
/solid rgb\(208, 2, 27\)/
);
assert.equal(
await driver.find('.test-importer-source-selected .test-importer-from').getText(),

View File

@@ -1464,6 +1464,7 @@ export function revertChanges(test: () => Promise<void>, invariant: () => any =
export async function redo(optCount: number = 1, optTimeout?: number) {
for (let i = 0; i < optCount; ++i) {
await driver.find('.test-redo').doClick();
await waitForServer(optTimeout);
}
await waitForServer(optTimeout);
}
@@ -2781,11 +2782,11 @@ export function addSamplesForSuite(includeTutorial = false) {
}
export async function openAccountMenu() {
await driver.findWait('.test-dm-account', 1000).click();
await driver.findWait('.test-dm-account', 2000).click();
// Since the AccountWidget loads orgs and the user data asynchronously, the menu
// can expand itself causing the click to land on a wrong button.
await waitForServer();
await driver.findWait('.test-site-switcher-org', 1000);
await driver.findWait('.test-site-switcher-org', 2000);
await driver.sleep(250); // There's still some jitter (scroll-bar? other user accounts?)
}

View File

@@ -35,7 +35,14 @@ export const getPreviewDiffCellValues = stackWrapFunc(async (cols: number[], row
// Helper that waits for the diff preview to finish loading.
export const waitForDiffPreviewToLoad = stackWrapFunc(async (): Promise<void> => {
await gu.waitForServer();
await driver.wait(() => driver.find('.test-importer-preview').isPresent(), 5000);
await gu.waitToPass(async () => {
const preview = (await getPreviewDiffCellValues([0], [1]))[0];
if (preview[0] === undefined && preview[1] === undefined) {
throw new Error('sometimes data is a little slow to show up?');
}
}, 2000);
});
// Helper that gets the list of visible column matching rows to the left of the preview.