Skip to content
Snippets Groups Projects

Document how to generate custom graphs to run tests on

Open vlorentz requested to merge doc-testing into master
2 unresolved threads

Resolves #4844

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
docs/testing.rst 0 → 100644
53 ``swh_graph::serde::deserialize_with_labels_and_maps``. For example, in JSON:
54
55 .. code-block:: rust
56
57 let file = std::fs::File::open(&graph_path).with_context(|| {
58 format!("Could not open {}", graph_path.display())
59 })?;
60
61 let mut deserializer =
62 serde_json::Deserializer::from_reader(BufReader::new(file));
63
64 let graph = swh_graph::serde::deserialize_with_labels_and_maps(&mut deserializer)
65 .map_err(|e| anyhow!("Could not read JSON graph: {e}"))?;
66
67 In particular, the gRPC server executable (``swh-graph-grpc-serve``) can read files
68 serialized to JSON this way, using the ``--graph-format json`` option.
  • Comment on lines +67 to +68
    Author Maintainer

    welp, I hallucinated the existence of this flag. It's present in swh-provenance, but it's still an open issue for swh-graph: #4835

  • Please register or sign in to reply
    • A bit outside of this MR, but we're on the Regeneration the dataset section: the example command currently does not start:

      $ python -m swh.graph.example_dataset.generate_dataset --compress     swh/graph/example_dataset
      Traceback (most recent call last):
        File "<frozen runpy>", line 198, in _run_module_as_main
        File "<frozen runpy>", line 88, in _run_code
        File "/home/martin/swh-environment/swh-graph/swh/graph/example_dataset/generate_dataset.py", line 51, in <module>
          main()
        File "/home/martin/swh-environment/swh-graph/swh/graph/example_dataset/generate_dataset.py", line 47, in main
          compress("example", output_path / "orc", output_path / "compressed")
      TypeError: compress() missing 1 required positional argument: 'test_flavor'

      On test graphs: looking at graph_builder.rs I think I'll try very soon to add in swh-fuse a test of corner cases mentioned in swh-fuse!93 (comment 197559) - but should I wait for --graph-format json ? Or use another format, already supported ?

    • Author Maintainer

      the example command currently does not start:

      ping @varasterix

      but should I wait for --graph-format json ?

      Yes, I can do it now if that's a blocker. Or do you want to do it yourself? It should be easy using the documentation here (or by looking at the implementation of the same flag in swh-provenance), and of course I can help

      Edited by vlorentz
    • As seen from swh-fuse it would be a nice-to-have test, so it's not blocking at all. I'd be interested to do it, but can't right now.

    • The issue with the script tracked in #4845 (closed) and should be resolved with !728 (merged). Feel free to comment if need be :smile:

    • Please register or sign in to reply
  • vlorentz mentioned in issue #4844

    mentioned in issue #4844

  • mentioned in issue swh-fuse#2919

  • mentioned in issue #4845 (closed)

  • Please register or sign in to reply
    Loading