Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CMSP-1140] add Playwright tests for multisite (#140)
* abstract out the site_id and pass a site url to playwright we can copy this pattern for subdomain and subdirectory multisites * allow site name to come from environment * move playwright tests to repeatable composate action * run actions/checkout first maybe remove this from composite? * remove checkout from composite action * Update playwright.yml to use the correct path for run-playwright-tests * pass all the parameters from the workflow that has that info * add shell * add logging * log the deletion, too * pass the site name to the playwright tests * fix broken colors * add stdbuf to commands to log everything to the terminal * shorten the names so they're easier to read in the action workflow * set the upstream id * reference the action file directly * create application.php files for subdir & subdom multisite * copy the config file to the config/ directory * absolutely do not use the action.yml path * fix linting in two new files * just use actual upstream IDs instead of the upstream name * remove comment this isn't relevant anymore * don't set the ID to the new ID set the var to the id 🤦♂️ * check the multisite install when we status check * fix broken conditional * the conditional needs to wrap around the whole multisite block * add a db reset before site install * add the updated application.php file before the multisite check * make sure we're in the right directory * rename the file * be specific about the type of multisite in the commit message * move the wait to the top so we can wait for the previous commit to finish * use the correct site url (not the copy pasta one) * display art for no good reason * wait for the config to hit the server because otherwise we're checking for the install status too early * yeah 🤦♂️ * I guess we just can't do a colored logo * set a max wait on the wait before installing graphql because if a process is running, it'll wait longer, but if a process isn't (like we already waited earlier) then it's just going to use the long timeout * only add the subsite if it doesn't already exist * split the clone and copy updates apart and put the multisite config in the middle this way we're only waiting for sync_code once * we do actually need the github token * fix typo * don't fail if there's nothing to commit * just see if a foo site exists * break the composite workflow into a script * PRIVATE_KEY not SSH_KEY * fix terminus token, too * set defaults & move functions to the bottom * shellcheck * fix the other places inputs were broken * fix secret name * delete the sites when we're done * remove any exits that aren't errors * fix file copy globbing * remove composite action * move install dependencies into action & pantheon host key into script * get last commit message and export to the environment * remove host key command we're still doing it in the action and it works for single site * use the github token * cd to the workspace * need to get PR number * echo the commit message for debugging * use upstream name instead of id * move playwright tests into the main workflow * remove the blue var unused * need to install deps in single site * multisite doesn't add host key copy/pasta the two setups around keys and terminus so it's consistent * rename run-playwright-tests to setup- * Commit GraphQL to the repo * move the workflow:wait to after we copy updates because we're, again, checking multisite config before the commit is there * use test instead of comparing value i think this is failing because it's returning empty when it's not set * don't use test, just run the command * set connection to git always * store the value of the config get in a var and check that * install wp before doing status check * fix subdir siet url vars * force db reset * the script shouldn't fail if foo site isn't found * fix site title * store site name and url in Github env * normalize rest endpoint for multisite * separately apply the filter to rest urls * filter the rest endpoint, too * remove all the wp-json handling * adjust the playwright test to expect the api endpoint to be /wp/wp-json * change the site name before we test the subsite * the graphql endpoint changes if we're on a subsite, too * flush the cache for the sub-site if we're doing multisite * fix the toBeTruthy check * echo with -e for color * fix spacing * only log in if not already logged in allows you to run this locally with existing terminus token * don't flush permalinks here they're flushed after the site is created * add tests for subdomain * fix the subdom site url * [CMSP-1140] Move cookie settings down to use Pantheon hostname (#141) move cookie settings down so we can use pantheon hostname * wrap PANTHEON_ENVIRONMENT with an isset * remove the comment Co-authored-by: Phil Tyler <[email protected]> * make the globals readonly TIL ✨ Co-authored-by: Phil Tyler <[email protected]> * return early don't exit because that bails the script Co-authored-by: Phil Tyler <[email protected]> * use `[[` instead of `[` Co-authored-by: Phil Tyler <[email protected]> * return early Co-authored-by: Phil Tyler <[email protected]> * one terminus command to activate wp-graphql Co-authored-by: Phil Tyler <[email protected]> * use brackets around commit msg * use printf to handle single quotes in commit messages * skip creating a new variable if we do not need it Co-authored-by: Phil Tyler <[email protected]> * strip out single quotes this won't catch everything but maybe it'll catch what's breaking things now * better handling of sed * use printf * strip newlines and carriage returns * better commit message cleaning --------- Co-authored-by: Phil Tyler <[email protected]>
- Loading branch information