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

chore(tests): introduce toxiproxy to integration tests #39

Closed
wants to merge 4 commits into from

Conversation

iainsproat
Copy link

@iainsproat iainsproat commented Jul 17, 2024

This PR introduces ToxiProxy to Docker Compose file for use in integration tests.

ToxiProxy can be used to simulate failures in a network.

The proxy can be controlled from tests by using the SDK for .Net

using (var connection = new Connection(true)) //this will ensure all proxies & toxics are reset on dispose.
{
  var client = connection.Client();
  var proxy = client.FindProxy("speckle_test_speckle-server");

  // do stuff with the proxy by adding toxics: e.g. latency, returning error status codes, or dropping the connection. In this example, causing a timeout.
  var timeoutProxy = new TimeoutToxic();
  timeoutProxy.Attributes.Timeout = 100;
  timeoutProxy.Toxicity = 1.0;
  proxy.Add(timeoutProxy);

  // then apply the changes
  proxy.Update();
  
  //now run your tests and experience timeout problems connecting to speckle server
}

Copy link

codecov bot commented Jul 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 42.95%. Comparing base (f408980) to head (dab0a26).
Report is 75 commits behind head on dev.

Additional details and impacted files
@@             Coverage Diff             @@
##              dev      #39       +/-   ##
===========================================
+ Coverage   27.48%   42.95%   +15.46%     
===========================================
  Files         375      394       +19     
  Lines       14535    15620     +1085     
  Branches     1404     1419       +15     
===========================================
+ Hits         3995     6709     +2714     
+ Misses      10267     8588     -1679     
- Partials      273      323       +50     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AlanRynne
Copy link
Contributor

Closing this because we're not going to get around to this in the foreseeable future.

We'll pick this back up once we have some bandwidth! 🙌🏼

@AlanRynne AlanRynne closed this Sep 16, 2024
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