Skip to content

Commit

Permalink
ci job
Browse files Browse the repository at this point in the history
  • Loading branch information
bkrmendy committed Jan 10, 2024
1 parent 678a072 commit 5ab6499
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -398,3 +398,44 @@ jobs:
BRANCH_NAME: ${{ steps.extract_branch.outputs.branch }}
run: |
nix-shell --arg includeServerBuildSupport false --arg includeRunLocallySupport false --run "xvfb-run --server-args='-screen 0 1920x1080x24 -ac -nolisten tcp -dpi 96 +extension RANDR' run-comments-test"
collaboration-test:
name: Run Collaboration Tests
timeout-minutes: 12
runs-on: ubuntu-latest
needs: [deploy-staging, cache-pnpm-store]
env:
UTOPIA_SHA: ${{ github.sha }}
AUTH0_CLIENT_ID: KB7euFO46rVYeOaWmrEdktdhAFxEO266
AUTH0_ENDPOINT: enter.utopia.app
AUTH0_REDIRECT_URI: https://utopia.pizza/authenticate
steps:
# Gets the branch that this PR is targeting and replaces forward slashes in the name with hyphens.
# So that later steps can produce a bundle incorporating that into the name and upload it.
- name: Extract branch name
shell: bash
run: |
FIXED_REF="${GITHUB_HEAD_REF////-}"
echo "##[set-output name=branch;]$FIXED_REF"
id: extract_branch
- name: Install nix
uses: cachix/install-nix-action@v12
with:
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/6120ac5cd201f6cb593d1b80e861be0342495be9.tar.gz
- name: Check out the repo
uses: actions/checkout@v2
- name: Cache .pnpm-store
uses: actions/cache@v2
with:
path: ${{ needs.cache-pnpm-store.outputs.pnpm-store-path }}
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-captured-location
- name: Build Comments Tests
run: |
nix-shell --arg includeServerBuildSupport false --arg includeRunLocallySupport false --run "build-puppeteer-tests"
- name: Run Comments Test
id: run-comments-test
env:
BRANCH_NAME: ${{ steps.extract_branch.outputs.branch }}
BASE_URL: 'https://utopia.pizza'
run: |
nix-shell --arg includeServerBuildSupport false --arg includeRunLocallySupport false --run "xvfb-run --server-args='-screen 0 1920x1080x24 -ac -nolisten tcp -dpi 96 +extension RANDR' run-collaboration-test"
3 changes: 1 addition & 2 deletions puppeteer-tests/src/comments/collaboration-test.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ async function expectNSelectors(page: Page, selector: string, n: number) {
expect(elementsMatchingSelector).toHaveLength(n)
}

// TODO: CI job

describe('Collaboration test', () => {
it(
'can collaboratively add an element',
Expand All @@ -36,6 +34,7 @@ describe('Collaboration test', () => {

await page1.waitForNavigation()
await signIn(page1)
// wait for project to be saved
await wait(5000) // TODO

const newProjectUrl = new url.URL(page1.url()).pathname
Expand Down
7 changes: 7 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,13 @@ let
${pnpm}/bin/pnpm install --unsafe-perm
${pnpm}/bin/pnpm run comments-test
'')
(pkgs.writeScriptBin "run-collaboration-test" ''
#!/usr/bin/env bash
set -e
cd $(${pkgs.git}/bin/git rev-parse --show-toplevel)/puppeteer-tests
${pnpm}/bin/pnpm install --unsafe-perm
${pnpm}/bin/pnpm run collaboration-test
'')
];

withPuppeteerScripts = withBaseEditorScripts ++ (lib.optionals stdenv.isLinux puppeteerScripts);
Expand Down

0 comments on commit 5ab6499

Please sign in to comment.