Skip to content

Demo improvements - #1675

Merged
coolreader18 merged 8 commits into
masterfrom
coolreader18/demo-improvements
Jan 23, 2020
Merged

coolreader18 merged 8 commits into
masterfrom
coolreader18/demo-improvements

Conversation

@coolreader18

Copy link
Copy Markdown
Member
  • Add a new snippet, asyncbrowser - a mini async/await executor built on the browser event loop.
    • Maybe eventually turn it into a module?
  • Combine index.js and main.js into one, to avoid the page being essentially without content while the wasm payload loads.
  • Add rp.pyExec and rp.pyExecSingle to the "documentation".
  • Improve the ci testing for wasm
    • Handle serving the demo and waiting inside python, so that you can just build the demo and run pipenv run pytest without having to mess with the npm commands.
    • Deduplicate the driver fixture, move it to wdriver in conftest.py.

@coolreader18
coolreader18 force-pushed the coolreader18/demo-improvements branch from a6e7835 to 6feb0d7 Compare January 13, 2020 03:58
Comment thread wasm/demo/src/index.js

@palaviv palaviv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks great

Comment thread wasm/tests/conftest.py
) from ex


from selenium import webdriver

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How about splitting the conftest into two files. One for the server setup and one for the selenium?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think it's good to have it in one file, because ideally the connection between the server and the wdriver fixture should be an "implementation detail" (whatever that means for test infrastructure) -- essentially, the http server is just a means to an end of loading the demo into the webdriver.

Comment thread wasm/tests/conftest.py
server_proc = None


def pytest_sessionstart(session):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How about changing this to be a module scope fixture?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Then the server would have to be started and stopped for every test, and given that a simple http server is stateless anyway, I don't think it makes much of a difference.

@coolreader18
coolreader18 merged commit 69830bb into master Jan 23, 2020
@coolreader18
coolreader18 deleted the coolreader18/demo-improvements branch January 26, 2020 07:07
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.

2 participants