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

Publish end-to-end tests as a standalone executable #7342

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

damonbarry
Copy link
Member

@damonbarry damonbarry commented Aug 7, 2024

  • Remove unused using statements
  • When installing IoT Edge from snaps, alias the iotedge CLI
  • Remove no-longer-needed abstraction for executing iotedge CLI commands in the tests
  • Add Ubuntu Core as a supported distro in end-to-end tests
  • Migrate from NUnit to MSTest
    • [EndToEnd] attribute becomes [TestClass] + [TestCategory("EndToEnd")]
    • [Test] attribute becomes [TestMethod]
    • [Category("...")] attributes become [TestCategory("...")]
    • [Values] attributes become [DataRow(...)] attributes
    • In DataRow tests, add test arguments as a custom "Row" property to TestContext so we can output the full test name in our custom logging
    • Assert.NotNull(...) becomes Assert.IsNotNull(...)
    • Assert.Ignore(...) becomes Assert.Inconclusive(...)
    • Assert.That(...) has no analog in MSTest, but StringAssert.StartsWith(...) does what we need in the one case where we used Assert.That(...)
    • Assert.Zero(...) becomes Assert.AreEqual(0, ...)
    • Use in the CSPROJ file
    • [OneTimeSetup]/[OneTimeTearDown] becomes [AssemblyInitialize]/[AssemblyCleanup]
    • AssemblyInitialize/AssemblyCleanup methods must be static, so convert to static any class members we manage within those methods
    • [OneTimeSetUp]/[OneTimeTearDown] becomes [ClassInitialize]/[ClassCleanup]. Use [ClassInitialize(InheritanceBehavior.BeforeEachDerivedClass)] so inherited init methods are called too (similar to NUnit)
    • ClassInitialize/ClassCleanup methods must be static, so convert to static any class members we manage within those methods
    • [SetUp]/[TearDown] becomes [TestInitialize]/[TestCleanup]
  • We can't easily install libicu on Ubuntu Core, so set System.Globalization.Invariant = true in test/Microsoft.Azure.Devices.Edge.Test/runtimeconfig.template.json

Azure IoT Edge PR checklist:

This checklist is used to make sure that common guidelines for a pull request are followed.

General Guidelines and Best Practices

  • I have read the contribution guidelines.
  • Title of the pull request is clear and informative.
  • Description of the pull request includes a concise summary of the enhancement or bug fix.

Testing Guidelines

  • Pull request includes test coverage for the included changes.
  • Description of the pull request includes
    • concise summary of tests added/modified
    • local testing done.

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.

1 participant