diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index a8d6ea2f44..49e878f13c 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -167,39 +167,6 @@ jobs: ${{ steps.meta-ee-public.outputs.labels }} org.opencontainers.image.licenses=Windmill-Enterprise-License - # disabled until we make it 100% reliable and add more meaningful tests - # playwright: - # runs-on: [self-hosted, new] - # needs: [build] - # services: - # postgres: - # image: postgres - # env: - # POSTGRES_DB: windmill - # POSTGRES_USER: admin - # POSTGRES_PASSWORD: changeme - # ports: - # - 5432:5432 - # options: >- - # --health-cmd pg_isready - # --health-interval 10s - # --health-timeout 5s - # --health-retries 5 - # steps: - # - uses: actions/checkout@v4 - # - name: "Docker" - # run: echo "::set-output name=id::$(docker run --network=host --rm -d -p 8000:8000 --privileged -it -e DATABASE_URL=postgres://admin:changeme@localhost:5432/windmill -e BASE_INTERNAL_URL=http://localhost:8000 ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest)" - # id: docker-container - # - uses: actions/setup-node@v3 - # with: - # node-version: 16 - # - name: "Playwright run" - # timeout-minutes: 2 - # run: cd frontend && npm ci @playwright/test && npx playwright install && export BASE_URL=http://localhost:8000 && npm run test - # - name: "Clean up" - # run: docker kill ${{ steps.docker-container.outputs.id }} - # if: always() - attach_amd64_binary_to_release: needs: [build, build_ee] runs-on: ubicloud diff --git a/frontend/package.json b/frontend/package.json index b5dd310736..be419cf75f 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -15,7 +15,6 @@ "generate-backend-client": "openapi-ts --input ../backend/windmill-api/openapi.yaml --output ./src/lib/gen --useOptions --enums javascript --format false", "generate-backend-client-mac": "openapi-ts --input ../backend/windmill-api/openapi.yaml --output ./src/lib/gen --useOptions --enums javascript", "pretest": "tsc --incremental -p tests/tsconfig.json", - "test": "playwright test --config=tests-out/playwright.config.js && npm run test:unit -- --run", "filter-classes": "node filterTailwindClasses.js", "test:unit": "vitest" }, @@ -24,7 +23,6 @@ "@hey-api/openapi-ts": "^0.43.0", "@melt-ui/pp": "^0.3.2", "@melt-ui/svelte": "^0.86.2", - "@playwright/test": "^1.34.3", "@sveltejs/adapter-static": "^3.0.6", "@sveltejs/kit": "^2.49.2", "@sveltejs/package": "^2.3.7", @@ -38,7 +36,6 @@ "@types/vscode": "^1.83.5", "@typescript-eslint/eslint-plugin": "^5.59.8", "@typescript-eslint/parser": "^5.60.0", - "@vitest/browser-playwright": "^4.0.10", "@zerodevx/svelte-toast": "^0.9.6", "autoprefixer": "^10.4.13", "cssnano": "^6.0.1", @@ -50,7 +47,6 @@ "json-refs": "^3.0.15", "json-schema-to-zod": "^2.7.0", "path-browserify": "^1.0.1", - "playwright": "^1.56.1", "postcss": "^8.4.49", "postcss-load-config": "^4.0.1", "prettier": "^3.1.0", diff --git a/frontend/src/lib/components/apps/components/display/dbtable/queries/alterTable.test.ts b/frontend/src/lib/components/apps/components/display/dbtable/queries/alterTable.test.ts index 1eccd05a81..e7dde31597 100644 --- a/frontend/src/lib/components/apps/components/display/dbtable/queries/alterTable.test.ts +++ b/frontend/src/lib/components/apps/components/display/dbtable/queries/alterTable.test.ts @@ -48,7 +48,7 @@ describe('makeAlterTableQueries', () => { 'postgresql' ) - expect(normalize(queries[0])).toBe(normalize('ALTER TABLE users DROP COLUMN age;')) + expect(normalize(queries[0])).toBe(normalize('ALTER TABLE users DROP COLUMN "age";')) }) it('renames a column', () => { diff --git a/frontend/tests/global-setup.ts b/frontend/tests/global-setup.ts deleted file mode 100644 index c625915adb..0000000000 --- a/frontend/tests/global-setup.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { chromium } from '@playwright/test' - -async function globalSetup() { - const browser = await chromium.launch() - // baseURL is set in the global config, but it doesn't affect the globalSetup script. - const page = await browser.newPage({ baseURL: process.env.BASE_URL || 'http://localhost' }) - await page.goto('/user/login', { waitUntil: 'networkidle' }) - - if (await page.locator('#email').isHidden()) { - await page.locator('button', { - hasText: 'Log in without third-party' - }).click() - } - - const email = page.locator('input[type="email"]') - await email.fill('user@windmill.dev') - - const password = page.locator('input[type="password"]') - await password.fill('changeme') - - await page.locator('#login2').click() - await page.waitForResponse('/api/auth/login') - await page.context().storageState({ path: 'storageState.json' }) - await browser.close() -} - -export default globalSetup diff --git a/frontend/tests/playwright.config.ts b/frontend/tests/playwright.config.ts deleted file mode 100644 index 4327440e26..0000000000 --- a/frontend/tests/playwright.config.ts +++ /dev/null @@ -1,13 +0,0 @@ -// playwright.config.ts -import type { PlaywrightTestConfig } from '@playwright/test' -const config: PlaywrightTestConfig = { - globalSetup: './global-setup', - use: { - // Tell all tests to load signed-in state from 'storageState.json'. - storageState: 'storageState.json', - // baseURL is set in the globalSetup script as well, because it's not affected by this config. - // Make sure to update it there as well when this is updated. - baseURL: process.env.BASE_URL || 'http://localhost' - } -} -export default config diff --git a/frontend/tests/tsconfig.json b/frontend/tests/tsconfig.json deleted file mode 100644 index e090ec200b..0000000000 --- a/frontend/tests/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "target": "esnext", - "module": "esnext", - "moduleResolution": "node", - "sourceMap": false, - "outDir": "../tests-out", - } -} diff --git a/frontend/tests/workspaces.spec.ts b/frontend/tests/workspaces.spec.ts deleted file mode 100644 index dae0e02a99..0000000000 --- a/frontend/tests/workspaces.spec.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { test, expect } from '@playwright/test' - -test('can visit workspace selector page', async ({ page }) => { - await page.goto('/user/workspaces') - await expect(page.locator('h1', { hasText: 'Select a workspace' })).toBeVisible() -}) diff --git a/frontend/vite.config.js b/frontend/vite.config.js index 142c75f500..70d86a3f85 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -1,4 +1,3 @@ -import { playwright } from '@vitest/browser-playwright' import { sveltekit } from '@sveltejs/kit/vite' import { readFileSync } from 'fs' import { fileURLToPath } from 'url' @@ -98,19 +97,6 @@ const config = { test: { expect: { requireAssertions: true }, projects: [ - { - extends: './vite.config.js', - test: { - name: 'client', - browser: { - enabled: true, - provider: playwright(), - instances: [{ browser: 'chromium', headless: true }] - }, - include: ['src/**/*.svelte.{test,spec}.{js,ts}'], - exclude: ['src/lib/server/**'] - } - }, { extends: './vite.config.js', test: {