Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
billy clark committed Jan 5, 2023
2 parents eb9499c + 5da9032 commit d1b84e1
Show file tree
Hide file tree
Showing 242 changed files with 4,764 additions and 12,501 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
*.php text eol=lf
*.cs text eol=lf
*.sh text eol=lf
protractor text eol=lf

# Denote all files that are truly binary and should not be modified
*.png binary
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/integrate-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ jobs:
run: make e2e-tests-ci
-
name: Upload Playwright test results
if: always()
uses: actions/upload-artifact@v3
with:
name: test-results
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ jobs:
outputs:
status: ${{ steps.check-labels.outputs.status }}
steps:
- uses: mheap/github-action-required-labels@v2
- uses: mheap/github-action-required-labels@v3
id: check-labels
with:
mode: exactly
count: 1
labels: "bug, feature, engineering, security fix, testing"
- uses: mheap/github-action-required-labels@v2
- uses: mheap/github-action-required-labels@v3
with:
mode: exactly
count: 0
Expand Down Expand Up @@ -87,6 +87,7 @@ jobs:

-
name: Upload Playwright test results
if: always()
uses: actions/upload-artifact@v3
with:
name: test-results
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/set-backlog-fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@7ce9ffdcdeb2ba82b01b51d6584a6a85872336d4
uses: tibdex/github-app-token@v1.7
with:
app_id: ${{ secrets.LFPROJECTBOARDAUTOMATION_APP_ID }}
private_key: ${{ secrets.LFPROJECTBOARDAUTOMATION_PRIVATE_KEY }}
Expand All @@ -24,7 +24,7 @@ jobs:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
run: |
echo issue $ISSUE_NUMBER added to $REPO
gh api graphql -f query='
query($issue_number:Int!, $org:String!) {
repository(name:"web-languageforge", owner:$org) {
Expand All @@ -38,9 +38,9 @@ jobs:
}
}
}' -F issue_number=$ISSUE_NUMBER -f org=$ORGANIZATION > project_data.json
echo 'IN_PROJECT='$(jq '.data.repository.issue.projectNextItems[] | length' project_data.json) >> $GITHUB_ENV
- name: get required info for set operations
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
Expand Down Expand Up @@ -80,9 +80,9 @@ jobs:
}
}
}' -f project=$PROJECT_ID -f item=$ISSUE_ID --jq '.data.addProjectNextItem.projectNextItem.id')"
echo 'ITEM_ID='$item_id >> $GITHUB_ENV
- name: set project field
if: env.IN_PROJECT == 0
env:
Expand Down
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
"phpcs.composerJsonPath": "src",
"php.suggest.basic": false,
"git.ignoreLimitWarning": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[typescript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
}
}
31 changes: 17 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,31 @@ start: build
docker compose up -d ssl

.PHONY: dev
dev: start
dev: start ui-builder

.PHONY: ui-builder
ui-builder:
docker compose up -d ui-builder

.PHONY: e2e-tests-ci
e2e-tests-ci:
npm ci
$(MAKE) playwright-app
npx playwright install chromium && npx playwright test -c ./test/e2e/playwright.config.ts
$(MAKE) e2e-app
npx playwright install chromium
npx playwright test -c ./test/e2e/playwright.config.ts

.PHONY: e2e-tests
e2e-tests:
e2e-tests: ui-builder
npm install
$(MAKE) playwright-app
docker compose up -d ui-builder
npx playwright install chromium && npx playwright test -c ./test/e2e/playwright.config.ts $(params)
$(MAKE) e2e-app
npx playwright install chromium
npx playwright test -c ./test/e2e/playwright.config.ts $(params)

.PHONY: playwright-app
playwright-app:
.PHONY: e2e-app
e2e-app:
# delete any cached session storage state files if the service isn't running
docker compose ps app-for-playwright > /dev/null 2>&1 || $(MAKE) clean-test
docker compose up -d app-for-playwright --build
# wait until the app-for-playwright service is serving up HTTP before continuing
until curl localhost:3238 > /dev/null 2>&1; do sleep 1; done
docker compose ps e2e-app > /dev/null 2>&1 || $(MAKE) clean-test
docker compose up -d e2e-app --build

.PHONY: unit-tests
unit-tests:
Expand Down Expand Up @@ -70,8 +72,9 @@ clean:
docker compose down
docker system prune -f

.PHONY: clean-test
clean-test:
cd test/e2e && npx rimraf test-storage-state test-results
cd test/e2e && npx rimraf test-storage-state

.PHONY: clean-powerwash
clean-powerwash: clean
Expand Down
14 changes: 7 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ services:
command: sh -c "postconf -e 'default_transport = retry:no outbound email allowed' && /run.sh"

db:
image: mongo:5
image: mongo:6
container_name: lf-db
ports:
# exposed this to host for admin tools
Expand All @@ -204,9 +204,8 @@ services:
- MONGO_INITDB_DATABASE=scriptureforge

ld-db:
image: mysql:5.7
image: mariadb:10.10
container_name: ld-db
platform: linux/amd64
# To access the MySQL database via localhost:3306 on your dev machine (e.g., in VS Code), uncomment the "ports" config below
# Note that if you're running MySQL on your dev machine already, change the first number to something else, like 3307 and access localhost:3307
# ports:
Expand All @@ -223,6 +222,7 @@ services:

ld-api:
image: sillsdev/web-languagedepot-api
platform: linux/amd64
container_name: ld-api
depends_on:
- ld-db
Expand All @@ -236,13 +236,13 @@ services:
- MYSQL_ROOT_PASSWORD=also-not-a-secret
- JWT_SIGNING_KEY=bogus-development-token

app-for-playwright:
e2e-app:
build:
dockerfile: docker/app/Dockerfile
args:
- ENVIRONMENT=development
image: lf-app-for-playwright
container_name: app-for-playwright
image: lf-e2e-app
container_name: e2e-app
platform: linux/amd64
depends_on:
- db
Expand All @@ -266,7 +266,7 @@ services:
- "host.docker.internal:host-gateway"
volumes:
- ./test/e2e/utils/TestControl.php:/var/www/src/Api/Service/TestControl.php
- ./test/e2e/shared-files:/tmp/e2e-shared-files
- ./test/data:/tmp/e2e-test-data
- lf-ui-dist:/var/www/html/dist

# needed this volume mapping so changes to partials would be reflected in running app (e.g. HTML)
Expand Down
2 changes: 1 addition & 1 deletion docker/deployment/db-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ spec:
spec:
containers:
- name: db
image: mongo:5
image: mongo:6
# https://kubernetes.io/docs/concepts/configuration/manage-resources-containers
resources:
requests:
Expand Down
5 changes: 3 additions & 2 deletions docs/DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ ngrok will return two URLs, one http and one https, that contain what is being s

### Running Playwright E2E Tests

Before running Playwright tests for the first time use `npx playwright install-deps chromium` to install chromium dependencies. It will ask for root access.
Before running Playwright tests for the first time use `npx playwright install --with-deps chromium` to install chromium with its dependencies. It will ask for root access.
After Playwright updates, you'll likely need to run `npx playwright install` to update the browsers, but Playwright should provide fairly explicit failure logs if that's the case.

1. `make e2e-tests`
1. Test results will appear in your terminal
Expand Down Expand Up @@ -175,7 +176,7 @@ If you encounter errors such as VSCode cannot find a file in the path "vendor",

### Playwright E2E Test Debugging

Head on over to [Hanna's tutorial on debugging Playwright E2E tests](test/e2e/playwright_guide/playwright_cheatsheet.md) for more information.
Head on over to [Hanna's tutorial on debugging Playwright E2E tests](../test/e2e/playwright_guide/playwright_cheatsheet.md) for more information.

## Style Guides

Expand Down
8 changes: 4 additions & 4 deletions docs/DIAGRAM.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ flowchart TB
ld-api[ld-api port: 3000]
ld-api --> ld-db
app-for-playwright
app-for-playwright -- port 27017 ---> db
app-for-playwright -- port 25 ---> mail
app-for-playwright -- port 3000 ---> ld-api
e2e-app
e2e-app -- port 27017 ---> db
e2e-app -- port 25 ---> mail
e2e-app -- port 3000 ---> ld-api
test-php
test-php -- port 27017 --> db
Expand Down
Loading

0 comments on commit d1b84e1

Please sign in to comment.