-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: refactor test scripts (#4577)
* chore: refactor test scripts * chore: format * fix: UESIO_DEV needed for nx graph due to cypress.config.ts * fix: debug for nx failing to build graph * chore: add more diag info and explicitly ignore go-build-cache directory for nx * chore: finalize nx graph fix * chore: don't leak -e for env setup * chore: refactor build steps for docker tests * chore: ignore go-build-cache in .gitignore instead
- Loading branch information
Showing
24 changed files
with
310 additions
and
193 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
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
62 changes: 62 additions & 0 deletions
62
apps/platform-integration-tests/hurl_seeds/delete_app.hurl
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,62 @@ | ||
POST https://{{host}}:{{port}}/site/auth/uesio/core/mock/login | ||
{ | ||
"token": "uesio" | ||
} | ||
# Extract the sessionid from set-cookie header | ||
HTTP 200 | ||
[Captures] | ||
session_id: cookie "sessid" | ||
user_id: jsonpath "$.user.id" | ||
|
||
# Delete the test site if it already exists | ||
DELETE https://{{host}}:{{port}}/site/api/v1/collection/uesio/studio/site?uesio/studio.name=eq.testsite | ||
x-uesio-app: uesio/tests | ||
HTTP 204 | ||
|
||
# Delete the tests app if it already exists, which should cascade delete the workspace and all of its metadata | ||
DELETE https://{{host}}:{{port}}/site/api/v1/collection/uesio/studio/app?uesio/studio.fullname=eq.uesio%2Ftests | ||
HTTP 204 | ||
|
||
# Verify that workspaces are cascade deleted | ||
POST https://{{host}}:{{port}}/site/wires/load | ||
{ | ||
"wires": [ | ||
{ | ||
"name": "workspaces", | ||
"collection": "uesio/studio.workspace", | ||
"conditions": [ | ||
{ | ||
"field": "uesio/studio.app->uesio/studio.fullname", | ||
"operator": "EQ", | ||
"value": "uesio/tests" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
HTTP 200 | ||
[Asserts] | ||
jsonpath "$.wires[0].errors" not exists | ||
jsonpath "$.wires[0].data" count == 0 | ||
|
||
# Verify that sites are cascade deleted | ||
POST https://{{host}}:{{port}}/site/wires/load | ||
{ | ||
"wires": [ | ||
{ | ||
"name": "sites", | ||
"collection": "uesio/studio.site", | ||
"conditions": [ | ||
{ | ||
"field": "uesio/studio.app->uesio/studio.fullname", | ||
"operator": "EQ", | ||
"value": "uesio/tests" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
HTTP 200 | ||
[Asserts] | ||
jsonpath "$.wires[0].errors" not exists | ||
jsonpath "$.wires[0].data" count == 0 |
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,9 +1,24 @@ | ||
#!/bin/bash | ||
|
||
# Generate a new primary key | ||
openssl req -new -x509 -newkey rsa:2048 -sha256 -nodes -keyout private.key -days 3560 -out certificate.crt -config config.txt | ||
CERT_FILE="$PWD/certificate.crt" | ||
|
||
# OS X shortcut to automatically trust the certificate | ||
if [[ "$(uname)" == "Darwin" ]]; then | ||
sudo security add-trusted-cert -d -r trustRoot -k "/Library/Keychains/System.keychain" "$PWD/certificate.crt" | ||
if [ -f "$CERT_FILE" ]; then | ||
echo "SSL certificate already exists. Delete the existing certificate and re-run to generate a new SSL certificate." | ||
else | ||
# Generate a new primary key | ||
openssl req -new -x509 -newkey rsa:2048 -sha256 -nodes -keyout private.key -days 3560 -out "$CERT_FILE" -config config.txt | ||
echo "SSL Certificate and private key created!" | ||
|
||
# OS X shortcut to automatically trust the certificate | ||
if [[ "$(uname)" == "Darwin" ]]; then | ||
sudo security add-trusted-cert -d -r trustRoot -k "/Library/Keychains/System.keychain" "$CERT_FILE" | ||
else | ||
# Update CA certificates so that CLI and Curl will not complain when connecting | ||
# to our local Uesio instance with self-signed certificate | ||
# TODO: update-ca-certificates should be fairly portable across distros but may need to handle differently in some cases | ||
sudo cp "$CERT_FILE" /usr/local/share/ca-certificates/ | ||
sudo update-ca-certificates | ||
fi | ||
echo "System certificate trust store updated to trust SSL certificate!" | ||
fi | ||
|
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,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Initial setup | ||
source ./scripts/tests/setup-common.sh | ||
|
||
# cleans up the tests app and workspaces, | ||
# and verifies that cleanup worked as expected | ||
bash "scripts/tests/cleanup-common.sh" |
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Initial setup | ||
source ./scripts/tests/setup-common.sh | ||
|
||
# Initialize the sample app and seed test data | ||
bash "scripts/tests/init-common.sh" |
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
Oops, something went wrong.