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

"__test" folder not created post-build #337

Closed
szlatkow opened this issue Nov 23, 2020 · 2 comments
Closed

"__test" folder not created post-build #337

szlatkow opened this issue Nov 23, 2020 · 2 comments

Comments

@szlatkow
Copy link

szlatkow commented Nov 23, 2020

Hi!

I followed the build instructions in the documentation locally and encountered an issue.

According to the instructions, if you follow the steps, you should see three folders "__compile", "__package" and "__test".

"__compile" and "__package" appear properly with the appropriate files inside, but the "__test" folder does not.

I looked through the *.fsx files used for the build and as far as I could understand, I couldn't see functionality for the creation of the "__test" folder.

The basis is declared in the Utils.fsx file for all the folders, but in the build.fsx, I couldn't find references to the declaration of the "__test" folder.

@bchavez
Copy link
Owner

bchavez commented Nov 28, 2020

Hi @szlatkow,

I don't think the __test folder is used anymore. IIRC, in the early days of .NET Core and AppVeyor, the only way I could get tests to show correctly in the AppVeyor UI was to dump the unit test results XML to a __test folder; then upload those XML results into AppVeyor.

That old process isn't used anymore because the dotnet test Test Platform is used now. Currently, the way tests are uploaded into AppVeyor is by using "special" *.TestLogger plugins such as:

<PackageReference Include="Appveyor.Testlogger" Version="2.0.0" />

I suspect the references to __test are remnants of the early .NET Core days.

If you want to run tests,

  • build.cmd test should do it.

Test results should get displayed (but not logged to disk). For example,

Microsoft (R) Test Execution Command Line Tool Version 16.8.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
[xUnit.net 00:00:02.93]     Bogus.Tests.Rant_Generator.generate_product_reviews [SKIP]
  Skipped Bogus.Tests.Rant_Generator.generate_product_reviews [1 ms]
[xUnit.net 00:00:09.64]     Bogus.Tests.GitHubIssues.Issue121.Test [SKIP]
  Skipped Bogus.Tests.GitHubIssues.Issue121.Test [1 ms]
[xUnit.net 00:00:11.34]     Bogus.Tests.DataSetTests.ImageTest.DownloadAllTest [SKIP]
  Skipped Bogus.Tests.DataSetTests.ImageTest.DownloadAllTest [1 ms]
[xUnit.net 00:00:11.50]     Bogus.Tests.DataSetTests.InternetTests.can_get_avatar [FAIL]
  Failed Bogus.Tests.DataSetTests.InternetTests.can_get_avatar [335 ms]

If you really want the test results XML file, you'll have to follow these instructions in this repository for the XunitXml.TestLogger:
https://github.com/spekt/xunit.testlogger#usage

<PackageReference Include="XunitXml.TestLogger" Version="2.1.26" />

cd Bogus\Source\Bogus.Tests
❯ dotnet test --logger:"xunit;LogFilePath=test_result.xml"

And that should get you a test XML file located in Bogus\Source\Bogus.Tests\test_result.xml

Essentially, in the early days of .NET Core, this was the command that was used to dump the test_result.xml file to the __test folder.

I hope this helps.

Thanks,
Brian

@bchavez
Copy link
Owner

bchavez commented Nov 29, 2020

Hi @szlatkow, the latest commit in master should create __test\results.xml file now. Fixed in 5219e22.

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

No branches or pull requests

2 participants