mistercrunch commented on a change in pull request #11207:
URL:
https://github.com/apache/incubator-superset/pull/11207#discussion_r508998486
##########
File path: docker/docker-init.sh
##########
@@ -59,3 +60,38 @@ if [ "$SUPERSET_LOAD_EXAMPLES" = "yes" ]; then
superset load_examples
echo_step "4" "Complete" "Loading examples"
fi
+}
+
+with_cypress(){
+ # Configure environment
+ echo_step "1" "Starting" "Configuring environment for Cypress"
+ sed -i '/ENABLE_REACT_CRUD_VIEWS = False/c\ENABLE_REACT_CRUD_VIEWS = True'
/app/superset/config.py
+ sed -i '/ENABLE_REACT_CRUD_VIEWS =
os.environ.get("ENABLE_REACT_CRUD_VIEWS", False)/c\ENABLE_REACT_CRUD_VIEWS =
True' /app/tests/superset_test_config.py
+ export SUPERSET_CONFIG=${SUPERSET_CONFIG}
+ echo_step "1" "Complete" "Configuring environment for Cypress"
+
+ # Initialize the database (drop and recreate tables before)
+ echo_step "2" "Starting" "Applying DB migrations"
+ superset drop_db --yes
+ superset create_db
+ superset db upgrade
+ echo_step "2" "Complete" "Applying DB migrations"
+
+ # Create default roles and permissions
+ echo_step "3" "Starting" "Setting up roles and perms"
+ superset init
+ echo_step "3" "Complete" "Setting up roles and perms"
+
+ # Load Cypress data
+ echo_step "4" "Starting" "Loading Cypress examples"
Review comment:
Lots of copy-pasta here, bash or not bash, let's keep things DRY
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]