Closed gumaerc closed 7 months ago
This is ready for review, although something I find myself wondering at this point is if we should restrict editing of the test sites to superusers? It's probably prudent to prevent accidental changes of the test sites, because one could break the end to end test pipeline by changing content asserted by Playwright tests. This could be addressed pretty easily though, by running loaddata
on the fixtures again. Still, probably best to be cautious.
What are the relevant tickets?
Closes https://github.com/mitodl/ocw-studio/issues/2112
Description (What does it do?)
This PR makes some changes that allows editing of test sites directly from the
ocw-studio
sites UI and ensures that any publishing action pushes the output up to the test bucket instead of the draft / live buckets. Instead of 2 specific env variables for the test sites (OCW_WWW_TEST_SLUG
andOCW_COURSE_TEST_SLUG
) we now haveTEST_ROOT_WEBSITE_NAME
andOCW_TEST_SITE_SLUGS
. TheOCW_TEST_SITE_SLUGS
variable is intended to be a list of strings, allowing the specification of any number of test sites to be included in the end to end test pipeline. Ine2e_test_site_pipeline.py
, these sites are iterated and pipeline steps are generated based on them and added to theacross
. The logic determining what to override if a site is a test site was moved directly intosite_pipeline.py
. Whether or not a site is a test site is determined simply by seeing if the current site'sname
is insettings.OCW_TEST_SITE_SLUGS
. If this is true;noindex
is set toTrue
web_bucket
is set tosettings.AWS_TEST_BUCKET_NAME
offline_bucket
is set tosettings.AWS_OFFLINE_TEST_BUCKET_NAME
static_api_url
is set tosettings.STATIC_API_BASE_URL_TEST
(or theDEV_TEST_URL
constant, ifis_dev
is true)resource_base_url
is set tostatic_api_url
sitemap_domain
is set to the parsed domain ofstatic_api_url
ocw_studio_url
is set tostatic_api_url
if the test website is the root test website, otherwise it's a blank stringurl_path
is set to the website'sname
propertyHow can this be tested?
ocw-studio
and are configured for publishing courses locally as well as running the end to end test pipeline locally. Read more here: https://github.com/mitodl/ocw-studio/?tab=readme-ov-file#end-to-end-testing-of-site-pipelines.env
file:docker compose exec web ./manage.py upsert_e2e_test_pipeline
docker compose exec web ./manage.py upsert_mass_build_pipeline
fly
CLI installed locally, and have usedfly login
to add your locally running Concourse instance as a targetdocker compose exec web ./manage.py backpopulate_pipelines --filter 6-801-machine-vision-fall-2020
ocw-studio
page publish the site live, waiting for it to succeed