Giter VIP home page Giter VIP logo

revit.testrunner's People

Contributors

dependabot[bot] avatar mcbubble avatar ricaun avatar tobiasfloescher-geberit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

revit.testrunner's Issues

Test with TestCase Attribute

Hello,

I am trying to use Revit.TestRunner with NUnit TestCase attribute.

But although ordinary tests are working fine, I can't make the TestCase attribute working. After debugging these tests, I see that values in the TestCase attributes are not passed in the method and end up being null.

I looked into Revit.TestRunner code, it seems that the injection of the Application and UIApplication is removing any other parameters when invoking the method. I tried to correct that, but I don't really see where to start.

If you could point me in the right direction, I would be happy to work on a pull request!

Thanks for your work!

###insertExecutingAssembly### does not exist

Hello,
after building the solution I am getting this error when revit starts and loads up the addin:
image

It is the only addin in the folder
Revit 2022

I also tried with the installer. This one creates the file sin the addins folder but when starting Revit will not read it.

Cannot Add dll to Test

Dear geberit, i have some problem with add file path to test, i has try with more time to test but it not working, if you have any idea, please help me, thanks you .
Fisrt i do work with a file test and path sample :
image
Picture when im select directory to test.
Screenshot_1
and next problem :
image

Opening a rvt file in OneTimeSetup

Opening a Revit File during the [OneTimeSetUp] causes the test runner to NOT wait for the end of the test.

To reproduce:

  1. Create a sample test that opens a Revit model:
public class SampleTest
{
	[OneTimeSetUp]
	public void OneTimeSetup(UIApplication uiApplication)
	{
	}

	[Test]
	public void SampleTest(UIApplication uiApplication)
	{
             uiApplication.OpenAndActivateDocument(@"c:\temp\hang1.rvt");
	}
}

Run "SampleTest" from the test runner => All Good

  1. Move the revit model open into the OneTimeSetUp function:
public class SampleTest
{
	[OneTimeSetUp]
	public void OneTimeSetup(UIApplication uiApplication)
	{
            uiApplication.OpenAndActivateDocument(@"c:\temp\hang1.rvt");
	}

	[Test]
	public void SampleTest(UIApplication uiApplication)
	{
	}
}

Run "SampleTest" from the test runner => The test runner will display a dialog about the successful test completion WAY BEFORE the drawing finishes opening in Revit.

Please let me know if you have any questions.

Assert.Pass() causes tests to faul

    [Test]
    public void ShouldPassSomeTest()
    {
        Assert.Pass("All is OK");
    }

Assert.Pass() - shouldn't cause the test runner to report failed test.

The fix should probably go into

    TestInstance.ExecuteTestMethod(...)

to account for NUnit.Framework.SuccessException ?

    /// <summary>
    /// Executes the test method.
    /// </summary>
    public async Task ExecuteTestMethod( string methodName )
    {
        var method = Type.GetMethod( methodName );

        try {
            await InvokeMethod( Instance, mSetUp, mPossibleParams );
            await InvokeMethod( Instance, method, mPossibleParams );
        }
        catch(NUnit.Framework.SuccessException e) {
            //Ignore 
        }
        finally {
            await InvokeMethod( Instance, mTearDown, mPossibleParams );
        }
    }        

Service may not be running...

I had this strange problem...

Sometimes when I execute Revit.TestRunner.Console.exe to make some tests.
I receive the message: Tests not executed! Service may not be running.
Everything is installed correctly, sometimes works fine others I receive this message...

Revit TestRunner Error

I don't know what could be wrong, maybe my computer is slow or Revit does not have time to finish the addin initialization.

Any idea?

"Open Runner" button greyed out

Hi,

I followed the README instructions for Getting started:
got the code -> compiled it -> ran the intallAddin .cmd (v2021)

this successfully created the TestRunner.dll and the TestRunner.addin (pointing to the dll)

when running Revit (2021) though the Button is greyed out:
image

here is the log if that helps:
Test.Runner.log

Unable to find tests in merged assembly. IL-Repack

Hello

We are using IL-Repack to merge our assemblies and a few dependent assemblies together.
With the test assembly also added to the merged assembly, Revit TestRunner is unable to find the tests inside it.
I do not know how nunit finds the tests but when loading the merged dll, nothing shows up in the treeview. It can find the tests just fine in the unmerged test assembly, but the code loaded into Revit is in the merged dll, so it cannot run

Any help would be greatly appreciated

Testrunner service not available

I am using the testrunner console application to process multiple DLL files with multiple revit versions (from 2020 up to 2023).
I'm processing everything file by file e.g. FileA gets processed in all revit versions afterwards FileB gets tested in all revit versions.

Sometimes the testrunner gives me the error "testrunner service not available". The testing pipeline remains in this state until the job times out. I tried to find the process which the testrunner opened (by its processId) and close it and restart my tests but the same thing happens again.
Afterwards i tried to manually start up revit and see if the testrunner loads correctly, but it seems like i am unable to start any revit version (there appears no error message, it just wont startup, no splashscreen at all).

The only solution to this i found so far is restarting my machine.
This behaviour occurs somewhat randomly, sometimes once in a week, sometimes multiple times a day.
Also this does not happen on a certain file or revit version. I had it happening with revit 2021 and 2023 as well as with multiple files.

If you need any further information, just let me know and ill try my best to help.
Thanks for developing this and make it available for everyone.

Revit cannot run external application "Revit.Testrunner"

I am trying to install the Revit.Testrunner binaries on my machine.
After downloading it, I unzip the package and run the .cmd file from a console that is running in admin mode.
The Revit.TestRunner.addin is properly placed in the Revit Addins folder.

When I try to run revit I am getting the following error
image

I did disable ALL other revit addins.
If I attach a VS debugger then the only problem I see in the output window is:
Exception thrown: 'System.IO.FileLoadException' in mscorlib.dll

This happens for all the Revit versions 2019-2022 and both 3.4 and 3.5 versions of the runner

If I download the source and compile it then everything works fine.

Any idea what may be wrong/missing in the binary .zip install packages?

Console application Run Test on dll File

Hello,

I was trying to execute some tests using the Console Application without having the JSON sample of the dll.

In this case, I want to test all the methods on the dll. I suppose the only way to generate de JSON is with the Revit open using the Revit.TestRunner Addin.

I was able to mess with the opensource code and open the Revit then generate the JSON with all the Tests and then run the RunTests.

I found this approach a little messy, there is an easy way to do that?

Thanks

The TestRunner addin disabled in Revit ribbon (after successful instalation)

Hello,
I have successfully installed the addin (building the source code) for Revit 2024. However, it is disabled in the ribbon - it is "greyed" out and when clicking on the icon nothing happens. Do you know what might be the issue?

The adding looks super useful, so I hope the problem can be resolved.
Thank you.

image

LOGS:
2023-07-25 15:40:00,834 [1] INFO Revit.TestRunner.Log - Revit.TestRunner started v1.4.0.0 '25/07/2023 3:40:00 pm'
2023-07-25 15:40:00,841 [1] INFO Revit.TestRunner.Log - Microsoft Windows NT 10.0.19045.0, NetFX 4.0.30319.42000
2023-07-25 15:40:00,843 [1] DEBUG Revit.TestRunner.Log - Log Directory 'C:\Repos\GithubOthers\Revit.TestRunner\src\bin\Addin'
2023-07-25 15:40:00,843 [1] DEBUG Revit.TestRunner.Log - CurrentAppDomain.ApplicationBase 'C:\Program Files\Autodesk\Revit 2024'
2023-07-25 15:40:00,867 [1] INFO Revit.TestRunner.Log - Service started '25/07/2023 3:40:00 pm'
2023-07-25 15:41:31,297 [1] INFO Revit.TestRunner.Log - Service stopped '25/07/2023 3:41:31 pm'
2023-07-25 15:42:45,096 [1] INFO Revit.TestRunner.Log - Revit.TestRunner started v1.4.0.0 '25/07/2023 3:42:45 pm'
2023-07-25 15:42:45,103 [1] INFO Revit.TestRunner.Log - Microsoft Windows NT 10.0.19045.0, NetFX 4.0.30319.42000
2023-07-25 15:42:45,105 [1] DEBUG Revit.TestRunner.Log - Log Directory 'C:\Repos\GithubOthers\Revit.TestRunner\src\bin\Addin'
2023-07-25 15:42:45,105 [1] DEBUG Revit.TestRunner.Log - CurrentAppDomain.ApplicationBase 'C:\Program Files\Autodesk\Revit 2024'
2023-07-25 15:42:45,120 [1] INFO Revit.TestRunner.Log - Service started '25/07/2023 3:42:45 pm'
2023-07-25 15:42:57,923 [1] INFO Revit.TestRunner.Log - Service stopped '25/07/2023 3:42:57 pm'
2023-07-25 15:43:15,869 [1] INFO Revit.TestRunner.Log - Revit.TestRunner started v1.4.0.0 '25/07/2023 3:43:15 pm'
2023-07-25 15:43:15,876 [1] INFO Revit.TestRunner.Log - Microsoft Windows NT 10.0.19045.0, NetFX 4.0.30319.42000
2023-07-25 15:43:15,878 [1] DEBUG Revit.TestRunner.Log - Log Directory 'C:\Repos\GithubOthers\Revit.TestRunner\src\bin\Addin'
2023-07-25 15:43:15,878 [1] DEBUG Revit.TestRunner.Log - CurrentAppDomain.ApplicationBase 'C:\Program Files\Autodesk\Revit 2024'
2023-07-25 15:43:15,897 [1] INFO Revit.TestRunner.Log - Service started '25/07/2023 3:43:15 pm'
2023-07-25 15:44:08,318 [1] INFO Revit.TestRunner.Log - Service stopped '25/07/2023 3:44:08 pm'
2023-07-25 15:53:06,644 [1] INFO Revit.TestRunner.Log - Revit.TestRunner started v1.4.0.0 '25/07/2023 3:53:06 pm'
2023-07-25 15:53:06,652 [1] INFO Revit.TestRunner.Log - Microsoft Windows NT 10.0.19045.0, NetFX 4.0.30319.42000
2023-07-25 15:53:06,654 [1] DEBUG Revit.TestRunner.Log - Log Directory 'C:\Repos\GithubOthers\Revit.TestRunner\src\bin\Addin'
2023-07-25 15:53:06,654 [1] DEBUG Revit.TestRunner.Log - CurrentAppDomain.ApplicationBase 'C:\Program Files\Autodesk\Revit 2024'
2023-07-25 15:53:06,683 [1] INFO Revit.TestRunner.Log - Service started '25/07/2023 3:53:06 pm'

Runner cannot load test dlls.

I am trying to use the Revit.TestRunner for some Revit testing and I am running into a problem that I hope you can help me with.

These are the steps I've done to reproduce my issue.

  1. Clone the Revit.TestRunner repository to my local machine (C:\Work\Projects\Revit.TestRunner)
  2. Open C:\Work\Projects\Revit.TestRunner\src\Revit.TestRunner.sln in VS and compile the whole project for Revit 2021
  3. Start Revit 2021 with No-Active-Document (so that the Revit Runner Server is Active)
    (This is done from the Windows Revit Icon and NOT from VS/ NOT debugging / VS is NOT attached to Revit)
  4. Start C:\Work\Projects\Revit.TestRunner\src\bin\Client\Revit.TestRunner.App.exe
  5. In the TestRunner.App.exe click the "..." and try open
    C:\Work\Projects\Revit.TestRunner\src\bin\Revit.TestRunner.SampleTestProject2.dll

As a result I get an error message in the TestRunner.App status bar saying
Could not load 'C:\Work\Projects\Revit.TestRunner\src\bin\Revit.TestRunner.SampleTestProject2.dll'

Now if I attach the VS debugger to Revit, after Revit was started at step 3 and try to load the SampleTestProject2.dll then everything works fine - and I am able to run the tests.

Is there anything I am missing?
Why is that the runner cannot load the test assembly when is in debug mode?
I did try to debug the issue but obviously I did fail because everything works when the debugger is attached.

I'd appreciate your help with this problem.
Please let me know if you need any extra info/log files/etc.

Peter.

OneTimeSetUp does not work

I want implement unit tests for my Revit plugins. I wrote some basic tests according to the SampleTestProject2 in the repo. Further I tried to implement a OneTimeSetUp, to load a revit project and then execute some tests using this revit project. Unfortunately the OneTimeSetup is never executed.
To reproduce, I added

[OneTimeSetUp]
        public void init()
        {
            MessageBox.Show("OnetimeSetup wokrs!");
        }

to the RevitTest-Class. But nothing happens.

If i change the lines to

[SetUp]
        public void init()
        {
            MessageBox.Show("Setup wokrs!");
        }

the message box displays two times as expected. But i want the Setup only apply once.

Further I made a Testproject using only Nunit without Revit. There, the OneTimeSetUp works.

Can you help me according this topic?
Michael

Build Test project and having Revit running

Hi Tobias,
I would like to develop test cases, build and run them using revit. Therefore I open Revit and start the TestRunner without having a Revit Project open.
If I run the tests and rebuild the test project, there is the Error:

Severity Code Description Project File Line Suppression State
Error Could not copy "obj\DEVELOPMENT\Test.dll" to "bin\DEVELOPMENT\Test.dll". Exceeded retry count of 10. Failed. The file is locked by: "Autodesk Revit (12124)" Test

By closing Revit, the Test.dll is not locked any more and the rebuild is possible. But it is time consuming to close and reopen Revit for each build process. Do you have a worklfow to avoid this behaviour?
Thanks
Michael

Console runner ignores result of some tests

I noticed that the console runner prints for some longer running tests ... Test Running ....
These tests are not accounted in the final summary (they are not added to the total amount of run tests).

Also there will be no feedback in the console print if these tests failed or passed.

I already fixed the bug here: #21

To run this application, you must install .Net Core

I've tried to launch TestRunner inside Revit2023 and received such error.
Then I downloaded and installed .Net Core 3.1 and .Net 6.0, restarted my pc but error remained.
Could you help me please solve that issue?
NetCore

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.