Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Papyros integration #3453

Merged
merged 110 commits into from
Apr 25, 2022
Merged

Papyros integration #3453

merged 110 commits into from
Apr 25, 2022

Conversation

winniederidder
Copy link
Contributor

@winniederidder winniederidder commented Mar 1, 2022

This pull request integrates Papyros into Dodona to allow users to write and run code within their browser.

Papyros makes use of WebWorkers, requiring SharedArrayBuffers to communicate. Enabling this feature in the browser requires specific HTTP headers to be set on resources used in the pages where this feature is enabled. Examples of such resources are /packs and /assets. For production/staging, these headers must be enabled on the server. In development, this can be taken care of with configuration in config/development.rb .
Some HTTP headers must also be added to responses concerning exercises and their description to allow the iframes to load everything correctly and securely.

  • Tests were added
  • Documentation update can be found at dodona-edu/dodona-edu.github.io#

Closes #3232 .

@winniederidder winniederidder requested a review from chvp as a code owner March 1, 2022 14:32
@winniederidder winniederidder requested a review from a team as a code owner March 1, 2022 14:36
@winniederidder winniederidder requested review from bmesuere and removed request for a team March 1, 2022 14:36
@winniederidder winniederidder requested a review from bmesuere April 24, 2022 13:44
@@ -20,7 +20,7 @@
end

Capybara.configure do |config|
config.default_max_wait_time = 10
config.default_max_wait_time = 20
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary? The value of 10 was there with a reason to keep the total runtime of these tests acceptable. These tests have increased it from 2.5 to 3.5 minutes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pyodide intialization takes a while, so running a piece of code and expecting output to show up takes a while. The find methods take their waiting time from the capybara config and it doesn't seem to be possible to update the config for this test file only. This system test probably also takes longer because separate pages are loaded per test. I can try to do it all on the same page instead and make the waits longer only when required.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the minitest-suite we use support test nesting? Something similar to Jest using 'describe' and 'it'-blocks, as now I combined all tests into a big one separated by comment lines to prevent having to load Pyodide from scratch multiple times.

@winniederidder winniederidder requested a review from bmesuere April 24, 2022 18:22
@bmesuere bmesuere merged commit f0d5c29 into develop Apr 25, 2022
@bmesuere bmesuere deleted the papyros-integration-v2 branch April 25, 2022 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Initial Papyros integration
7 participants