Skip to content

Commit

Permalink
Update Dependencies 2024-05-29 (#223)
Browse files Browse the repository at this point in the history
* Updated version and dependencies

- Updated Storybook and Axios versions

* Simplified _document for styled-components

* Added code to upload pewpew for the agent tests if it's not already there.

* Updated PR flows to add Node v22 testing

* Removed reference to IMDSv1 command since we're not using it
  • Loading branch information
tkmcmaster authored May 29, 2024
1 parent 0221bff commit 236ff43
Show file tree
Hide file tree
Showing 15 changed files with 3,835 additions and 2,513 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-guide.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
name: Build guide
strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [18.x, 20.x, 22.x]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-ppaas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
name: Build project
strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [18.x, 20.x, 22.x]
fail-fast: false
runs-on: ubuntu-latest

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
strategy:
matrix:
wasm-dirctory: [config-wasm, hdr-histogram-wasm]
node-version: [18.x, 20.x]
node-version: [18.x, 20.x, 22.x]
runs-on: ubuntu-latest
env:
WASM_FILE: ${{ matrix.wasm-dirctory }}_bg.wasm
Expand Down
2 changes: 1 addition & 1 deletion agent/.github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
name: Build project
strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [18.x, 20.x, 22.x]
runs-on: ubuntu-latest
# env:
# USE_XVFB: true
Expand Down
17 changes: 16 additions & 1 deletion agent/createtest/pewpewtest.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
LogLevel,
MessageType,
PEWPEW_BINARY_FOLDER,
PEWPEW_VERSION_LATEST,
PpaasS3File,
PpaasS3Message,
Expand All @@ -18,6 +19,7 @@ import {
util
} from "@fs/ppaas-common";
import { PewPewTest, getEndTime } from "../src/pewpewtest";
import { PEWPEW_PATH } from "../src/tests";
import { basename } from "path";
import { expect } from "chai";
import { getHostname } from "../src/util/util";
Expand All @@ -34,10 +36,23 @@ describe("PewPewTest Create Test", () => {
let ipAddress: string;
let hostname: string;

before(() => {
before(async () => {
sqs.init();
log("smoke queue url=" + [...sqs.QUEUE_URL_TEST], LogLevel.DEBUG);

const filepath = PEWPEW_PATH;
const s3Folder = `${PEWPEW_BINARY_FOLDER}/${PEWPEW_VERSION_LATEST}`;
const pewpewNotInS3 = (await s3.listFiles({ s3Folder, extension: filepath })).length === 0;
log("pewpewNotInS3: " + pewpewNotInS3, pewpewNotInS3 ? LogLevel.WARN : LogLevel.DEBUG);
if (pewpewNotInS3) {
await s3.uploadFile({
filepath: PEWPEW_PATH,
s3Folder: `${PEWPEW_BINARY_FOLDER}/${PEWPEW_VERSION_LATEST}`,
publicRead: false,
contentType: "application/octet-stream"
});
}

// Prepopulate PpaasTestStatus and make sure all expected data is still there after run
expectedTestStatusMessage = {
instanceId: "bogus",
Expand Down
4 changes: 2 additions & 2 deletions agent/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fs/ppaas-agent",
"version": "3.2.1",
"version": "3.2.2",
"description": "Agent Service for running pewpew tests",
"main": "dist/src/app.js",
"scripts": {
Expand Down Expand Up @@ -53,7 +53,7 @@
"@types/semver": "^7.5.0",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^7.0.0",
"axios": "~1.6.0",
"axios": "~1.7.0",
"chai": "^4.3.7",
"eslint": "^8.40.0",
"mocha": "^10.2.0",
Expand Down
2 changes: 1 addition & 1 deletion agent/src/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ logger.config.LogFileName = "ppaas-agent";
const UNIT_TEST_FOLDER = process.env.UNIT_TEST_FOLDER || "test";
const yamlFile = "basicwithenv.yaml";
const version = PEWPEW_VERSION_LATEST;
const PEWPEW_PATH = process.env.PEWPEW_PATH || pathJoin(UNIT_TEST_FOLDER, util.PEWPEW_BINARY_EXECUTABLE);
export const PEWPEW_PATH = process.env.PEWPEW_PATH || pathJoin(UNIT_TEST_FOLDER, util.PEWPEW_BINARY_EXECUTABLE);
const buildTestContents = `
vars:
rampTime: 10s
Expand Down
2 changes: 1 addition & 1 deletion common/.github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
name: Build project
strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [18.x, 20.x, 22.x]
runs-on: ubuntu-latest
# env:
# USE_XVFB: true
Expand Down
2 changes: 1 addition & 1 deletion common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fs/ppaas-common",
"version": "3.2.1",
"version": "3.2.2",
"description": "Common Code for the PewPewController and PewPewAgent",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
Expand Down
1 change: 0 additions & 1 deletion common/src/util/ec2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,5 @@ export async function getInstanceId (): Promise<string> {
} catch (error: unknown) {
log(`Could not load instanceId command "${INSTANCE_ID_COMMAND}"`, LogLevel.WARN, error);
}
// curl http://169.254.169.254/latest/meta-data/instance-id
throw new Error("Could not load instanceId");
}
2 changes: 1 addition & 1 deletion controller/.github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
name: Build project
strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [18.x, 20.x, 22.x]
fail-fast: false
runs-on: ubuntu-latest

Expand Down
16 changes: 8 additions & 8 deletions controller/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fs/ppaas-controller",
"version": "3.2.1",
"version": "3.2.2",
"description": "Controller Service for running pewpew tests",
"private": true,
"scripts": {
Expand Down Expand Up @@ -48,7 +48,7 @@
"@fullcalendar/interaction": "~6.1.9",
"@fullcalendar/react": "~6.1.9",
"@fullcalendar/timegrid": "~6.1.9",
"axios": "~1.6.0",
"axios": "~1.7.0",
"bunyan": "~1.8.0",
"chart.js": "~4.4.0",
"chartjs-adapter-date-fns": "^3.0.0",
Expand Down Expand Up @@ -79,11 +79,11 @@
"@aws-sdk/client-sqs": "^3.363.0",
"@aws-sdk/util-stream-node": "^3.363.0",
"@next/eslint-plugin-next": "~14.2.0",
"@storybook/addon-actions": "~8.0.0",
"@storybook/addon-links": "~8.0.0",
"@storybook/nextjs": "~8.0.0",
"@storybook/preview-api": "^8.0.0",
"@storybook/react": "~8.0.0",
"@storybook/addon-actions": "~8.1.0",
"@storybook/addon-links": "~8.1.0",
"@storybook/nextjs": "~8.1.0",
"@storybook/preview-api": "~8.1.0",
"@storybook/react": "~8.1.0",
"@testing-library/react": "^14.0.0",
"@types/bunyan": "~1.8.8",
"@types/chai": "^4.3.5",
Expand Down Expand Up @@ -119,7 +119,7 @@
"nyc": "^15.1.0",
"postcss": "^8.4.24",
"set-value": "^4.1.0",
"storybook": "~8.0.0",
"storybook": "~8.1.0",
"trim": "^1.0.1",
"typescript": "^5.3.0"
}
Expand Down
30 changes: 6 additions & 24 deletions controller/pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Document, { DocumentContext, DocumentInitialProps, Head, Html, Main, NextScript } from "next/document";
import React from "react";
import { RenderPage } from "next/dist/shared/lib/utils";
import type { DocumentContext, DocumentInitialProps } from "next/document";
import Document from "next/document";
import { ServerStyleSheet } from "styled-components";

/**
Expand All @@ -12,9 +11,11 @@ import { ServerStyleSheet } from "styled-components";
class CustomDocument extends Document {
// We can't remove this getInitialProps call yet. If we do, we get a flicker on server side loads
// while it client-side loads our styles. Watching https://github.com/vercel/next.js/discussions/22065
// Other options available with app directory instead of pages
// https://github.com/vercel/next.js/blob/canary/examples/with-styled-components/pages/_document.tsx
public static async getInitialProps (ctx: DocumentContext): Promise<DocumentInitialProps> {
const sheet: ServerStyleSheet = new ServerStyleSheet();
const originalRenderPage: RenderPage = ctx.renderPage;
const originalRenderPage = ctx.renderPage;

try {
ctx.renderPage = () =>
Expand All @@ -25,31 +26,12 @@ class CustomDocument extends Document {
const initialProps = await Document.getInitialProps(ctx);
return {
...initialProps,
styles: [(
<>
{initialProps.styles}
{sheet.getStyleElement()}
</>
)]
styles: [initialProps.styles, sheet.getStyleElement()]
};
} finally {
sheet.seal();
}
}

public render () {
return (
<Html lang="en">
<Head>
{this.props.styles}
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
);
}
}

export default CustomDocument;
Loading

0 comments on commit 236ff43

Please sign in to comment.