Commit graph

4665 commits

Author SHA1 Message Date
Andrew Schwartzmeyer db93f411da Add Third Party Notices for AppImage
This license specifically covers the additional libraries that
are bundled inside the AppImage archive.
2017-02-17 11:09:36 -08:00
Andrew Schwartzmeyer 8185fd9350 Add AppImage to CI 2017-02-17 11:09:36 -08:00
probonopd 0c1b11724e Add AppImage documentation 2017-02-17 11:09:36 -08:00
probonopd 0e9d85084f Add AppImage tooling
* Use icon from local repository
  https://github.com/PowerShell/PowerShell/pull/2027#discussion_r75960616

* Use the deb that has been generated in this build

* Copyright and license
  https://github.com/PowerShell/PowerShell/pull/2027#discussion_r75960505

* MIT License for appimage.sh
  https://github.com/PowerShell/PowerShell/pull/2027#discussion_r75960505

* Full text of the MIT License is in license_thirdparty_proprietary.txt

* Clarify license and clean up unused code
  https://github.com/PowerShell/PowerShell/pull/2027#discussion_r76104601

* Mark appimage.sh as executable
2017-02-17 11:07:10 -08:00
Dongbo Wang 5a8fa57278 Fix PSModuleInfo.CaptureLocals to not do ValidateAttribute check when capturing variables from the caller's scope (#3149)
Fix PSModuleInfo.CaptureLocals to not do ValidateAttribute check when capturing variables from the caller's scope
2017-02-16 21:25:23 -08:00
Paul Higinbotham c266c8ebca Fix for duplicate types in TypeTable (#3141)
When a TypeTable is created it includes the types from type files provided along with references to the type files. When the InitialSessionState (ISS) object processes these types it reads the type files again and ends up with duplicate type entries. PowerShell V5.1 ISS type processing was re-written to improve performance and no longer removes duplicate types, so that this scenario (runspace ISS reuse) results in errors causing a regression.

The fix is to copy only type data when a TypeTable is passed to the ISS.
2017-02-16 16:28:29 -08:00
Dongbo Wang d60dc730a4 doc updates for release alpha.16 (#3160)
* doc changes for alpha.16 release

* update spelling ignore file for new release
2017-02-16 09:09:45 -08:00
Ilya 409ab7443f Fix GetType() bad pattern and related issues in tests (#3134)
* Fix GetType() bad pattern and related issues in tests

$var.GetType() can raise an exception in tests so we should check $var
before make the call. A large part of the tests does not make this
check.
I start with searching ".GetType()" but discovered many related issues
in tests (reduntant and unneeded tests, "throw" bad pattens, bugs,
formattings (sorry!) and so on) - I had to fix them too.

* Fix after code review
* Second wave of migration GetType() -> BeOfType
Removed 'GetType().Name' patterns.
2017-02-15 16:40:51 -08:00
James Truher [MSFT] d801b75d35 Remove async tests for parser (#3119)
* Remove async tests for parser
this is a fix for https://github.com/PowerShell/PowerShell/issues/3069
This removes an attempt to work-around the issue of tests hanging on Travis-CI.
* remove unneeded finally block
2017-02-15 16:39:30 -08:00
Ilya fd70adbc90 Improve console cmdlets tests (#3101)
* Improve console cmdlets tests
Main improvements refer to tests of the Write-Host cmdlet.
Original tests:
1. Slow because run external processes
2. Don't test colors and -NoNewLine in fact.

1. The original tests is preserved (deleted one as redundant) but marked
by 'Slow' tag. They is preserved because they actually check the output
on the work, not a test console.
2. Add negative color tests. (Code cover grow!)
3. Add tests based on TestHostCS. This test host has been refined so we
can see colors and a new line in output.
4. Add minor fixes for test modules loads.

Also I add support for Information stream. I originally planned to use
it but not actually used. However, I have left this as a useful addition
for future tests.
I wonder that a Write-Host console output is duplicated in Information
Stream - Is it by design? I left a debug print on this matter in the
test code.

* Fix after code review
* Corrections after code review
Suppress import-module warnings
Rename Describes
Add "-Object" test
Add Stream.Information tests with TestHostCS
* Add checks for Streams.Information and add comments
2017-02-14 11:00:03 -08:00
Paul Higinbotham ca12001c8d Implement RoleDefinitions RoleCapabilityFiles keyword (#3067)
* Changes to implement remote endpoint RoleDefinition RoleCapabilityFiles keyword
* Fixed spelling error.  Added back missing resource string
* Updated tests from CR comments
* Simplified error tests per Code Review
* Test change from Code Review
2017-02-14 10:42:17 -08:00
Ilya a16fead0a5 Fix error position reporting on classes (#3103)
Interactive hosts expect an `IncompleteParseException` to signal that more input is expected.

When detecting errors, the parser can report 2 positions:
* where the error should be reported
* where the error was detected

Typically these are the same, so most error reporting methods have a single parameter.
For missing braces, the pattern is supposed to be to report the error after the opening brace, but the error is typically detected at the end of the file.

There were a few places where we were not consistent in reporting such errors, this PR corrects those places.
2017-02-13 16:45:00 -08:00
Andrew Gaspar ca5fc9c5a8 Fix tab completion of native parameters (#2919)
Native argument completers were not invoked when the argument was a single dash.

The fix is to treat unbound command parameters as command arguments for the purposes of parameter/argument completion.
2017-02-13 16:02:56 -08:00
Steve Lee a042dc1ff1 Fix reference to sshd service restarting (#3138)
Addresses https://github.com/PowerShell/PowerShell/issues/3116
2017-02-13 14:13:13 -08:00
Ilya aa764dd54e Small typo in archive cmdlets tests (#3121)
* Small typo in archive cmdlets tests
* Add  -ErrorAction SilentlyContinue
2017-02-10 13:39:34 -08:00
Sergei Vorobev 39c44b4ffc Don't allow_failures on osx (#3123) 2017-02-09 14:01:54 -08:00
Sergei Vorobev 367b04d909 Use ruby 2.3.1 for fpm on OSX (#3120) 2017-02-09 09:35:34 -08:00
Ilya b22369e2be Make small optimization in parser tests (#3072)
* Make small optimization in parser tests

* Add Clear() for common command
Remove commands from AfterEach

* Refactoring test 'functions are resolved before cmdlets'
2017-02-08 17:42:44 -08:00
jeffbi 7ba3b50d4a Fix #3080 (#3107)
Pass null rather than "localhost" to CimSession.Create
2017-02-08 08:40:56 -08:00
Jason Shirk cc664bc639 Fix lock contention during script compilation (#3064)
In rare cases, it was possible to cause high contention on a lock used
while compiling code to run in the interpreter.

This fixes the problem in a couple different ways:

* Use ConditionalWeakTable which has finer granularity in locking
* Avoid dictionary lookups in the most common cases
  - There really aren't too many real cases, I could have covered them
    all, but keeping the code generic is useful for the future.

Not quite related, but I noticed we didn't cache certain interpreter
instructions and it made sense to add a cache because we generate a lot
of array-init instructions.
2017-02-06 23:09:55 -08:00
James Truher [MSFT] 5871e1ac4b Provide class level coverage data via OpenCover module (#3088) 2017-02-06 23:04:45 -08:00
Ilya 29818062e8 Convert Get-FileHash to a cmdlet (#3024) 2017-02-03 18:11:57 -08:00
Steve Lee 803b70f318 Update KNOWNISSUES.md (#3085)
Added some issue #s for open issues.  Removed some rows from the table that have been fixed.
2017-02-03 17:55:47 -08:00
Francisco Gamino f852e40b3c Enabling crossgen for the assemblies used by Add-Type, which are Microsoft.CodeAnalysis.CSharp.dll, Microsoft.CodeAnalysis.dll, Microsoft.CodeAnalysis.VisualBasic.dll, and Microsoft.CSharp.dll. This speeds up executing Add-Type from ~3 to 0.9 seconds. (#3086) 2017-02-03 15:19:05 -08:00
Sergei Vorobev 8517b8dafb Mark Write-Information test as pending on macOS 2017-02-03 09:27:35 -08:00
Sergei Vorobev b37371b3dd Fix patching logic for .dotnet openssl dylib
Fixes #3062
2017-02-03 09:27:35 -08:00
Francisco Gamino f57f924caf Adding '$pshome/cultureName/default.help.txt' to PowerShell Windows Core project. (#3032)
* Adding PowerShellHelpFiles package which contains default.help.txt to powershell-win-core

* Adding test case to validate that <pshome>/<culture>/default.help.txt is present. This is done by calling 'Get-Help'

* Updating get-help to skip searching for the help file when the InternalTestHooks.BypassOnlineHelpRetrieval is enable. This way, we force get-help to generate a metadata driven help object, which includes a helpUri that points to the fwlink defined in the cmdlet code.

* Updating get-help -online <cmdletName> tests to not delete the help files. Instead, I've added logic to get-help to not find the help file when the test hook BypassOnlineHelpRetrieval is enable.
2017-02-01 17:56:52 -08:00
Sergei Vorobev 9750297ce3 Add 'osx.10.12-x64' runtime to project.json files 2017-02-01 17:52:35 -08:00
Aditya Patwardhan a69116db05 Fix GetComputerInfo test for looking up registry (#3065)
* Fix GetComputerInfo test for looking up registry

* Addressed code review comments
2017-02-01 17:49:33 -08:00
Aditya Patwardhan 8303a2b3fb Fix get-help online test (#3051)
Fix the "get-help -online" test using a workaround so that when a default browser is not set, the test does not fail.
2017-02-01 17:19:55 -08:00
James Truher [MSFT] 250efcd39f Create a badge for the daily test runs in travis-ci (#3076)
* changes which enable setting a badge for the daily test runs in travis

It updates an azure blob with an SVG and that location is referenced by the
README.md file. TravisCI doesn't support this directly so in order to report
on the status of a daily test run there, we need to do this.
Provide error reporting in case the badge can't be set

* change new-object calls to use constructor

Remove extraneous date setting
update string creation to use stringbuilder rather than string addition
2017-02-01 15:53:30 -08:00
Aditya Patwardhan 9ab8c6df4c Make OpenCover merge and upload more reliable/usable (#3078)
* Corrected the opencover option to merge the output file

- Delete temporary zip file.
- Remove CodeCov uploading through cygwin.
- Add code to use Invoke-WebRequest to upload to CodeCov

* Codecov settings

- Wait for 1 build to start analysis.
- Do not wait for CI.
- Disable comments in PR.

* Addressed code review comments
2017-02-01 15:45:03 -08:00
Francisco Gamino 89a5c17d6b Fixing 'InFile parameter of Invoke-WebRequest doesn't work' and adding aliases (iwr for invoke-webrequest and irm for invoke-restmethod) to the web cmdlets. (#2848)
* Fixing Invoke-WebRequest InFile parameter

* Adding aliases for Invoke-RestMethod and Invoke-WebRequest

* Adding test cases for Web cmdlets -InFile parameter

* Adding tests for Invoke-WebRequest (iwr) and Invoke-RestMethod (irm) using the cmdlet aliases.

* Remove the extra leading space
2017-02-01 10:14:24 -08:00
Mike Richmond 1431105251 Adding Microsoft.PowerShell.Commands.Diagnostics to the list of packages published to our MyGet feed (#3050) 2017-01-30 16:44:23 -08:00
Aditya Patwardhan d7cf81b64d Added functionality to improve failure triaging (#3037)
* Added functionality to improve failure triaging

- Nunit logs will be created to tests.
- Logs are copied to the Azure share.
- Pester is run with -Quiet
- Elevated and unelevated runs for tests with appropriate tags

* Copy logs to Azure share and upload to CodeCov

- Zip and copy to Azure log share
- Upload to codecov using cygwin

* Fixed varaible name in if condition

* Addressed code review comments

* Modified the destination folder structure for logs

- Creates a folder structure for yyyy-MM and Windows for storing logs
- Updated zip file name to not have illegal characters

* Modifications as suggested by codecov.io
2017-01-27 09:40:18 -08:00
Noutlaw1 edf685dc9c Added alias (Path) to the FilePath parameter of the Out-File cmdlet. (#2945)
* Added parameter alias to the Out-File cmdlet, allowing -FilePath to be used as -Path.

Relevant issue: https://github.com/PowerShell/PowerShell/issues/2923

* Test to confirm the alias I added to the Out-File cmdlet's -FilePath parameter works.

* Changed test for parameter alias as per feedback.

* Updating based on feedback.

Made formatting changes:
Added space between brackets and start of cmdlet.
Moved end bracket to before the pipe and Should Not Throw statement.
Removed -InputObject parameter for the test, as it was not needed.

* Added BeforeAll to the first part of the file. Replaced tabs with spaces.

#2945

* Fixing indentation within the test file
2017-01-26 14:17:40 -08:00
Jason Shirk 3aeaeb06da cache packages in appveyor (#3019) 2017-01-26 11:34:39 -08:00
Michael Elufimov b95bc3786b Fix link to macos pkg file in Readme (#3053) 2017-01-25 22:34:35 -08:00
Jason Shirk 110878ca05 Cache padding strings up to 120 spaces (#3036) 2017-01-25 18:19:08 -08:00
Joey Aiello f41b94fe03 change '2k' years in build script (#3043) 2017-01-25 18:00:39 -08:00
Jason Shirk 564a592007 Merge rel-v6.0.0-alpha.15 2017-01-25 15:43:37 -08:00
Jason Shirk (POWERSHELL) 58afa5c077 Update spelling exception for alpha.15 2017-01-25 14:10:45 -08:00
Ilya abc3614919 Get-Help test reported as skipped if not applicable to the platform (#3009)
Addressed #2887
2017-01-24 18:04:44 -08:00
Mike Richmond f2b9f7d5ab Add WindowsUBR to Get-ComputerInfo (#2995) 2017-01-23 13:07:38 -08:00
Aditya Patwardhan e5c412e71c Fixed a typo in the code coverage yaml file (#3033) 2017-01-23 13:07:11 -08:00
Sergei Vorobev c699775272 Update CONTRIBUTING.md: avoid rewrite (#3022)
Avoid rewriting history in PR iterations.
2017-01-23 11:44:36 -08:00
Ilya cba1c26bf0 Fix typo in Unblock-File test (#3025) 2017-01-23 11:43:38 -08:00
Andrew Schwartzmeyer 3a34747913 Address code review issues 2017-01-20 11:05:24 -08:00
Andrew Schwartzmeyer f1767dd24d Fix undefined variable in build.psm1
`$rpm_dist` used to be unconditionally defined,
but the changes to support Fedora made it defined only on
RedHat family platforms, so the variable was undefined on Ubuntu
but the flag still added to fpm's arguments, causing a build error.
Now we only add the flag and its argument when it's relevant.
2017-01-20 11:05:24 -08:00
Naadir Jeewa 01dfb88e4d Initial Support for Fedora 24 (#2738)
* Initial support for Fedora 24
This commit adds initial support for the Fedora distribution,
starting with Fedora 24.

Whereever possible, build tooling for CentOS has been reused.

Until the next release of PowerShell is compiled against .NET 1.1,
the Docker release image uses the CentOS 7 build, but loads
in the CentOS 7 version of `libicu50` via LD_LIBRARY_PATH.

* Update Dockerfile

Fix typos
2017-01-20 11:05:24 -08:00