Compare commits
1 Commits
v1.11.91-r
...
t3chguy/ca
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8d82dc2e06 |
15
.github/workflows/end-to-end-tests.yaml
vendored
15
.github/workflows/end-to-end-tests.yaml
vendored
@@ -48,6 +48,7 @@ jobs:
|
|||||||
outputs:
|
outputs:
|
||||||
num-runners: ${{ env.NUM_RUNNERS }}
|
num-runners: ${{ env.NUM_RUNNERS }}
|
||||||
runners-matrix: ${{ steps.runner-vars.outputs.matrix }}
|
runners-matrix: ${{ steps.runner-vars.outputs.matrix }}
|
||||||
|
docker-cache-key: ${{ steps.runner-vars.outputs.docker-cache-key }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -80,6 +81,12 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
yarn build
|
yarn build
|
||||||
|
|
||||||
|
# Heuristic for calculating a cache key which is based on all images we pass to testcontainers
|
||||||
|
- name: Calculate docker cache key
|
||||||
|
run: |
|
||||||
|
grep -hr "Container(\"" --exclude-dir=snapshots --exclude-dir=sample-files playwright >> _docker_cache_key
|
||||||
|
grep -hr -C1 "super(" playwright/testcontainers/ >> _docker_cache_key
|
||||||
|
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
@@ -90,11 +97,14 @@ jobs:
|
|||||||
- name: Calculate runner variables
|
- name: Calculate runner variables
|
||||||
id: runner-vars
|
id: runner-vars
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
|
env:
|
||||||
|
DOCKER_CACHE_KEY: ${{ hashFiles('_docker_cache_key') }}
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const numRunners = parseInt(process.env.NUM_RUNNERS, 10);
|
const numRunners = parseInt(process.env.NUM_RUNNERS, 10);
|
||||||
const matrix = Array.from({ length: numRunners }, (_, i) => i + 1);
|
const matrix = Array.from({ length: numRunners }, (_, i) => i + 1);
|
||||||
core.setOutput("matrix", JSON.stringify(matrix));
|
core.setOutput("matrix", JSON.stringify(matrix));
|
||||||
|
core.setOutput("docker-cache-key", process.env.DOCKER_CACHE_KEY);
|
||||||
|
|
||||||
playwright:
|
playwright:
|
||||||
name: "Run Tests [${{ matrix.project }}] ${{ matrix.runner }}/${{ needs.build.outputs.num-runners }}"
|
name: "Run Tests [${{ matrix.project }}] ${{ matrix.runner }}/${{ needs.build.outputs.num-runners }}"
|
||||||
@@ -164,6 +174,11 @@ jobs:
|
|||||||
if: matrix.project == 'WebKit' && steps.playwright-cache.outputs.cache-hit == 'true'
|
if: matrix.project == 'WebKit' && steps.playwright-cache.outputs.cache-hit == 'true'
|
||||||
run: yarn playwright install-deps webkit
|
run: yarn playwright install-deps webkit
|
||||||
|
|
||||||
|
- name: Docker image cache
|
||||||
|
uses: ScribeMD/docker-cache@fb28c93772363301b8d0a6072ce850224b73f74e # 0.5.0
|
||||||
|
with:
|
||||||
|
key: ${{ needs.build.outputs.docker-cache-key }}
|
||||||
|
|
||||||
# We skip tests tagged with @mergequeue when running on PRs, but run them in MQ and everywhere else
|
# We skip tests tagged with @mergequeue when running on PRs, but run them in MQ and everywhere else
|
||||||
- name: Run Playwright tests
|
- name: Run Playwright tests
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ jobs:
|
|||||||
docker pull "$IMAGE"
|
docker pull "$IMAGE"
|
||||||
INSPECT=$(docker inspect --format='{{index .RepoDigests 0}}' "$IMAGE")
|
INSPECT=$(docker inspect --format='{{index .RepoDigests 0}}' "$IMAGE")
|
||||||
DIGEST=${INSPECT#*@}
|
DIGEST=${INSPECT#*@}
|
||||||
sed -i "s/const TAG.*/const TAG = \"develop@$DIGEST\";/" playwright/testcontainers/synapse.ts
|
sed -i "s,`$IMAGE.*`,`$IMAGE@$DIGEST`," playwright/testcontainers/synapse.ts
|
||||||
env:
|
env:
|
||||||
IMAGE: ghcr.io/element-hq/synapse:develop
|
IMAGE: ghcr.io/element-hq/synapse:develop
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ export const test = base.extend<{}, Services>({
|
|||||||
],
|
],
|
||||||
postgres: [
|
postgres: [
|
||||||
async ({ logger, network }, use) => {
|
async ({ logger, network }, use) => {
|
||||||
const container = await new PostgreSqlContainer()
|
const container = await new PostgreSqlContainer("postgres:13.3-alpine")
|
||||||
.withNetwork(network)
|
.withNetwork(network)
|
||||||
.withNetworkAliases("postgres")
|
.withNetworkAliases("postgres")
|
||||||
.withLogConsumer(logger.getConsumer("postgres"))
|
.withLogConsumer(logger.getConsumer("postgres"))
|
||||||
|
|||||||
@@ -17,8 +17,6 @@ import { Credentials } from "../plugins/homeserver";
|
|||||||
import { deepCopy } from "../plugins/utils/object.ts";
|
import { deepCopy } from "../plugins/utils/object.ts";
|
||||||
import { HomeserverContainer, StartedHomeserverContainer } from "./HomeserverContainer.ts";
|
import { HomeserverContainer, StartedHomeserverContainer } from "./HomeserverContainer.ts";
|
||||||
|
|
||||||
const TAG = "develop@sha256:b69222d98abe9625d46f5d3cb01683d5dc173ae339215297138392cfeec935d9";
|
|
||||||
|
|
||||||
const DEFAULT_CONFIG = {
|
const DEFAULT_CONFIG = {
|
||||||
server_name: "localhost",
|
server_name: "localhost",
|
||||||
public_baseurl: "", // set by start method
|
public_baseurl: "", // set by start method
|
||||||
@@ -144,7 +142,9 @@ export class SynapseContainer extends GenericContainer implements HomeserverCont
|
|||||||
private config: typeof DEFAULT_CONFIG;
|
private config: typeof DEFAULT_CONFIG;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super(`ghcr.io/element-hq/synapse:${TAG}`);
|
super(
|
||||||
|
`ghcr.io/element-hq/synapse:develop@sha256:b69222d98abe9625d46f5d3cb01683d5dc173ae339215297138392cfeec935d9`,
|
||||||
|
);
|
||||||
|
|
||||||
this.config = deepCopy(DEFAULT_CONFIG);
|
this.config = deepCopy(DEFAULT_CONFIG);
|
||||||
this.config.registration_shared_secret = randB64Bytes(16);
|
this.config.registration_shared_secret = randB64Bytes(16);
|
||||||
|
|||||||
Reference in New Issue
Block a user