-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #285 from SlateFoundation/features/e2e-tests
feat: automated e2e tests
- Loading branch information
Showing
20 changed files
with
387 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
name: 'Test: End-to-end' | ||
|
||
on: pull_request | ||
|
||
env: | ||
HAB_LICENSE: accept-no-persist | ||
HOLO_CACHE_TO: origin | ||
HOLO_CACHE_FROM: origin | ||
|
||
jobs: | ||
test-e2e: | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
# TODO: wrap the next three steps an an emergence-studio action | ||
- name: 'Stop default mysql service' | ||
run: sudo service mysql stop | ||
|
||
- name: 'Initialize Chef Habitat environment' | ||
uses: JarvusInnovations/habitat-action@action/v1 | ||
env: | ||
HAB_NGINX: | | ||
[http.listen] | ||
port = 5580 | ||
HAB_MYSQL: | | ||
app_username = 'appadmin' | ||
app_password = 'appadmin' | ||
bind = '0.0.0.0' | ||
HAB_PHP_RUNTIME: | | ||
[sites.default.holo] | ||
gitDir = '${{ github.workspace }}/.git' | ||
with: | ||
deps: | | ||
jarvus/hologit | ||
supervisor: | | ||
core/mysql | ||
emergence/php-runtime --bind="database:mysql.default" | ||
emergence/nginx --bind="backend:php-runtime.default" | ||
- name: Waiting for MySQL | ||
run: | | ||
until nc -z localhost 3306; do | ||
sleep 0.5 | ||
echo -n "." | ||
done | ||
- name: Waiting for Emergence runtime | ||
run: | | ||
until nc -z localhost 9123; do | ||
sleep 0.5 | ||
echo -n "." | ||
done | ||
- name: Configure command-line client access | ||
run: | | ||
sudo chmod ugo+xr \ | ||
/hab/svc/mysql/config \ | ||
/hab/svc/mysql/config/client.cnf \ | ||
/hab/svc/php-runtime/config \ | ||
/hab/svc/php-runtime/config/fpm-exec | ||
ln -sf /hab/svc/mysql/config/client.cnf ~/.my.cnf | ||
- name: Load site projection into emergence runtime | ||
env: | ||
HOLO_CACHE_FROM: origin | ||
HOLO_CACHE_TO: origin | ||
run: | | ||
SITE_TREE="$(hab pkg exec jarvus/hologit git-holo project emergence-site)" | ||
[ -n "${SITE_TREE}" ] || exit 1 | ||
hab pkg exec emergence/php-runtime emergence-php-load "${SITE_TREE}" | ||
- name: Set up Cypress workspace | ||
run: | | ||
CYPRESS_TREE="$(hab pkg exec jarvus/hologit git-holo project cypress-workspace)" | ||
[ -n "${CYPRESS_TREE}" ] || exit 1 | ||
mkdir "${GITHUB_WORKSPACE}.cypress-workspace" | ||
git archive --format=tar "${CYPRESS_TREE}" | (cd "${GITHUB_WORKSPACE}.cypress-workspace" && tar xf -) | ||
- name: Run Cypress tests | ||
uses: cypress-io/github-action@v2 | ||
env: | ||
GIT_DIR: ${{ github.workspace }}/.git | ||
GIT_WORK_TREE: ${{ github.workspace }} | ||
with: | ||
env: STUDIO_CONTAINER=,STUDIO_SSH= | ||
working-directory: ${{ github.workspace }}.cypress-workspace | ||
|
||
- name: Upload supervisor log | ||
uses: actions/upload-artifact@v1 | ||
if: always() | ||
with: | ||
name: supervisor-log | ||
path: /hab/sup/default/sup.log | ||
|
||
- name: Upload Cypress screenshots | ||
uses: actions/upload-artifact@v1 | ||
if: failure() | ||
with: | ||
name: cypress-screenshots | ||
path: ${{ github.workspace }}.cypress-workspace/cypress/screenshots | ||
|
||
- name: Upload Cypress videos | ||
uses: actions/upload-artifact@v1 | ||
if: always() | ||
with: | ||
name: cypress-videos | ||
path: ${{ github.workspace }}.cypress-workspace/cypress/videos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[holomapping] | ||
holosource="=>cypress-workspace" | ||
files = "**" | ||
before = "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[holomapping] | ||
files = [ | ||
"cypress/**", | ||
"cypress.json", | ||
"package.json", | ||
"package-lock.json", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[holosource] | ||
url = "https://github.com/JarvusInnovations/emergence-skeleton-v2" | ||
ref = "refs/tags/v2.6.2" | ||
ref = "refs/tags/v2.6.6" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"baseUrl": "http://localhost:5580", | ||
"env": { | ||
"STUDIO_CONTAINER": "slate-studio", | ||
"TEST_USER": "teacher" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"selectors": { | ||
"gallery-photo": ".available-photos .photo-item", | ||
"gallery-photo-first": ".available-photos .photo-item:first-of-type", | ||
"gallery-default-link": "a[title=\"Make Default\"][href^=\"/profile/primaryPhoto?\"]", | ||
"gallery-default-link": "a[title=\"Make Default\"][href^=\"/profile/primaryPhoto?\"]", | ||
"about-content": "main.content .about-bio" | ||
}, | ||
"values": { | ||
"gallery-photo-selected-class": "current", | ||
"profile-markdown-link-text": "Markdown", | ||
"profile-markdown-link-href": "https://www.markdownguide.org/cheat-sheet", | ||
"profile-save-button-text": "Save Profile", | ||
"profile-data": { | ||
"Class": "Emergence\\People\\User", | ||
"FirstName": "Teacher", | ||
"LastName": "Slate", | ||
"Username": "teacher", | ||
"AccountLevel": "Staff" | ||
} | ||
}, | ||
"features": { | ||
"location": false, | ||
"gallery": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
describe.skip('Registration', () => { | ||
/** | ||
* The registration test is temporarily disabled for Slate because | ||
* registration is disabled by default in Slate installations. | ||
* | ||
* In the future, we could create a pathway for the cypress test to | ||
* execute writing a file into the php-config tree through some | ||
* reliable API into the studio | ||
**/ | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,13 @@ theme: | |
palette: | ||
primary: "cyan" | ||
accent: "orange" | ||
|
||
extra: | ||
repository: | ||
name: slate | ||
url: [email protected]:SlateFoundation/slate.git | ||
studio: | ||
web_port: 5580 | ||
static_port: 5581 | ||
docs_port: 5588 | ||
mysql_port: 5536 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
extra: | ||
fixtures: | ||
users: | ||
- username: system | ||
password: system | ||
level: Developer | ||
about: 'Full system access' | ||
- username: admin | ||
password: admin | ||
level: Administrator | ||
about: 'Manage site and staff' | ||
- username: teacher | ||
password: teacher | ||
level: Staff | ||
about: 'Staff access with teaching role in multiple courses sections' | ||
- username: teacher2 | ||
password: teacher2 | ||
level: Staff | ||
about: 'Staff access with teaching role in multiple course sections' | ||
- username: student | ||
password: student | ||
level: User | ||
about: 'Student user with student role in multiple course sections' | ||
- username: student2 | ||
password: student2 | ||
level: User | ||
about: 'Student user with student role in multiple course sections' | ||
- username: student3 | ||
password: student3 | ||
level: User | ||
about: 'Student user with no roles in any course sections' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.