Skip to content

Commit

Permalink
Fixed failing e2e Cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
meta-paul committed Nov 25, 2023
1 parent 3494563 commit 650326a
Show file tree
Hide file tree
Showing 24 changed files with 17,767 additions and 9,875 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/cypress-end-to-end-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
branches: [main]
paths-ignore:
- "**.md"
env:
HYDRA_FULL_ERROR: 1
jobs:
# This job is made to setup path filtering, learn more about it here: https://github.com/facebookresearch/Mephisto/pull/857
changes:
Expand Down Expand Up @@ -273,7 +275,9 @@ jobs:
node-version: 16.16.0

- name: 🤖 Install Mephisto
run: pip install -e .
run: |
pip install -e .
pip install detoxify
- name: 🖋 Create data directory
run: mkdir -p ~/mephisto/data
Expand Down
3 changes: 2 additions & 1 deletion examples/parlai_chat_task_demo/hydra_configs/conf/base.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#@package _global_

# Copyright (c) Meta Platforms and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

#@package _global_
defaults:
- /mephisto/blueprint: parlai_chat
- /mephisto/architect: local
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#@package _global_

# Copyright (c) Meta Platforms and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

#@package _global_
defaults:
- base
mephisto:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#@package _global_

# Copyright (c) Meta Platforms and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

#@package _global_
defaults:
- base
mephisto:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#@package _global_

# Copyright (c) Meta Platforms and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

#@package _global_
defaults:
- base
mephisto:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#@package _global_

# Copyright (c) Meta Platforms and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

#@package _global_
defaults:
- base
mephisto:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#@package _global_

# Copyright (c) Meta Platforms and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

defaults:
- /mephisto/blueprint: remote_procedure
- /mephisto/architect: local
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#@package _global_

# Copyright (c) Meta Platforms and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

defaults:
- /mephisto/blueprint: remote_procedure
- /mephisto/architect: local
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#@package _global_

# Copyright (c) Meta Platforms and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

#@package _global_
defaults:
- /mephisto/blueprint: remote_procedure
- /mephisto/architect: local
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#@package _global_

# Copyright (c) Meta Platforms and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

#@package _global_
defaults:
- /mephisto/blueprint: remote_procedure
- /mephisto/architect: local
Expand Down
2 changes: 2 additions & 0 deletions examples/simple_static_task/data_mturk.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
character_name,character_description
Loaded Character 1,I'm a Mturk character loaded from Mephisto!
4 changes: 3 additions & 1 deletion examples/simple_static_task/hydra_configs/conf/example.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#@package _global_

# Copyright (c) Meta Platforms and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

#@package _global_
defaults:
- /mephisto/blueprint: static_task
- /mephisto/architect: local
Expand All @@ -11,6 +12,7 @@ mephisto:
blueprint:
data_csv: ${task_dir}/data.csv
task_source: ${task_dir}/server_files/demo_task.html
task_source_review: ${task_dir}/webapp/build/bundle.review.js
preview_source: ${task_dir}/server_files/demo_preview.html
extra_source_dir: ${task_dir}/server_files/extra_refs
units_per_assignment: 2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#@package _global_

# Copyright (c) Meta Platforms and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

#@package _global_
defaults:
- /mephisto/blueprint: static_task
- /mephisto/architect: local
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#@package _global_

# Copyright (c) Meta Platforms and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

#@package _global_
defaults:
- /mephisto/blueprint: static_task
- /mephisto/architect: ec2
Expand Down
31 changes: 31 additions & 0 deletions examples/simple_static_task/static_test_mturk_script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env python3

# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

from omegaconf import DictConfig

from mephisto.abstractions.blueprints.abstract.static_task.static_blueprint import (
SharedStaticTaskState,
)
from mephisto.data_model.qualification import QUAL_GREATER_EQUAL
from mephisto.tools.scripts import task_script
from mephisto.utils.qualifications import make_qualification_dict


@task_script(default_config_file="mturk_example")
def main(operator, cfg: DictConfig) -> None:
shared_state = SharedStaticTaskState()

# Mephisto qualifications
# shared_state.qualifications = [
# make_qualification_dict('sample_qual_name', QUAL_GREATER_EQUAL, 1),
# ]

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


if __name__ == "__main__":
main()
3 changes: 2 additions & 1 deletion examples/static_react_task/hydra_configs/conf/example.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#@package _global_

# Copyright (c) Meta Platforms and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

#@package _global_
defaults:
- /mephisto/blueprint: static_react_task
- /mephisto/architect: local
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#@package _global_

# Copyright (c) Meta Platforms and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

#@package _global_
defaults:
- /mephisto/blueprint: static_react_task
- /mephisto/architect: local
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#@package _global_

# Copyright (c) Meta Platforms and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

#@package _global_
defaults:
- /mephisto/blueprint: static_react_task
- /mephisto/architect: local
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#@package _global_

# Copyright (c) Meta Platforms and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

#@package _global_
defaults:
- /mephisto/blueprint: static_react_task
- /mephisto/architect: local
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#@package _global_

# Copyright (c) Meta Platforms and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

#@package _global_
defaults:
- /mephisto/blueprint: static_react_task
- /mephisto/architect: local
Expand Down
3 changes: 2 additions & 1 deletion hydra_configs/profile/local_dev.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# @package _global_

# Copyright (c) Meta Platforms and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

# @package _global_
defaults:
- override /mephisto/architect: local
- override /mephisto/provider: mock
Expand Down
2 changes: 1 addition & 1 deletion packages/mephisto-task/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"react-dom": "^16.8 || 17 || 18"
},
"dependencies": {
"axios": "^0.27.2",
"axios": "^1.6.0",
"babel-eslint": "^10.1.0",
"bowser": "^2.11.0"
}
Expand Down
5 changes: 3 additions & 2 deletions scripts/update_copyright_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@ def _update_copyright_header(file_path: str, replace_existing: bool = False):
if likelihood_score < 2:
# Insert a new copyright notice
print("Inserting new notice")
maybe_shebang = lambda line: line[0] == "#" and line[1] != " "

if lines[0].startswith("#!") and not lines[1].startswith("#!"):
# Skipping shebang line
if maybe_shebang(lines[0]) and not maybe_shebang(lines[1]):
# Skipping shebang line (for chell, hydra config, etc)
insert_at_line_number = 1
else:
# Insert at the top of the file
Expand Down
Loading

0 comments on commit 650326a

Please sign in to comment.