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

Add tests for static_react_task example #795

Merged
merged 32 commits into from
Jul 8, 2022
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b116336
✅ Added passing tests for static_react_task
Etesam913 Jun 16, 2022
a091438
🔥 Removed the starter test
Etesam913 Jun 16, 2022
379c9e9
🔧 Configured github actions for cypress
Etesam913 Jun 17, 2022
481433f
✏️ Added correct extension to workflow
Etesam913 Jun 17, 2022
8bcd15c
🔥 Removed extraneous code from cypress folder
Etesam913 Jun 17, 2022
ee4d978
📝 Added info on cypress testing to contributing.md
Etesam913 Jun 17, 2022
0aee860
🐛 Fixed request_agent test being inconsistent
Etesam913 Jun 18, 2022
7bc4f1b
✨ Added ability to link packages from command line
Etesam913 Jun 20, 2022
9ee7203
Merge branch 'main' of https://github.com/facebookresearch/Mephisto i…
Etesam913 Jun 20, 2022
ac59bbd
✨ Added command line arg to other examples
Etesam913 Jun 20, 2022
3c392a5
⛓ Updated github action to link to mephisto-task
Etesam913 Jun 20, 2022
113b8a8
✏️ Renamed the test
Etesam913 Jun 20, 2022
b944d78
🎨 Added spacing
Etesam913 Jun 20, 2022
a5cc65f
🔥 Delete commented out file
Etesam913 Jun 20, 2022
2e989e9
⏮ Reverting test back
Etesam913 Jun 20, 2022
f904089
🔥 Removed defineConfig from cypressConfig
Etesam913 Jun 21, 2022
721b4e6
🔀 Pulled from origin
Etesam913 Jun 21, 2022
0fc65a1
🐛 Fixed syntax bug
Etesam913 Jun 21, 2022
5702d9e
🔧 Updated hydra config to accept two new parameters
Etesam913 Jun 21, 2022
41cc544
📝 Added post_build_script to cypress start action
Etesam913 Jun 21, 2022
6b40eed
✏️ Updated contributing to two new sections
Etesam913 Jun 22, 2022
d5e846d
📦 Moved troubleshooting section
Etesam913 Jun 22, 2022
eb27dc9
✏️ Fixed typo in CONTRIBUTING.md
Etesam913 Jun 23, 2022
00e0023
✅ Simplified the tests for alerts
Etesam913 Jun 24, 2022
35b3f28
🔥 Removed extraneous code
Etesam913 Jun 24, 2022
d34a2ef
✏️ Added testing section to readme of task
Etesam913 Jun 26, 2022
e1393b9
✏️ Fixed typos in task_run fields
Etesam913 Jun 27, 2022
14beded
✏️ Renamed post_build_script field
Etesam913 Jun 27, 2022
db879d5
✏️ Replaced all occurrences of post_build_script
Etesam913 Jun 27, 2022
28c8431
🥅 Update build_bundle to work with no run_config
Etesam913 Jul 5, 2022
ff7ae27
🔥 Removed two properties from hydra_config
Etesam913 Jul 5, 2022
cd3a36c
🚨 Removed parameter warnings as they were too noisy
Etesam913 Jul 6, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/cypress-e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: cypress-e2e-tests
on:
pull_request:
push:
branches: [main]

jobs:
static-react-task:
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: 🔀 Checking out repo
uses: actions/checkout@v2
- name: 🐍 Installing python
uses: actions/setup-python@v2

- name: 🪨 Setup Node
uses: actions/setup-node@v1
with:
node-version: 16

- name: 🤖 Install Mephisto
run: pip install -e .

- name: 🖋 Create data directory
run: |
cd ~
mkdir mephisto
cd mephisto
mkdir data

- name: 📂 Set the data directory
run: |
mephisto config core.main_data_directory ~/mephisto/data

- name: ⌛️ Running cypress tests
uses: cypress-io/[email protected]
with:
install: false
project: ./examples/static_react_task/webapp
config-file: ./cypress.config.js
start: python examples/static_react_task/run_task.py
wait-on: "http://localhost:3000/?worker_id=x&assignment_id=1"
command-prefix: yarn dlx
headless: true
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ We actively welcome your pull requests.
5. Make sure your code lints.
6. If you haven't already, complete the Contributor License Agreement ("CLA").

### Cypress Testing
To test a task:
1. Run the task by running python run_task.py in the appropriate folder
2. In a separate terminal window go into the webapp directory and run npm run test
3. This should open a cypress app where you can see if your tests pass/fail

### Task Contributions
Generally we encourage people to provide their own blueprints as part of the repo in which they release their code, though if someone creates a strong case for an abstract `Blueprint` that is generally applicable we'd be happy to review it.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ mephisto:
task_tags: "mnist,drawing,models,correction"
# We expect to handle 25 people using the MNIST model at once
max_num_concurrent_units: 25
package_to_link_to: ""
2 changes: 1 addition & 1 deletion examples/remote_procedure/mnist/run_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def handle_with_model(
)

task_dir = cfg.task_dir
build_custom_bundle(task_dir)
build_custom_bundle(task_dir, cfg.mephisto.task.package_to_link_to)

operator.launch_task_run(cfg.mephisto, shared_state)
operator.wait_for_runs_then_shutdown(skip_input=True, log_rate=30)
Expand Down
Loading