Skip to content

Commit

Permalink
Merge pull request #27365 from code-dot-org/staging
Browse files Browse the repository at this point in the history
DTT (Staging > Test) [robo-dtt]
  • Loading branch information
deploy-code-org committed Mar 5, 2019
2 parents a2a1bb4 + 0d778dc commit 3b49aec
Show file tree
Hide file tree
Showing 14 changed files with 222 additions and 27 deletions.
8 changes: 4 additions & 4 deletions SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ You can do Code.org development using OSX, Ubuntu, or Windows (running Ubuntu in
</details>

1. `rake install`
1. [Enable JavaScript builds](#enabling-javascript-builds)
1. Note: You can skip this step if not editing javascript frequently.
1. `rake build`
1. (Optional, Code.org engineers only) Setup AWS - Ask a Code.org engineer how to complete this step
1. Some functionality will not work on your local site without this, for example, some project-backed level types such as https://studio.code.org/projects/gamelab. This setup is only available to Code.org engineers for now, but it is recommended for Code.org engineers.
Expand Down Expand Up @@ -112,6 +110,7 @@ You can do Code.org development using OSX, Ubuntu, or Windows (running Ubuntu in
check to make sure XCode is downloaded and up to date manually.

</details>
1. Install the [Java 8 JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html)

### Ubuntu 16.04 ([Download iso][ubuntu-iso-url]) Note: Virtual Machine Users should check the Windows Note below before starting

Expand Down Expand Up @@ -182,9 +181,10 @@ Many Windows developers have found that setting up an Ubuntu virtual machine is
* navigate to http://localhost-studio.code.org:3000/ on your local machine

## Enabling JavaScript builds
The default dashboard install uses a static build of JS, but if you want to make modifications to these you'll want to enable local builds of the JavaScript packages. You'll need to do this once:
**Note:** the installation process now enables this by default, which is recommended. You can manually edit these values later if you want to disable local JS builds.

If you want to make JavaScript changes and have them take effect locally, you'll want to enable local builds of the JavaScript packages. You'll need to do this once:

1. (OS X) Install the [Java 8 JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
1. Edit locals.yml and enable the following options:

```
Expand Down
4 changes: 4 additions & 0 deletions apps/src/sites/studio/pages/teacher_dashboard/show.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import scriptSelection, {
loadValidScripts
} from '@cdo/apps/redux/scriptSelectionRedux';
import TeacherDashboard from '@cdo/apps/templates/teacherDashboard/TeacherDashboard';
import experiments from '@cdo/apps/util/experiments';

const script = document.querySelector('script[data-dashboard]');
const scriptData = JSON.parse(script.dataset.dashboard);
Expand All @@ -38,6 +39,9 @@ const visibleSections = scriptData.visibleSections;
const baseUrl = `/teacher_dashboard/sections/${section.id}`;

$(document).ready(function() {
// Always make sure teacher-dashboard-react experiment is enabled.
experiments.setEnabled(experiments.TEACHER_DASHBOARD_REACT, true);

registerReducers({
teacherSections,
sectionData,
Expand Down
14 changes: 12 additions & 2 deletions dashboard/app/views/teacher_dashboard/show.html.haml
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
:ruby
studio_url = CDO.studio_url('', CDO.default_scheme)
code_org_url = CDO.code_org_url('', CDO.default_scheme)

split_test_data = {}
split_test_data[:percentage] = DCDO.get('teacher_dashboard_split_test', 0)
split_test_data[:studioUrlPrefix] = studio_url
split_test_data[:pegasusUrlPrefix] = code_org_url

teacher_dashboard_data = {}
teacher_dashboard_data[:studioUrlPrefix] = CDO.studio_url('', CDO.default_scheme)
teacher_dashboard_data[:pegasusUrlPrefix] = CDO.code_org_url('', CDO.default_scheme)
teacher_dashboard_data[:studioUrlPrefix] = studio_url
teacher_dashboard_data[:pegasusUrlPrefix] = code_org_url
teacher_dashboard_data[:visibleSections] = @visible_sections
teacher_dashboard_data[:section] = @section

%script{src: '/shared/js/teacherDashboardSplitTest.js', data: {splittest: split_test_data.to_json}}

%script{src: minifiable_asset_path('js/teacher_dashboard/show.js'), data: {dashboard: teacher_dashboard_data.to_json}}

#teacher-dashboard
14 changes: 14 additions & 0 deletions dashboard/test/ui/features/spritelab/eyes.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@eyes
@dashboard_db_access
@as_student
Feature: Sprite Lab Eyes

Scenario: Basic Sprite Lab level
When I open my eyes to test "sprite lab eyes"
And I start a new Sprite Lab project
Then I see no difference for "initial load"
And I've initialized the workspace for the sample Sprite Lab project
Then I see no difference for "preview"
Then I press "runButton"
Then I see no difference for "run"
And I close my eyes
7 changes: 7 additions & 0 deletions dashboard/test/ui/features/step_definitions/blockly.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@
expect(actual_parent_id).not_to eq(get_block_id(parent))
end

And /^I've initialized the workspace for the sample Sprite Lab project$/ do
clear_main_block_space
blocks_xml = '<xml><block type="when_run" movable="false"><next><block type="gamelab_createNewSprite"><title name="NAME">mySprite</title><title name="COSTUME">"bear"</title><value name="LOCATION"><block type="gamelab_location_picker"><title name="LOCATION">{"x":200,"y":200}</title></block></value><next><block type="gamelab_createNewSprite"><title name="NAME">mySprite1</title><title name="COSTUME">"pig"</title><value name="LOCATION"><block type="gamelab_location_picker"><title name="LOCATION">{"x":340,"y":65}</title></block></value><next><block type="gamelab_setBackground"><value name="COLOR"><block type="colour_picker"><title name="COLOUR">#ffcc66</title></block></value></block></next></block></next></block></next></block><block type="behavior_definition" editable="false" usercreated="true"><mutation><arg name="this sprite" type="Sprite"></arg></mutation><title name="NAME">growing</title><statement name="STACK"><block type="gamelab_changePropBy"><title name="PROPERTY">"scale"</title><value name="SPRITE"><block type="sprite_parameter_get"><title name="VAR">this sprite</title></block></value><value name="VAL"><block type="math_number"><title name="NUM">1</title></block></value></block></statement></block><block type="behavior_definition" editable="false" usercreated="true"><mutation><arg name="this sprite" type="Sprite"></arg></mutation><title name="NAME">jittering</title><statement name="STACK"><block type="gamelab_changePropBy"><title name="PROPERTY">"scale"</title><value name="SPRITE"><block type="sprite_parameter_get"><title name="VAR">this sprite</title></block></value><value name="VAL"><block type="math_random_int"><value name="FROM"><block type="math_number"><title name="NUM">-1</title></block></value><value name="TO"><block type="math_number"><title name="NUM">1</title></block></value></block></value></block></statement></block><block type="behavior_definition" editable="false" usercreated="true"><mutation><arg name="this sprite" type="Sprite"></arg></mutation><title name="NAME">moving east</title><statement name="STACK"><block type="gamelab_moveInDirection"><title name="DIRECTION">"East"</title><value name="SPRITE"><block type="sprite_parameter_get"><title name="VAR">this sprite</title></block></value><value name="DISTANCE"><block type="math_number"><title name="NUM">5</title></block></value></block></statement></block><block type="behavior_definition" editable="false" usercreated="true"><mutation><arg name="this sprite" type="Sprite"></arg></mutation><title name="NAME">moving north</title><statement name="STACK"><block type="gamelab_moveInDirection"><title name="DIRECTION">"North"</title><value name="SPRITE"><block type="sprite_parameter_get"><title name="VAR">this sprite</title></block></value><value name="DISTANCE"><block type="math_number"><title name="NUM">5</title></block></value></block></statement></block><block type="behavior_definition" editable="false" usercreated="true"><mutation><arg name="this sprite" type="Sprite"></arg></mutation><title name="NAME">moving south</title><statement name="STACK"><block type="gamelab_moveInDirection"><title name="DIRECTION">"South"</title><value name="SPRITE"><block type="sprite_parameter_get"><title name="VAR">this sprite</title></block></value><value name="DISTANCE"><block type="math_number"><title name="NUM">5</title></block></value></block></statement></block><block type="behavior_definition" editable="false" usercreated="true"><mutation><arg name="this sprite" type="Sprite"></arg></mutation><title name="NAME">moving west</title><statement name="STACK"><block type="gamelab_moveInDirection"><title name="DIRECTION">"West"</title><value name="SPRITE"><block type="sprite_parameter_get"><title name="VAR">this sprite</title></block></value><value name="DISTANCE"><block type="math_number"><title name="NUM">5</title></block></value></block></statement></block><block type="behavior_definition" editable="false"><mutation><arg name="this sprite" type="Sprite"></arg></mutation><title name="NAME">spinning right</title><statement name="STACK"><block type="gamelab_turn"><title name="DIRECTION">"right"</title><value name="SPRITE"><block type="sprite_parameter_get"><title name="VAR">this sprite</title></block></value><value name="N"><block type="math_number"><title name="NUM">6</title></block></value></block></statement></block><block type="behavior_definition" editable="false" usercreated="true"><mutation><arg name="this sprite" type="Sprite"></arg></mutation><title name="NAME">wandering</title><statement name="STACK"><block type="controls_if"><value name="IF0"><block type="logic_compare"><title name="OP">EQ</title><value name="A"><block type="math_random_int"><value name="FROM"><block type="math_number"><title name="NUM">0</title></block></value><value name="TO"><block type="math_number"><title name="NUM">5</title></block></value></block></value><value name="B"><block type="math_number"><title name="NUM">0</title></block></value></block></value><statement name="DO0"><block type="gamelab_changePropBy"><title name="PROPERTY">"direction"</title><value name="SPRITE"><block type="sprite_parameter_get"><title name="VAR">this sprite</title></block></value><value name="VAL"><block type="math_random_int"><value name="FROM"><block type="math_number"><title name="NUM">-25</title></block></value><value name="TO"><block type="math_number"><title name="NUM">25</title></block></value></block></value></block></statement><next><block type="gamelab_moveForward"><value name="SPRITE"><block type="sprite_parameter_get"><title name="VAR">this sprite</title></block></value><value name="DISTANCE"><block type="math_number"><title name="NUM">1</title></block></value><next><block type="controls_if"><value name="IF0"><block type="gamelab_isTouchingEdges"><value name="SPRITE"><block type="sprite_parameter_get"><title name="VAR">this sprite</title></block></value></block></value><statement name="DO0"><block type="gamelab_edgesDisplace"><value name="SPRITE"><block type="sprite_parameter_get"><title name="VAR">this sprite</title></block></value><next><block type="gamelab_changePropBy"><title name="PROPERTY">"direction"</title><value name="SPRITE"><block type="sprite_parameter_get"><title name="VAR">this sprite</title></block></value><value name="VAL"><block type="math_random_int"><value name="FROM"><block type="math_number"><title name="NUM">135</title></block></value><value name="TO"><block type="math_number"><title name="NUM">225</title></block></value></block></value></block></next></block></statement></block></next></block></next></block></statement></block><block type="behavior_definition" deletable="false" movable="false" editable="false"><mutation><arg name="this sprite" type="Sprite"></arg><description>move a sprite horizontally, reversing direction if it touches the edges of the screen</description></mutation><title name="NAME">swimming left and right</title><statement name="STACK"><block type="controls_if"><mutation elseif="1"></mutation><value name="IF0"><block type="logic_compare"><title name="OP">EQ</title><value name="A"><block type="gamelab_getProp"><title name="PROPERTY">"direction"</title><value name="SPRITE"><block type="sprite_parameter_get"><title name="VAR">this sprite</title></block></value></block></value><value name="B"><block type="math_number"><title name="NUM">0</title></block></value></block></value><statement name="DO0"><block type="gamelab_mirrorSprite"><title name="DIRECTION">"right"</title><value name="SPRITE"><block type="sprite_parameter_get"><title name="VAR">this sprite</title></block></value></block></statement><value name="IF1"><block type="logic_compare"><title name="OP">EQ</title><value name="A"><block type="gamelab_getProp"><title name="PROPERTY">"direction"</title><value name="SPRITE"><block type="sprite_parameter_get"><title name="VAR">this sprite</title></block></value></block></value><value name="B"><block type="math_number"><title name="NUM">180</title></block></value></block></value><statement name="DO1"><block type="gamelab_mirrorSprite"><title name="DIRECTION">"left"</title><value name="SPRITE"><block type="sprite_parameter_get"><title name="VAR">this sprite</title></block></value></block></statement><next><block type="gamelab_moveForward"><value name="SPRITE"><block type="sprite_parameter_get"><title name="VAR">this sprite</title></block></value><value name="DISTANCE"><block type="math_number"><title name="NUM">5</title></block></value><next><block type="controls_if"><value name="IF0"><block type="gamelab_isTouchingEdges"><value name="SPRITE"><block type="sprite_parameter_get"><title name="VAR">this sprite</title></block></value></block></value><statement name="DO0"><block type="gamelab_edgesDisplace"><value name="SPRITE"><block type="sprite_parameter_get"><title name="VAR">this sprite</title></block></value><next><block type="gamelab_changePropBy"><title name="PROPERTY">"direction"</title><value name="SPRITE"><block type="sprite_parameter_get"><title name="VAR">this sprite</title></block></value><value name="VAL"><block type="math_number"><title name="NUM">180</title></block></value></block></next></block></statement></block></next></block></next></block></statement></block><block type="behavior_definition" deletable="false" movable="false" editable="false"><mutation><arg name="this sprite" type="Sprite"></arg><description>move a sprite across the screen, reversing direction if it touches the edges</description></mutation><title name="NAME">patrolling</title><statement name="STACK"><block type="gamelab_moveForward"><value name="SPRITE"><block type="sprite_parameter_get"><title name="VAR">this sprite</title></block></value><value name="DISTANCE"><block type="math_number"><title name="NUM">5</title></block></value><next><block type="controls_if"><value name="IF0"><block type="gamelab_isTouchingEdges"><value name="SPRITE"><block type="sprite_parameter_get"><title name="VAR">this sprite</title></block></value></block></value><statement name="DO0"><block type="gamelab_edgesDisplace"><value name="SPRITE"><block type="sprite_parameter_get"><title name="VAR">this sprite</title></block></value><next><block type="gamelab_changePropBy"><title name="PROPERTY">"direction"</title><value name="SPRITE"><block type="sprite_parameter_get"><title name="VAR">this sprite</title></block></value><value name="VAL"><block type="math_number"><title name="NUM">180</title></block></value></block></next></block></statement></block></next></block></statement></block><block type="behavior_definition" deletable="false" movable="false" editable="false"><mutation><arg name="this sprite" type="Sprite"></arg><description>change the size of a sprite</description></mutation><title name="NAME">shrinking</title><statement name="STACK"><block type="gamelab_changePropBy"><title name="PROPERTY">"scale"</title><value name="SPRITE"><block type="sprite_parameter_get"><title name="VAR">this sprite</title></block></value><value name="VAL"><block type="math_number"><title name="NUM">-1</title></block></value></block></statement></block><block type="behavior_definition" deletable="false" movable="false" editable="false"><mutation><arg name="this sprite" type="Sprite"></arg><description>rotate a sprite to its left</description></mutation><title name="NAME">spinning left</title><statement name="STACK"><block type="gamelab_turn"><title name="DIRECTION">"left"</title><value name="SPRITE"><block type="sprite_parameter_get"><title name="VAR">this sprite</title></block></value><value name="N"><block type="math_number"><title name="NUM">6</title></block></value></block></statement></block></xml>'
arranged_blocks_xml = @browser.execute_script("return __TestInterface.arrangeBlockPosition('" + blocks_xml + "', {});")
@browser.execute_script("__TestInterface.loadBlocks('" + arranged_blocks_xml + "');")
end

And /^I've initialized the workspace with an auto\-positioned flappy puzzle$/ do
clear_main_block_space
blocks_xml = '<xml><block type="flappy_whenClick" deletable="false"><next><block type="flappy_flap_height"><title name="VALUE">Flappy.FlapHeight.NORMAL</title><next><block type="flappy_playSound"><title name="VALUE">"sfx_wing"</title></block></next></block></next></block><block type="flappy_whenCollideGround" deletable="false"><next><block type="flappy_endGame"></block></next></block><block type="when_run" deletable="false"><next><block type="flappy_setSpeed"><title name="VALUE">Flappy.LevelSpeed.NORMAL</title></block></next></block><block type="flappy_whenCollideObstacle" deletable="false"><next><block type="flappy_endGame"></block></next></block><block type="flappy_whenEnterObstacle" deletable="false"><next><block type="flappy_incrementPlayerScore"></block></next></block></xml>'
Expand Down
7 changes: 7 additions & 0 deletions dashboard/test/ui/features/step_definitions/spritelab.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Given /^I start a new Sprite ?Lab project$/ do
steps <<-STEPS
And I am on "http://studio.code.org/projects/spritelab/new"
And I rotate to landscape
And I wait for the page to fully load
STEPS
end

0 comments on commit 3b49aec

Please sign in to comment.