-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Performance Tests Added Performance tests * feat: Performance Tests Updated scripts * try direct script * Add tests for release branches * Version Bumps --------- Co-authored-by: Alex Risch <alex@xmtp.com>
- Loading branch information
Showing
9 changed files
with
774 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ on: | |
pull_request: | ||
branches: | ||
- main | ||
- release/* | ||
paths: | ||
- "android/**" | ||
- "package.json" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ on: | |
pull_request: | ||
branches: | ||
- main | ||
- release/* | ||
paths: | ||
- "ios/**" | ||
- "package.json" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { jest, test } from "@jest/globals"; | ||
import { screen } from "@testing-library/react-native"; | ||
import React from "react"; | ||
import { measureRenders } from "reassure"; | ||
|
||
import Avatar from "../Avatar"; | ||
|
||
jest.setTimeout(600_000); | ||
|
||
const TestComponent = ({ uri }: { uri?: string }) => <Avatar uri={uri} />; | ||
|
||
test("Empty Avatar 10 runs", async () => { | ||
const scenario = async () => { | ||
await screen.findByTestId("avatar-placeholder"); | ||
}; | ||
|
||
await measureRenders(<TestComponent />, { scenario, runs: 10 }); | ||
}); | ||
|
||
test("Empty Avatar 50 runs", async () => { | ||
const scenario = async () => { | ||
await screen.findByTestId("avatar-placeholder"); | ||
}; | ||
|
||
await measureRenders(<TestComponent />, { scenario, runs: 50 }); | ||
}); | ||
|
||
test("Avatar Image 10 runs", async () => { | ||
const scenario = async () => { | ||
await screen.findByTestId("avatar-image"); | ||
}; | ||
|
||
await measureRenders(<TestComponent uri="https://picsum.photos/200/300" />, { | ||
scenario, | ||
runs: 10, | ||
}); | ||
}); | ||
|
||
test("Avatar Image 50 runs", async () => { | ||
const scenario = async () => { | ||
await screen.findByTestId("avatar-image"); | ||
}; | ||
|
||
await measureRenders(<TestComponent uri="https://picsum.photos/200/300" />, { | ||
scenario, | ||
runs: 50, | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
import path from 'path'; | ||
import { dangerReassure } from 'reassure'; | ||
|
||
dangerReassure({ | ||
inputFilePath: path.join(__dirname, './.reassure/output.md'), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
BASELINE_BRANCH=${GITHUB_BASE_REF:="main"} | ||
|
||
# Required for `git switch` on CI | ||
git fetch origin | ||
|
||
# Gather baseline perf measurements | ||
git switch "$BASELINE_BRANCH" | ||
|
||
yarn | ||
yarn reassure --baseline | ||
|
||
# Gather current perf measurements & compare results | ||
git switch --detach - | ||
|
||
yarn | ||
yarn reassure --branch |
Oops, something went wrong.