Skip to content

Commit

Permalink
Fix using fetch in js tests, which won't run on Node
Browse files Browse the repository at this point in the history
  • Loading branch information
Strilanc committed Feb 19, 2024
1 parent f1d5460 commit cf93ad8
Show file tree
Hide file tree
Showing 8 changed files with 209 additions and 1,033 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ jobs:
- run: diff <(dev/regen_crumble_to_cpp_string_write_to_stdout.sh) src/stim/diagram/crumble_data.cc
- run: pip install -e glue/sample
- run: diff <(python dev/gen_sinter_api_reference.py -dev) doc/sinter_api.md
- run: diff <(python -c "import stim; stim.main(command_line_args=['help', 'gates'])" | grep " " | sed 's/^ *//g') glue/crumble/test/generated_gate_name_list.txt
- run diff <(dev/gen_known_gates_for_js.sh) glue/crumble/test/generated_gate_name_list.test.js
test_generated_file_lists_are_fresh:
runs-on: ubuntu-latest
steps:
Expand Down
12 changes: 12 additions & 0 deletions dev/gen_known_gates_for_js.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -e

#########################################################################
# Generates javascript exporting a string KNOWN_GATE_NAMES_FROM_STIM.
#########################################################################

echo "const KNOWN_GATE_NAMES_FROM_STIM = \`"
python -c "import stim; stim.main(command_line_args=['help', 'gates'])" | grep " " | sed 's/^ *//g'
echo "\`"
echo
echo "export {KNOWN_GATE_NAMES_FROM_STIM};"
2 changes: 1 addition & 1 deletion dev/regen_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ python dev/gen_sinter_api_reference.py -dev > doc/sinter_api.md
python -c "import stim; stim.main(command_line_args=['help', 'gates_markdown'])" > doc/gates.md
python -c "import stim; stim.main(command_line_args=['help', 'formats_markdown'])" > doc/result_formats.md
python -c "import stim; stim.main(command_line_args=['help', 'commands_markdown'])" > doc/usage_command_line.md
python -c "import stim; stim.main(command_line_args=['help', 'gates'])" | grep " " | sed 's/^ *//g' > glue/crumble/test/generated_gate_name_list.txt
dev/gen_known_gates_for_js.sh > glue/crumble/test/generated_gate_name_list.test.js
Loading

0 comments on commit cf93ad8

Please sign in to comment.