Skip to content

Commit

Permalink
Devop 52 wab ci (#281)
Browse files Browse the repository at this point in the history
* feat: add base line wab-ci

* feat: add docker-compose to run postgres in a container env

* feat: add template for pgpass file meant to help host machines authenticate in container pg

* chore: install cypress plugins

* chore: add graphql package at the root project

* feat: add pm2 config for services that are only required for tests

* fix: add special long timeout for component-ops spec

* fix: add special data-binding spec

* fix: hostless-cms flakiness when overwriding host config field

* chore: set db-setup script execution permissions

* chore: add verdaccio to docker-compose file

* refactor: build and publish packages

* feat: build packages before tests in same job

* feat: build and publish packages to verdaccio

* chore: enable playwrite tests always

* test: trigger package build

* fix: pull values for conditionals from the new changes job

* fix: add auto confirm in lerna publish command

* fix: jobs conditionals

* fix: jobs conditionals

* fix: jobs conditionals

* fix: set outputs in changes job

* chore: code used to trigger package build

* fix: add yarn build in loader-bundle-env setup script

* fix: upload playwright test results

* fix: add step to authenticate in aws for playwright

* chore: adjust trigger conditions

GitOrigin-RevId: 56565d7ea73de4de87057f0a8d4fabe5e58affe9
  • Loading branch information
jfmrm authored and actions-user committed Dec 20, 2024
1 parent 9637fe0 commit d0e0ea5
Show file tree
Hide file tree
Showing 11 changed files with 1,161 additions and 23 deletions.
24 changes: 24 additions & 0 deletions docker-compose.services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
services:
db:
image: postgres:15
restart: always
environment:
POSTGRES_PASSWORD: password
healthcheck:
test: ["CMD-SHELL", "pg_isready -U wab"]
interval: 5s
timeout: 10s
retries: 5
ports:
- 5432:5432
volumes:
- ./platform/wab/tools/docker-dev/db-setup.bash:/docker-entrypoint-initdb.d/db-setup.sh

verdaccio:
image: verdaccio/verdaccio
environment:
VERDACCIO_PORT: "4873"
ports:
- 4873:4873
volumes:
- ./verdaccio-config.yaml:/verdaccio/conf/config.yaml
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"setup-all": "yarn setup && yarn setup:canvas-packages && cd platform/wab && yarn typeorm migration:run && yarn migrate-dev-bundles && yarn plume:dev update",
"setup:canvas-packages": "cd platform/canvas-packages && for d in internal_pkgs/*; do if [ -d \"$d\" ]; then cd $d && yarn && cd -; fi done && yarn && yarn build",
"setup:live-frame": "cd platform/live-frame && yarn && yarn build",
"setup:loader-bundle-env": "cd platform/loader-bundle-env && for d in internal_pkgs/*; do if [ -d \"$d\" ]; then cd $d && yarn && cd -; fi done && yarn",
"setup:loader-bundle-env": "cd platform/loader-bundle-env && for d in internal_pkgs/*; do if [ -d \"$d\" ]; then cd $d && yarn && yarn build && cd -; fi done && yarn",
"setup:loader-html-hydrate": "cd platform/loader-html-hydrate && yarn && yarn build && cp build/* ../wab/public/static/js/",
"setup:react-web-bundle": "cd platform/react-web-bundle && yarn && yarn build",
"setup:sub": "cd platform/sub && yarn && yarn build",
Expand Down
24 changes: 19 additions & 5 deletions platform/wab/cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ export default defineConfig({
projectId: "vd88vm",
viewportWidth: 1200,
viewportHeight: 660,
defaultCommandTimeout: 15000,
responseTimeout: 300000,
defaultCommandTimeout: 5000,
responseTimeout: 5000,
chromeWebSecurity: false,
retries: {
runMode: 2,
Expand All @@ -15,13 +15,27 @@ export default defineConfig({
numTestsKeptInMemory: 0,
video: true,
e2e: {
specPattern: "cypress/e2e/**/*.{js,jsx,ts,tsx}",
// excluding left-panel as it's in a livelock when running in the CI
excludeSpecPattern: ["cypress/e2e/left-panel.spec.ts"],
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require("./cypress/plugins/index.ts")(on, config);
setupNodeEvents(cypressOn, config) {
// This is a fix to enable multiple plugins, check https://github.com/bahmutov/cypress-on-fix
const on = require("cypress-on-fix")(cypressOn);
// This is a plugin to allow cypress parallel runs for free, check https://github.com/bahmutov/cypress-split?tab=readme-ov-file
require("cypress-split")(on, config);
require("./cypress/plugins/index.ts")(on, config);
// Allows cypress to exit when a test fails if env failFast=true
require("cypress-fail-fast/plugin")(on, config);

return config;
},
baseUrl: "http://localhost:3003",
specPattern: "cypress/e2e/**/*.{js,jsx,ts,tsx}",
retries: {
runMode: 3, // Retries when running in CI or `cypress run`
openMode: 1, // Retries when running interactively in `cypress open`
},
},
reporter: "mocha-reporter-gha",

Expand Down
2 changes: 2 additions & 0 deletions platform/wab/cypress/e2e/component-ops.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { VERT_CONTAINER_CAP } from "../../src/wab/shared/Labels";
import { Framed, removeCurrentProject, setupNewProject } from "../support/util";

Cypress.config("defaultCommandTimeout", 20000);

// Mostly regression tests
describe("component-ops - tricky operations", function () {
beforeEach(() => {
Expand Down
2 changes: 2 additions & 0 deletions platform/wab/cypress/e2e/data-binding.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { VERT_CONTAINER_CAP } from "../../src/wab/shared/Labels";
import { removeCurrentProject, setupNewProject } from "../support/util";

Cypress.config("defaultCommandTimeout", 10000);

describe("data-binding", function () {
beforeEach(() => {
setupNewProject({
Expand Down
5 changes: 5 additions & 0 deletions platform/wab/cypress/e2e/hostless-cms.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ describe("hostless-cms", function () {
cy.contains("CMS Credentials Provider").click();
cy.get(`#sidebar-modal button[data-test-id="collapse"]`).click();
cy.wait(200);
cy.get(`[data-plasmic-prop="host"]`)
.type("{selectall}")
.wait(100)
.type("{backspace}")
.type(`${Cypress.config("baseUrl")}`);
cy.setSelectedDimStyle(
"host",
`{selectall}{backspace}${Cypress.config("baseUrl")}`
Expand Down
4 changes: 4 additions & 0 deletions platform/wab/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,12 @@
"blink-diff": "^1.0.13",
"concurrently": "^5.3.0",
"cypress": "^13.4.0",
"cypress-fail-fast": "^7.1.1",
"cypress-log-to-output": "^1.1.2",
"cypress-mouse-position": "^1.0.0",
"cypress-on-fix": "^1.0.3",
"cypress-real-events": "^1.13.0",
"cypress-split": "^1.24.7",
"depcheck": "^1.4.3",
"dependency-cruiser": "^9.21.6",
"diff": "^4.0.2",
Expand Down Expand Up @@ -346,6 +349,7 @@
"googleapis": "^109.0.1",
"gpt3-tokenizer": "^1.1.5",
"graphiql": "3.7.0",
"graphql": "^16.7.1",
"hibp": "^11.1.0",
"history": "^4.9.0",
"html2canvas": "^1.0.0-rc.7",
Expand Down
15 changes: 15 additions & 0 deletions platform/wab/pm2-test.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
apps: [
{
name: "host-test",
cwd: "../host-test",
script: "yarn",
args: ["start"],
log_date_format: "HH:mm:ss.SSS",
env: {
PORT: "3011",
},
interpreter: "none",
},
],
};
Empty file modified platform/wab/tools/docker-dev/db-setup.bash
100644 → 100755
Empty file.
Loading

0 comments on commit d0e0ea5

Please sign in to comment.