Skip to content

Commit

Permalink
Merge pull request #26 from bryntum/upgrading-packages
Browse files Browse the repository at this point in the history
Upgrading packages
  • Loading branch information
bmblb authored Jan 16, 2025
2 parents d5412e1 + e5a0813 commit 88ebc8f
Show file tree
Hide file tree
Showing 19 changed files with 5,169 additions and 2,412 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x]
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand Down
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Based on https://developers.google.com/web/tools/puppeteer/troubleshooting#running_puppeteer_in_docker

FROM node:16.15.0
FROM node:20.18.1

RUN apt-get update \
&& apt-get install -y wget gnupg ca-certificates \
Expand Down Expand Up @@ -51,5 +51,3 @@ RUN npm i
EXPOSE 8080 8081

ENTRYPOINT [ "node", "./src/server.js", "-H", "8081" ]

CMD ["bash"]
2 changes: 1 addition & 1 deletion __tests__/assertions.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async function getFile(json, protocol, fileFormat, host, port, timeout) {
});

request.on('timeout', () => {
request.abort();
request.destroy();

reject(new Error('timeout'));
});
Expand Down
2 changes: 1 addition & 1 deletion __tests__/samples/fileprotocol/data.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"html": [
{ "html" : "<!DOCTYPE html><html class=\"\" style=\"width: 8.25in; height: 11.69in;\"><head><meta content=\"text/html; charset=UTF-8\" http-equiv=\"Content-Type\"/><title></title><link rel=\"stylesheet\" href=\"file:///C:/foo.css\"><link rel=\"stylesheet\" href=\"file:///home/bar.css\"><style>body {background-image: url(\"file:///home/buz.css\");}</style><link rel=\"stylesheet\" href=\"https://bryntum.com/examples/build/grid.stockholm.css?455383\"></head><body></body></html>" }
{ "html" : "<!DOCTYPE html><html class=\"\" style=\"width: 8.25in; height: 11.69in;\"><head><meta content=\"text/html; charset=UTF-8\" http-equiv=\"Content-Type\"/><title></title><link rel=\"stylesheet\" href=\"file:///C:/foo.css\"><link rel=\"stylesheet\" href=\"file:///home/bar.css\"><style>body {background-image: url(\"file:///home/buz.css\");}</style><link rel=\"stylesheet\" href=\"https://bryntum.com/products/grid/build/grid.stockholm.css?455383\"></head><body></body></html>" }
],
"orientation": "portrait",
"format": "A4",
Expand Down
2 changes: 1 addition & 1 deletion __tests__/samples/parallel/parallel2.json

Large diffs are not rendered by default.

Binary file modified __tests__/samples/smoke/base_https.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion __tests__/samples/smoke/base_https.pdf.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion __tests__/samples/smoke/base_https.png.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions __tests__/smoke.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,25 @@ describe('Should export over HTTP', () => {
const
host = 'localhost',
protocol = 'http',
port = 8081,
port = 8082,
workers = 1,
fileFormat = 'pdf';

server = await startServer({ protocol, port, workers, logger : getLoggerConfig('smoke_consequent') });

await assertExportedFile({ protocol, host, port: server.httpPort, fileFormat });

// Waiting for 30 seconds, export server should kill all idle workers
// Waiting for 10 seconds, export server should kill all idle workers
await new Promise(resolve => {
setTimeout(() => resolve(), 30000);
setTimeout(() => resolve(), 10000);
});

const promises = [
assertExportedFile({ protocol, host, port: server.httpPort, fileFormat }),
new Promise(resolve => {
setTimeout(() => {
resolve('timeout');
}, 1000 * 60 * 2);
}, 1000 * 30);
})
];

Expand All @@ -59,7 +59,7 @@ describe('Should export over HTTP', () => {
await Promise.allSettled(promises);

if (winner === 'timeout') {
fail('Server have not returned file in 2 minutes');
fail('Server have not returned file in 30 seconds');
}
});
});
Expand All @@ -69,7 +69,7 @@ describe('Should export over HTTPS', () => {
test('Should export to PDF', async () => {
const
protocol = 'https',
port = 8081,
port = 8083,
workers = 1;

server = await startServer({ protocol, port, workers, logger : getLoggerConfig('smoke_https_pdf') })
Expand Down
2 changes: 1 addition & 1 deletion __tests__/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ async function startServer(config = {}) {
[protocol] : port,
'max-workers' : workers,
findNextHttpPort : true,
chromiumArgs : isWSL() ? ['--no-sandbox'] : []
chromiumArgs : ['--no-sandbox']
}, config);

const server = new WebServer(config);
Expand Down
Loading

0 comments on commit 88ebc8f

Please sign in to comment.