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

Expose Top level API through zombienet-sdk crate #126

Merged
merged 5 commits into from
Nov 7, 2023
Merged

Conversation

pgherveou
Copy link
Contributor

Following up on take 1 #124

Apart from better logs, I realize that one of the only thing missing now for us to start consuming this project is a top level package available (with it's dependencies) on crates.io. This PR serves mainly as a discussion point to get there.
It would be great if we could publish an early version (0.0.1?) on crates.io so that we can start using this asap.

Copy link

github-actions bot commented Nov 2, 2023

Coverage after merging pg/add_native into main

77.43%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
crates/configuration/src
   global_settings.rs98.46%100%93.33%99.13%
   hrmp_channel.rs95.88%100%89.47%97.44%
   network.rs99.22%100%97.78%99.36%117, 122, 130, 175, 80, 88
   parachain.rs97.59%100%95.19%97.85%51–53, 551–560, 67–70
   relaychain.rs96.60%100%92.65%97.09%338–347, 77–79
   utils.rs40%100%40%40%11–13, 15–17, 19–21
crates/configuration/src/shared
   errors.rs50%100%50%50%
   helpers.rs100%100%100%100%
   node.rs98.32%100%92.68%98.93%124, 130
   resources.rs96.09%100%94.52%96.43%102, 114, 126–128, 147–150
   types.rs90.40%100%84.16%92.22%279–281, 350–352, 378–379, 381–383, 60–62
crates/orchestrator/src
   errors.rs0%100%0%0%8
   lib.rs0%100%0%0%100–103, 105–108, 112–115, 117–123, 125, 129, 131–146, 150–173, 177–186, 189, 192–196, 198, 200–204, 207–225, 227–232, 234–255, 259–261, 264, 267–272, 274–277, 280–284, 287, 289–302, 304–306, 309–313, 315, 317–330, 332–335, 337–339, 343–345, 347–371, 379, 383–384, 394, 401–403, 405–414, 416–417, 419–427, 429–436, 438–439, 44, 440–445, 447–449, 45, 450–458, 46, 461, 47–49, 51–56, 58–64, 66–69, 75, 77–92, 98–99
   network.rs0%100%0%0%100–108, 111–117, 119–127, 130–155, 157–168, 171, 173–177, 185–188, 190, 192, 194–196, 199–204, 206–208, 210–212, 214–216, 218–220, 222–224, 226–228, 230–232, 32–40, 43, 56–70, 77–82, 85–94, 96, 98–99
   network_spec.rs93.67%100%83.33%95.52%11, 38
   spawner.rs0%100%0%0%100–106, 108, 111–113, 116–120, 122, 127–147, 149, 151–168, 17, 40–53, 55–56, 58, 60–63, 67–68, 70, 73–93, 95–99
crates/orchestrator/src/generators
   bootnode_addr.rs97.20%100%100%96.84%
   chain_spec.rs3.24%100%5%3.08%100–111, 113–128, 130, 135–148, 151–157, 159–161, 164–192, 194–197, 199–201, 203–216, 218–219, 22, 220, 223–225, 227, 229–241, 243, 246–251, 253–254, 256–269, 271, 274–279, 281–282, 285–298, 300–305, 307–309, 311–313, 316–321, 323–352, 355, 358–361, 364, 366–367, 369–379, 38, 380–384, 386, 388–389, 392–397, 405–443, 454–459, 46, 460–462, 472–480, 482–494, 496–504, 507–509, 513–516, 518–519, 524–535, 539–552, 554, 557–558, 561–567, 569–574, 580–585, 587, 589, 591–598, 600–603, 606–607, 611–612, 614, 616–617, 619–623, 625–628, 630, 632–633, 635–636, 638–640, 642–644, 646–648, 651–653, 656–660, 662, 664–672, 674–675, 680–687, 689–699, 703–706, 708, 710, 712–717, 719–729, 731–746, 748–749, 75, 750–755, 757, 76, 761–769, 77, 770–781, 783, 792–802, 804, 806–823, 825–829, 831, 833, 84–87, 95–99
   command.rs0%100%0%0%100–112, 114–120, 122, 125–130, 132–133, 136–148, 15, 150, 153–155, 157–158, 16, 161–169, 17, 170–179, 18, 180–189, 19, 190–197, 199, 20, 201, 203–209, 21, 210–219, 22, 220–224, 226–229, 23, 231–233, 235–239, 24, 240–243, 246–250, 252–256, 258, 261–269, 271, 274–290, 293–298, 300, 303–305, 307–308, 311–333, 335, 337, 44–62, 64–66, 68–76, 79–97
   errors.rs0%100%0%0%4
   identity.rs82.35%100%60%86.21%13
   key.rs95.05%100%84.62%96.59%31
   keystore.rs0%100%0%0%19–26, 28–31, 34–46, 48–55, 57–64, 66, 68–86
   para_artifact.rs15.94%100%10%16.95%12, 18, 25, 44–46, 48–64, 66–69, 72–81, 83–88, 92–93
   port.rs93.75%100%83.33%96.15%
crates/orchestrator/src/network
   node.rs0%100%0%0%100–103, 106–108, 11, 110, 112–118, 120–122, 124–127, 129–133, 137–145, 25–40, 44–47, 50–52, 55–59, 63–66, 69–72, 79–84, 94–99
   parachain.rs0%100%0%0%100, 102–105, 15, 25–33, 35–47, 49–53, 56–60, 63–70, 72, 74, 77–82, 85–86, 88–93, 97–99
   relaychain.rs0%100%0%0%14–21, 5
crates/orchestrator/src/network_helper
   verifier.rs0%100%0%0%10–11, 16, 18–25, 27–32, 34, 7–9
crates/orchestrator/src/network_spec
   node.rs39.17%100%16.67%40.35%108, 146–150, 152–153, 155, 158, 16, 160–163, 165–168, 173–178, 180, 183, 185–215, 217, 90–91, 93–96
   parachain.rs72.04%100%50%73.03%100, 107, 125, 130–133, 136, 147–150, 153, 17, 71–73, 76, 78–80, 86, 95
   relaychain.rs88.71%100%66.67%91.07%100, 17, 70, 93
crates/orchestrator/src/shared
   types.rs26.09%100%11.76%34.48%15, 30, 36, 45–49, 52, 61, 72
crates/prom-metrics-parser/src
   lib.rs91.94%100%80%92.98%105, 127, 55–57, 7, 81
crates/provider/src
   lib.rs50%100%50%50%
crates/provider/src/native
   helpers.rs89.25%100%100%88.37%30–31, 36–38, 59, 90, 94, 98
   namespace.rs90.80%100%87.18%91.11%108–112, 183, 202, 209, 215, 217, 224, 226–227, 241, 306, 313, 318, 323, 328, 335, 348, 418, 426, 452, 457, 461, 481, 485, 520, 527, 543, 581, 585, 73
   node.rs92.27%100%91.45%92.36%1034, 1060, 1130, 116, 1172, 1207, 1218, 1243, 1247–1249, 1252, 1284, 156, 165, 189, 201, 209, 221, 235, 255, 260, 273, 322, 333, 367, 378, 392, 398, 435, 446, 478, 486, 513, 521, 560, 57, 575, 58, 580, 59, 590, 61, 615, 62, 627, 63, 656, 666, 682, 689, 715, 739, 777, 781–783, 786, 812, 848, 85–87, 872, 89–91, 93, 931, 94–95, 970
   provider.rs97.62%100%96.30%97.87%15, 179, 85
crates/provider/src/shared
   types.rs84.47%100%74.29%86.41%123, 140–146, 15–18, 230, 249–256, 79
crates/sdk/src
   lib.rs0%100%0%0%15–19
crates/support/src
   fs.rs75%100%66.67%80%
   net.rs0%100%0%0%10, 4–9
   process.rs100%100%100%100%
crates/support/src/fs
   in_memory.rs95.55%100%96.45%95.37%108, 252, 276, 327, 379, 387, 395, 403, 41–42, 425, 43, 433, 44, 46, 48–51, 53, 548, 570, 58, 598, 615, 633, 640, 659, 686, 703
   local.rs96.23%100%93.98%96.77%63, 8, 89–94
crates/support/src/process
   fake.rs82.47%100%84.62%82.03%126–131, 147, 205, 22, 229–230, 232–249, 302, 319–323, 333, 360, 39–40, 47, 63, 82, 91
   os.rs0%100%0%0%100–102, 16–18, 20–23, 25–27, 29–32, 34–36, 38–40, 43, 47–52, 54–56, 58–60, 62–64, 66–68, 70–71, 76–82, 84–89, 9, 91–95, 97–99
crates/test-runner/src
   lib.rs100%100%100%100%

crates/sdk/src/lib.rs Outdated Show resolved Hide resolved
@l0r1s
Copy link
Contributor

l0r1s commented Nov 6, 2023

Hi @pgherveou, sure ! (and some docs probably)

@pgherveou
Copy link
Contributor Author

@pepoviola most urgent missing bit, apart from this top level package is fixing this todo! that prevent us from defining a custom command.

https://github.com/paritytech/zombienet-sdk/blob/m/crates/orchestrator/src/generators/chain_spec.rs#L364

The other thing is: get_node only return validator node for now, should we adapt the code like this so that we can get reference to any node, including parachain collators?

add_para probably need to be adjusted like this

     pub(crate) fn add_para(&mut self, para: Parachain) {
+        para.collators.iter().for_each(|collator| {
+            self.nodes_by_name
+                .insert(collator.name.clone(), collator.clone());
+        });
         self.parachains.insert(para.para_id, para);
     }

Copy link

github-actions bot commented Nov 6, 2023

Coverage after merging pg/add_native into main

77.43%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
crates/configuration/src
   global_settings.rs98.46%100%93.33%99.13%
   hrmp_channel.rs95.88%100%89.47%97.44%
   network.rs99.22%100%97.78%99.36%117, 122, 130, 175, 80, 88
   parachain.rs97.59%100%95.19%97.85%51–53, 551–560, 67–70
   relaychain.rs96.60%100%92.65%97.09%338–347, 77–79
   utils.rs40%100%40%40%11–13, 15–17, 19–21
crates/configuration/src/shared
   errors.rs50%100%50%50%
   helpers.rs100%100%100%100%
   node.rs98.32%100%92.68%98.93%124, 130
   resources.rs96.09%100%94.52%96.43%102, 114, 126–128, 147–150
   types.rs90.40%100%84.16%92.22%279–281, 350–352, 378–379, 381–383, 60–62
crates/orchestrator/src
   errors.rs0%100%0%0%8
   lib.rs0%100%0%0%100–103, 105–108, 112–115, 117–123, 125, 129, 131–146, 150–173, 177–186, 189, 192–196, 198, 200–204, 207–225, 227–232, 234–255, 259–261, 264, 267–272, 274–277, 280–284, 287, 289–302, 304–306, 309–313, 315, 317–330, 332–335, 337–339, 343–345, 347–371, 379, 383–384, 394, 401–403, 405–414, 416–417, 419–427, 429–436, 438–439, 44, 440–445, 447–449, 45, 450–458, 46, 461, 47–49, 51–56, 58–64, 66–69, 75, 77–92, 98–99
   network.rs0%100%0%0%100–108, 111–117, 119–127, 130–155, 157–168, 171, 173–177, 185–188, 190, 192, 194–196, 199–204, 206–208, 210–212, 214–216, 218–220, 222–224, 226–228, 230–232, 32–40, 43, 56–70, 77–82, 85–94, 96, 98–99
   network_spec.rs93.67%100%83.33%95.52%11, 38
   spawner.rs0%100%0%0%100–106, 108, 111–113, 116–120, 122, 127–147, 149, 151–168, 17, 40–53, 55–56, 58, 60–63, 67–68, 70, 73–93, 95–99
crates/orchestrator/src/generators
   bootnode_addr.rs97.20%100%100%96.84%
   chain_spec.rs3.24%100%5%3.08%100–111, 113–128, 130, 135–148, 151–157, 159–161, 164–192, 194–197, 199–201, 203–216, 218–219, 22, 220, 223–225, 227, 229–241, 243, 246–251, 253–254, 256–269, 271, 274–279, 281–282, 285–298, 300–305, 307–309, 311–313, 316–321, 323–352, 355, 358–361, 364, 366–367, 369–379, 38, 380–384, 386, 388–389, 392–397, 405–443, 454–459, 46, 460–462, 472–480, 482–494, 496–504, 507–509, 513–516, 518–519, 524–535, 539–552, 554, 557–558, 561–567, 569–574, 580–585, 587, 589, 591–598, 600–603, 606–607, 611–612, 614, 616–617, 619–623, 625–628, 630, 632–633, 635–636, 638–640, 642–644, 646–648, 651–653, 656–660, 662, 664–672, 674–675, 680–687, 689–699, 703–706, 708, 710, 712–717, 719–729, 731–746, 748–749, 75, 750–755, 757, 76, 761–769, 77, 770–781, 783, 792–802, 804, 806–823, 825–829, 831, 833, 84–87, 95–99
   command.rs0%100%0%0%100–112, 114–120, 122, 125–130, 132–133, 136–148, 15, 150, 153–155, 157–158, 16, 161–169, 17, 170–179, 18, 180–189, 19, 190–197, 199, 20, 201, 203–209, 21, 210–219, 22, 220–224, 226–229, 23, 231–233, 235–239, 24, 240–243, 246–250, 252–256, 258, 261–269, 271, 274–290, 293–298, 300, 303–305, 307–308, 311–333, 335, 337, 44–62, 64–66, 68–76, 79–97
   errors.rs0%100%0%0%4
   identity.rs82.35%100%60%86.21%13
   key.rs95.05%100%84.62%96.59%31
   keystore.rs0%100%0%0%19–26, 28–31, 34–46, 48–55, 57–64, 66, 68–86
   para_artifact.rs15.94%100%10%16.95%12, 18, 25, 44–46, 48–64, 66–69, 72–81, 83–88, 92–93
   port.rs93.75%100%83.33%96.15%
crates/orchestrator/src/network
   node.rs0%100%0%0%100–103, 106–108, 11, 110, 112–118, 120–122, 124–127, 129–133, 137–145, 25–40, 44–47, 50–52, 55–59, 63–66, 69–72, 79–84, 94–99
   parachain.rs0%100%0%0%100, 102–105, 15, 25–33, 35–47, 49–53, 56–60, 63–70, 72, 74, 77–82, 85–86, 88–93, 97–99
   relaychain.rs0%100%0%0%14–21, 5
crates/orchestrator/src/network_helper
   verifier.rs0%100%0%0%10–11, 16, 18–25, 27–32, 34, 7–9
crates/orchestrator/src/network_spec
   node.rs39.17%100%16.67%40.35%108, 146–150, 152–153, 155, 158, 16, 160–163, 165–168, 173–178, 180, 183, 185–215, 217, 90–91, 93–96
   parachain.rs72.04%100%50%73.03%100, 107, 125, 130–133, 136, 147–150, 153, 17, 71–73, 76, 78–80, 86, 95
   relaychain.rs88.71%100%66.67%91.07%100, 17, 70, 93
crates/orchestrator/src/shared
   types.rs26.09%100%11.76%34.48%15, 30, 36, 45–49, 52, 61, 72
crates/prom-metrics-parser/src
   lib.rs91.94%100%80%92.98%105, 127, 55–57, 7, 81
crates/provider/src
   lib.rs50%100%50%50%
crates/provider/src/native
   helpers.rs89.25%100%100%88.37%30–31, 36–38, 59, 90, 94, 98
   namespace.rs90.80%100%87.18%91.11%108–112, 183, 202, 209, 215, 217, 224, 226–227, 241, 306, 313, 318, 323, 328, 335, 348, 418, 426, 452, 457, 461, 481, 485, 520, 527, 543, 581, 585, 73
   node.rs92.27%100%91.45%92.36%1034, 1060, 1130, 116, 1172, 1207, 1218, 1243, 1247–1249, 1252, 1284, 156, 165, 189, 201, 209, 221, 235, 255, 260, 273, 322, 333, 367, 378, 392, 398, 435, 446, 478, 486, 513, 521, 560, 57, 575, 58, 580, 59, 590, 61, 615, 62, 627, 63, 656, 666, 682, 689, 715, 739, 777, 781–783, 786, 812, 848, 85–87, 872, 89–91, 93, 931, 94–95, 970
   provider.rs97.62%100%96.30%97.87%15, 179, 85
crates/provider/src/shared
   types.rs84.47%100%74.29%86.41%123, 140–146, 15–18, 230, 249–256, 79
crates/sdk/src
   lib.rs0%100%0%0%15–19
crates/support/src
   fs.rs75%100%66.67%80%
   net.rs0%100%0%0%10, 4–9
   process.rs100%100%100%100%
crates/support/src/fs
   in_memory.rs95.55%100%96.45%95.37%108, 252, 276, 327, 379, 387, 395, 403, 41–42, 425, 43, 433, 44, 46, 48–51, 53, 548, 570, 58, 598, 615, 633, 640, 659, 686, 703
   local.rs96.23%100%93.98%96.77%63, 8, 89–94
crates/support/src/process
   fake.rs82.47%100%84.62%82.03%126–131, 147, 205, 22, 229–230, 232–249, 302, 319–323, 333, 360, 39–40, 47, 63, 82, 91
   os.rs0%100%0%0%100–102, 16–18, 20–23, 25–27, 29–32, 34–36, 38–40, 43, 47–52, 54–56, 58–60, 62–64, 66–68, 70–71, 76–82, 84–89, 9, 91–95, 97–99
crates/test-runner/src
   lib.rs100%100%100%100%

@pepoviola
Copy link
Collaborator

@pepoviola most urgent missing bit, apart from this top level package is fixing this todo! that prevent us from defining a custom command.

https://github.com/paritytech/zombienet-sdk/blob/m/crates/orchestrator/src/generators/chain_spec.rs#L364

The other thing is: get_node only return validator node for now, should we adapt the code like this so that we can get reference to any node, including parachain collators?

add_para probably need to be adjusted like this

     pub(crate) fn add_para(&mut self, para: Parachain) {
+        para.collators.iter().for_each(|collator| {
+            self.nodes_by_name
+                .insert(collator.name.clone(), collator.clone());
+        });
         self.parachains.insert(para.para_id, para);
     }

Thanks @pgherveou, I just open this #127 to make all the node available through get_node. Related to the chain_spec, did you need to use a custom command to generate it?

Thx!

Copy link

github-actions bot commented Nov 6, 2023

Coverage after merging pg/add_native into main

77.43%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
crates/configuration/src
   global_settings.rs98.46%100%93.33%99.13%
   hrmp_channel.rs95.88%100%89.47%97.44%
   network.rs99.22%100%97.78%99.36%117, 122, 130, 175, 80, 88
   parachain.rs97.59%100%95.19%97.85%51–53, 551–560, 67–70
   relaychain.rs96.60%100%92.65%97.09%338–347, 77–79
   utils.rs40%100%40%40%11–13, 15–17, 19–21
crates/configuration/src/shared
   errors.rs50%100%50%50%
   helpers.rs100%100%100%100%
   node.rs98.32%100%92.68%98.93%124, 130
   resources.rs96.09%100%94.52%96.43%102, 114, 126–128, 147–150
   types.rs90.40%100%84.16%92.22%279–281, 350–352, 378–379, 381–383, 60–62
crates/orchestrator/src
   errors.rs0%100%0%0%8
   lib.rs0%100%0%0%100–103, 105–108, 112–115, 117–123, 125, 129, 131–146, 150–173, 177–186, 189, 192–196, 198, 200–204, 207–225, 227–232, 234–255, 259–261, 264, 267–272, 274–277, 280–284, 287, 289–302, 304–306, 309–313, 315, 317–330, 332–335, 337–339, 343–345, 347–371, 379, 383–384, 394, 401–403, 405–414, 416–417, 419–427, 429–436, 438–439, 44, 440–445, 447–449, 45, 450–458, 46, 461, 47–49, 51–56, 58–64, 66–69, 75, 77–92, 98–99
   network.rs0%100%0%0%100–108, 111–117, 119–127, 130–155, 157–168, 171, 173–177, 185–188, 190, 192, 194–196, 199–204, 206–208, 210–212, 214–216, 218–220, 222–224, 226–228, 230–232, 32–40, 43, 56–70, 77–82, 85–94, 96, 98–99
   network_spec.rs93.67%100%83.33%95.52%11, 38
   spawner.rs0%100%0%0%100–106, 108, 111–113, 116–120, 122, 127–147, 149, 151–168, 17, 40–53, 55–56, 58, 60–63, 67–68, 70, 73–93, 95–99
crates/orchestrator/src/generators
   bootnode_addr.rs97.20%100%100%96.84%
   chain_spec.rs3.24%100%5%3.08%100–111, 113–128, 130, 135–148, 151–157, 159–161, 164–192, 194–197, 199–201, 203–216, 218–219, 22, 220, 223–225, 227, 229–241, 243, 246–251, 253–254, 256–269, 271, 274–279, 281–282, 285–298, 300–305, 307–309, 311–313, 316–321, 323–352, 355, 358–361, 364, 366–367, 369–379, 38, 380–384, 386, 388–389, 392–397, 405–443, 454–459, 46, 460–462, 472–480, 482–494, 496–504, 507–509, 513–516, 518–519, 524–535, 539–552, 554, 557–558, 561–567, 569–574, 580–585, 587, 589, 591–598, 600–603, 606–607, 611–612, 614, 616–617, 619–623, 625–628, 630, 632–633, 635–636, 638–640, 642–644, 646–648, 651–653, 656–660, 662, 664–672, 674–675, 680–687, 689–699, 703–706, 708, 710, 712–717, 719–729, 731–746, 748–749, 75, 750–755, 757, 76, 761–769, 77, 770–781, 783, 792–802, 804, 806–823, 825–829, 831, 833, 84–87, 95–99
   command.rs0%100%0%0%100–112, 114–120, 122, 125–130, 132–133, 136–148, 15, 150, 153–155, 157–158, 16, 161–169, 17, 170–179, 18, 180–189, 19, 190–197, 199, 20, 201, 203–209, 21, 210–219, 22, 220–224, 226–229, 23, 231–233, 235–239, 24, 240–243, 246–250, 252–256, 258, 261–269, 271, 274–290, 293–298, 300, 303–305, 307–308, 311–333, 335, 337, 44–62, 64–66, 68–76, 79–97
   errors.rs0%100%0%0%4
   identity.rs82.35%100%60%86.21%13
   key.rs95.05%100%84.62%96.59%31
   keystore.rs0%100%0%0%19–26, 28–31, 34–46, 48–55, 57–64, 66, 68–86
   para_artifact.rs15.94%100%10%16.95%12, 18, 25, 44–46, 48–64, 66–69, 72–81, 83–88, 92–93
   port.rs93.75%100%83.33%96.15%
crates/orchestrator/src/network
   node.rs0%100%0%0%100–103, 106–108, 11, 110, 112–118, 120–122, 124–127, 129–133, 137–145, 25–40, 44–47, 50–52, 55–59, 63–66, 69–72, 79–84, 94–99
   parachain.rs0%100%0%0%100, 102–105, 15, 25–33, 35–47, 49–53, 56–60, 63–70, 72, 74, 77–82, 85–86, 88–93, 97–99
   relaychain.rs0%100%0%0%14–21, 5
crates/orchestrator/src/network_helper
   verifier.rs0%100%0%0%10–11, 16, 18–25, 27–32, 34, 7–9
crates/orchestrator/src/network_spec
   node.rs39.17%100%16.67%40.35%108, 146–150, 152–153, 155, 158, 16, 160–163, 165–168, 173–178, 180, 183, 185–215, 217, 90–91, 93–96
   parachain.rs72.04%100%50%73.03%100, 107, 125, 130–133, 136, 147–150, 153, 17, 71–73, 76, 78–80, 86, 95
   relaychain.rs88.71%100%66.67%91.07%100, 17, 70, 93
crates/orchestrator/src/shared
   types.rs26.09%100%11.76%34.48%15, 30, 36, 45–49, 52, 61, 72
crates/prom-metrics-parser/src
   lib.rs91.94%100%80%92.98%105, 127, 55–57, 7, 81
crates/provider/src
   lib.rs50%100%50%50%
crates/provider/src/native
   helpers.rs89.25%100%100%88.37%30–31, 36–38, 59, 90, 94, 98
   namespace.rs90.80%100%87.18%91.11%108–112, 183, 202, 209, 215, 217, 224, 226–227, 241, 306, 313, 318, 323, 328, 335, 348, 418, 426, 452, 457, 461, 481, 485, 520, 527, 543, 581, 585, 73
   node.rs92.27%100%91.45%92.36%1034, 1060, 1130, 116, 1172, 1207, 1218, 1243, 1247–1249, 1252, 1284, 156, 165, 189, 201, 209, 221, 235, 255, 260, 273, 322, 333, 367, 378, 392, 398, 435, 446, 478, 486, 513, 521, 560, 57, 575, 58, 580, 59, 590, 61, 615, 62, 627, 63, 656, 666, 682, 689, 715, 739, 777, 781–783, 786, 812, 848, 85–87, 872, 89–91, 93, 931, 94–95, 970
   provider.rs97.62%100%96.30%97.87%15, 179, 85
crates/provider/src/shared
   types.rs84.47%100%74.29%86.41%123, 140–146, 15–18, 230, 249–256, 79
crates/sdk/src
   lib.rs0%100%0%0%26–30
crates/support/src
   fs.rs75%100%66.67%80%
   net.rs0%100%0%0%10, 4–9
   process.rs100%100%100%100%
crates/support/src/fs
   in_memory.rs95.55%100%96.45%95.37%108, 252, 276, 327, 379, 387, 395, 403, 41–42, 425, 43, 433, 44, 46, 48–51, 53, 548, 570, 58, 598, 615, 633, 640, 659, 686, 703
   local.rs96.23%100%93.98%96.77%63, 8, 89–94
crates/support/src/process
   fake.rs82.47%100%84.62%82.03%126–131, 147, 205, 22, 229–230, 232–249, 302, 319–323, 333, 360, 39–40, 47, 63, 82, 91
   os.rs0%100%0%0%100–102, 16–18, 20–23, 25–27, 29–32, 34–36, 38–40, 43, 47–52, 54–56, 58–60, 62–64, 66–68, 70–71, 76–82, 84–89, 9, 91–95, 97–99
crates/test-runner/src
   lib.rs100%100%100%100%

@pgherveou
Copy link
Contributor Author

Related to the chain_spec, did you need to use a custom command to generate it?

Not sure I was just trying to get that to run

     let network = NetworkConfigBuilder::new()
        .with_relaychain(|r| {
            r.with_chain("rococo-local")
                .with_default_command("polkadot")
                .with_node(|node| node.with_name("alice"))
                .with_node(|node| node.with_name("bob"))
        })
        .with_parachain(|p| {
            p.with_id(100)
                .with_default_command("path/to/custom-parachain")
                .cumulus_based(true)
                .with_collator(|n| n.with_name("collator")
        })
        .build()
        .unwrap()
        .spawn_native()
        .await?;

@pepoviola
Copy link
Collaborator

pepoviola commented Nov 6, 2023

Which para are you using? send me the repo and I can try to reproduce? Thx!

Copy link

github-actions bot commented Nov 6, 2023

Coverage after merging pg/add_native into main

77.37%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
crates/configuration/src
   global_settings.rs98.46%100%93.33%99.13%
   hrmp_channel.rs95.88%100%89.47%97.44%
   network.rs99.22%100%97.78%99.36%117, 122, 130, 175, 80, 88
   parachain.rs97.59%100%95.19%97.85%51–53, 551–560, 67–70
   relaychain.rs96.60%100%92.65%97.09%338–347, 77–79
   utils.rs40%100%40%40%11–13, 15–17, 19–21
crates/configuration/src/shared
   errors.rs50%100%50%50%
   helpers.rs100%100%100%100%
   node.rs98.32%100%92.68%98.93%124, 130
   resources.rs96.09%100%94.52%96.43%102, 114, 126–128, 147–150
   types.rs90.40%100%84.16%92.22%279–281, 350–352, 378–379, 381–383, 60–62
crates/orchestrator/src
   errors.rs0%100%0%0%8
   lib.rs0%100%0%0%100–103, 105–108, 112–115, 117–123, 125, 129, 131–146, 150–173, 177–186, 189, 192–196, 198, 200–204, 207–225, 227–232, 234–255, 259–261, 264, 267–272, 274–277, 280–284, 287, 289–302, 304–306, 309–313, 315, 317–330, 332–335, 337–339, 346, 349–373, 378–379, 389, 396–398, 400–409, 411–412, 414–422, 424–431, 433–439, 44, 440, 442–449, 45, 450–453, 456, 46–49, 51–56, 58–64, 66–69, 75, 77–92, 98–99
   network.rs0%100%0%0%100–108, 111–117, 119–127, 130–155, 157–168, 171, 173–177, 185–201, 203–205, 208–213, 215–217, 219–221, 223–225, 227–229, 231–233, 235–237, 239–241, 32–40, 43, 56–70, 77–82, 85–94, 96, 98–99
   network_spec.rs93.67%100%83.33%95.52%11, 38
   spawner.rs0%100%0%0%100–106, 108, 111–113, 116–120, 122, 127–147, 149, 151–168, 17, 40–53, 55–56, 58, 60–63, 67–68, 70, 73–93, 95–99
crates/orchestrator/src/generators
   bootnode_addr.rs97.20%100%100%96.84%
   chain_spec.rs3.24%100%5%3.08%100–111, 113–128, 130, 135–148, 151–157, 159–161, 164–192, 194–197, 199–201, 203–216, 218–219, 22, 220, 223–225, 227, 229–241, 243, 246–251, 253–254, 256–269, 271, 274–279, 281–282, 285–298, 300–305, 307–309, 311–313, 316–321, 323–352, 355, 358–361, 364, 366–367, 369–379, 38, 380–384, 386, 388–389, 392–397, 405–443, 454–459, 46, 460–462, 472–480, 482–494, 496–504, 507–509, 513–516, 518–519, 524–535, 539–552, 554, 557–558, 561–567, 569–574, 580–585, 587, 589, 591–598, 600–603, 606–607, 611–612, 614, 616–617, 619–623, 625–628, 630, 632–633, 635–636, 638–640, 642–644, 646–648, 651–653, 656–660, 662, 664–672, 674–675, 680–687, 689–699, 703–706, 708, 710, 712–717, 719–729, 731–746, 748–749, 75, 750–755, 757, 76, 761–769, 77, 770–781, 783, 792–802, 804, 806–823, 825–829, 831, 833, 84–87, 95–99
   command.rs0%100%0%0%100–112, 114–120, 122, 125–130, 132–133, 136–148, 15, 150, 153–155, 157–158, 16, 161–169, 17, 170–179, 18, 180–189, 19, 190–197, 199, 20, 201, 203–209, 21, 210–219, 22, 220–224, 226–229, 23, 231–233, 235–239, 24, 240–243, 246–250, 252–256, 258, 261–269, 271, 274–290, 293–298, 300, 303–305, 307–308, 311–333, 335, 337, 44–62, 64–66, 68–76, 79–97
   errors.rs0%100%0%0%4
   identity.rs82.35%100%60%86.21%13
   key.rs95.05%100%84.62%96.59%31
   keystore.rs0%100%0%0%19–26, 28–31, 34–46, 48–55, 57–64, 66, 68–86
   para_artifact.rs15.94%100%10%16.95%12, 18, 25, 44–46, 48–64, 66–69, 72–81, 83–88, 92–93
   port.rs93.75%100%83.33%96.15%
crates/orchestrator/src/network
   node.rs0%100%0%0%100–103, 106–108, 11, 110, 112–118, 120–122, 124–127, 129–133, 137–145, 25–40, 44–47, 50–52, 55–59, 63–66, 69–72, 79–84, 94–99
   parachain.rs0%100%0%0%100, 102–105, 15, 25–33, 35–47, 49–53, 56–60, 63–70, 72, 74, 77–82, 85–86, 88–93, 97–99
   relaychain.rs0%100%0%0%14–21, 5
crates/orchestrator/src/network_helper
   verifier.rs0%100%0%0%10–11, 16, 18–25, 27–32, 34, 7–9
crates/orchestrator/src/network_spec
   node.rs39.17%100%16.67%40.35%108, 146–150, 152–153, 155, 158, 16, 160–163, 165–168, 173–178, 180, 183, 185–215, 217, 90–91, 93–96
   parachain.rs72.04%100%50%73.03%100, 107, 125, 130–133, 136, 147–150, 153, 17, 71–73, 76, 78–80, 86, 95
   relaychain.rs88.71%100%66.67%91.07%100, 17, 70, 93
crates/orchestrator/src/shared
   types.rs26.09%100%11.76%34.48%15, 30, 36, 45–49, 52, 61, 72
crates/prom-metrics-parser/src
   lib.rs91.94%100%80%92.98%105, 127, 55–57, 7, 81
crates/provider/src
   lib.rs50%100%50%50%
crates/provider/src/native
   helpers.rs89.25%100%100%88.37%30–31, 36–38, 59, 90, 94, 98
   namespace.rs90.80%100%87.18%91.11%108–112, 183, 202, 209, 215, 217, 224, 226–227, 241, 306, 313, 318, 323, 328, 335, 348, 418, 426, 452, 457, 461, 481, 485, 520, 527, 543, 581, 585, 73
   node.rs92.27%100%91.45%92.36%1034, 1060, 1130, 116, 1172, 1207, 1218, 1243, 1247–1249, 1252, 1284, 156, 165, 189, 201, 209, 221, 235, 255, 260, 273, 322, 333, 367, 378, 392, 398, 435, 446, 478, 486, 513, 521, 560, 57, 575, 58, 580, 59, 590, 61, 615, 62, 627, 63, 656, 666, 682, 689, 715, 739, 777, 781–783, 786, 812, 848, 85–87, 872, 89–91, 93, 931, 94–95, 970
   provider.rs97.62%100%96.30%97.87%15, 179, 85
crates/provider/src/shared
   types.rs84.47%100%74.29%86.41%123, 140–146, 15–18, 230, 249–256, 79
crates/sdk/src
   lib.rs0%100%0%0%26–30
crates/support/src
   fs.rs75%100%66.67%80%
   net.rs0%100%0%0%10, 4–9
   process.rs100%100%100%100%
crates/support/src/fs
   in_memory.rs95.55%100%96.45%95.37%108, 252, 276, 327, 379, 387, 395, 403, 41–42, 425, 43, 433, 44, 46, 48–51, 53, 548, 570, 58, 598, 615, 633, 640, 659, 686, 703
   local.rs96.23%100%93.98%96.77%63, 8, 89–94
crates/support/src/process
   fake.rs82.47%100%84.62%82.03%126–131, 147, 205, 22, 229–230, 232–249, 302, 319–323, 333, 360, 39–40, 47, 63, 82, 91
   os.rs0%100%0%0%100–102, 16–18, 20–23, 25–27, 29–32, 34–36, 38–40, 43, 47–52, 54–56, 58–60, 62–64, 66–68, 70–71, 76–82, 84–89, 9, 91–95, 97–99
crates/test-runner/src
   lib.rs100%100%100%100%

@pgherveou pgherveou changed the title Take 2 - Expose API for other crates Expose Top level API through zombienet-sdk crate Nov 7, 2023
Copy link

github-actions bot commented Nov 7, 2023

Coverage after merging pg/add_native into main

77.37%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
crates/configuration/src
   global_settings.rs98.46%100%93.33%99.13%
   hrmp_channel.rs95.88%100%89.47%97.44%
   network.rs99.22%100%97.78%99.36%117, 122, 130, 175, 80, 88
   parachain.rs97.59%100%95.19%97.85%51–53, 551–560, 67–70
   relaychain.rs96.60%100%92.65%97.09%338–347, 77–79
   utils.rs40%100%40%40%11–13, 15–17, 19–21
crates/configuration/src/shared
   errors.rs50%100%50%50%
   helpers.rs100%100%100%100%
   node.rs98.32%100%92.68%98.93%124, 130
   resources.rs96.09%100%94.52%96.43%102, 114, 126–128, 147–150
   types.rs90.40%100%84.16%92.22%279–281, 350–352, 378–379, 381–383, 60–62
crates/orchestrator/src
   errors.rs0%100%0%0%8
   lib.rs0%100%0%0%100–103, 105–108, 112–115, 117–123, 125, 129, 131–146, 150–173, 177–186, 189, 192–196, 198, 200–204, 207–225, 227–232, 234–255, 259–261, 264, 267–272, 274–277, 280–284, 287, 289–302, 304–306, 309–313, 315, 317–330, 332–335, 337–339, 346, 349–373, 378–379, 389, 396–398, 400–409, 411–412, 414–422, 424–431, 433–439, 44, 440, 442–449, 45, 450–453, 456, 46–49, 51–56, 58–64, 66–69, 75, 77–92, 98–99
   network.rs0%100%0%0%100–108, 111–117, 119–127, 130–155, 157–168, 171, 173–177, 185–201, 203–205, 208–213, 215–217, 219–221, 223–225, 227–229, 231–233, 235–237, 239–241, 32–40, 43, 56–70, 77–82, 85–94, 96, 98–99
   network_spec.rs93.67%100%83.33%95.52%11, 38
   spawner.rs0%100%0%0%100–106, 108, 111–113, 116–120, 122, 127–147, 149, 151–168, 17, 40–53, 55–56, 58, 60–63, 67–68, 70, 73–93, 95–99
crates/orchestrator/src/generators
   bootnode_addr.rs97.20%100%100%96.84%
   chain_spec.rs3.24%100%5%3.08%100–111, 113–128, 130, 135–148, 151–157, 159–161, 164–192, 194–197, 199–201, 203–216, 218–219, 22, 220, 223–225, 227, 229–241, 243, 246–251, 253–254, 256–269, 271, 274–279, 281–282, 285–298, 300–305, 307–309, 311–313, 316–321, 323–352, 355, 358–361, 364, 366–367, 369–379, 38, 380–384, 386, 388–389, 392–397, 405–443, 454–459, 46, 460–462, 472–480, 482–494, 496–504, 507–509, 513–516, 518–519, 524–535, 539–552, 554, 557–558, 561–567, 569–574, 580–585, 587, 589, 591–598, 600–603, 606–607, 611–612, 614, 616–617, 619–623, 625–628, 630, 632–633, 635–636, 638–640, 642–644, 646–648, 651–653, 656–660, 662, 664–672, 674–675, 680–687, 689–699, 703–706, 708, 710, 712–717, 719–729, 731–746, 748–749, 75, 750–755, 757, 76, 761–769, 77, 770–781, 783, 792–802, 804, 806–823, 825–829, 831, 833, 84–87, 95–99
   command.rs0%100%0%0%100–112, 114–120, 122, 125–130, 132–133, 136–148, 15, 150, 153–155, 157–158, 16, 161–169, 17, 170–179, 18, 180–189, 19, 190–197, 199, 20, 201, 203–209, 21, 210–219, 22, 220–224, 226–229, 23, 231–233, 235–239, 24, 240–243, 246–250, 252–256, 258, 261–269, 271, 274–290, 293–298, 300, 303–305, 307–308, 311–333, 335, 337, 44–62, 64–66, 68–76, 79–97
   errors.rs0%100%0%0%4
   identity.rs82.35%100%60%86.21%13
   key.rs95.05%100%84.62%96.59%31
   keystore.rs0%100%0%0%19–26, 28–31, 34–46, 48–55, 57–64, 66, 68–86
   para_artifact.rs15.94%100%10%16.95%12, 18, 25, 44–46, 48–64, 66–69, 72–81, 83–88, 92–93
   port.rs93.75%100%83.33%96.15%
crates/orchestrator/src/network
   node.rs0%100%0%0%100–103, 106–108, 11, 110, 112–118, 120–122, 124–127, 129–133, 137–145, 25–40, 44–47, 50–52, 55–59, 63–66, 69–72, 79–84, 94–99
   parachain.rs0%100%0%0%100, 102–105, 15, 25–33, 35–47, 49–53, 56–60, 63–70, 72, 74, 77–82, 85–86, 88–93, 97–99
   relaychain.rs0%100%0%0%14–21, 5
crates/orchestrator/src/network_helper
   verifier.rs0%100%0%0%10–11, 16, 18–25, 27–32, 34, 7–9
crates/orchestrator/src/network_spec
   node.rs39.17%100%16.67%40.35%108, 146–150, 152–153, 155, 158, 16, 160–163, 165–168, 173–178, 180, 183, 185–215, 217, 90–91, 93–96
   parachain.rs72.04%100%50%73.03%100, 107, 125, 130–133, 136, 147–150, 153, 17, 71–73, 76, 78–80, 86, 95
   relaychain.rs88.71%100%66.67%91.07%100, 17, 70, 93
crates/orchestrator/src/shared
   types.rs26.09%100%11.76%34.48%15, 30, 36, 45–49, 52, 61, 72
crates/prom-metrics-parser/src
   lib.rs91.94%100%80%92.98%105, 127, 55–57, 7, 81
crates/provider/src
   lib.rs50%100%50%50%
crates/provider/src/native
   helpers.rs89.25%100%100%88.37%30–31, 36–38, 59, 90, 94, 98
   namespace.rs90.80%100%87.18%91.11%108–112, 183, 202, 209, 215, 217, 224, 226–227, 241, 306, 313, 318, 323, 328, 335, 348, 418, 426, 452, 457, 461, 481, 485, 520, 527, 543, 581, 585, 73
   node.rs92.27%100%91.45%92.36%1034, 1060, 1130, 116, 1172, 1207, 1218, 1243, 1247–1249, 1252, 1284, 156, 165, 189, 201, 209, 221, 235, 255, 260, 273, 322, 333, 367, 378, 392, 398, 435, 446, 478, 486, 513, 521, 560, 57, 575, 58, 580, 59, 590, 61, 615, 62, 627, 63, 656, 666, 682, 689, 715, 739, 777, 781–783, 786, 812, 848, 85–87, 872, 89–91, 93, 931, 94–95, 970
   provider.rs97.62%100%96.30%97.87%15, 179, 85
crates/provider/src/shared
   types.rs84.47%100%74.29%86.41%123, 140–146, 15–18, 230, 249–256, 79
crates/sdk/src
   lib.rs0%100%0%0%26–30
crates/support/src
   fs.rs75%100%66.67%80%
   net.rs0%100%0%0%10, 4–9
   process.rs100%100%100%100%
crates/support/src/fs
   in_memory.rs95.55%100%96.45%95.37%108, 252, 276, 327, 379, 387, 395, 403, 41–42, 425, 43, 433, 44, 46, 48–51, 53, 548, 570, 58, 598, 615, 633, 640, 659, 686, 703
   local.rs96.23%100%93.98%96.77%63, 8, 89–94
crates/support/src/process
   fake.rs82.47%100%84.62%82.03%126–131, 147, 205, 22, 229–230, 232–249, 302, 319–323, 333, 360, 39–40, 47, 63, 82, 91
   os.rs0%100%0%0%100–102, 16–18, 20–23, 25–27, 29–32, 34–36, 38–40, 43, 47–52, 54–56, 58–60, 62–64, 66–68, 70–71, 76–82, 84–89, 9, 91–95, 97–99
crates/test-runner/src
   lib.rs100%100%100%100%

@pgherveou pgherveou merged commit 439a8de into main Nov 7, 2023
4 checks passed
@pgherveou pgherveou deleted the pg/add_native branch November 7, 2023 21:00
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.

3 participants