Skip to content

Commit

Permalink
Add AppVeyor to CI pipeline (#758)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean85 authored and ste93cry committed Feb 4, 2019
1 parent aa444b7 commit a78a4b1
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 12 deletions.
33 changes: 33 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: 2.x-{build}
build: false
clone_depth: 2
clone_folder: c:\projects\sentry-php
skip_branch_with_pr: true

cache:
- composer.phar
- '%LocalAppData%\Composer\files'
- c:\projects\sentry-php\vendor

init:
- SET PATH=c:\php;%PATH%
- SET COMPOSER_NO_INTERACTION=1
- SET SYMFONY_DEPRECATIONS_HELPER=strict
- SET ANSICON=121x90 (121x90)

install:
- mkdir c:\php && cd c:\php
- appveyor DownloadFile https://github.com/symfony/binary-utils/releases/download/v0.1/php-7.1.3-Win32-VC14-x86.zip
- 7z x php-7.1.3-Win32-VC14-x86.zip -y >nul
- echo memory_limit=-1 >> php.ini
- echo extension=php_curl.dll >> php.ini
- echo extension=php_mbstring.dll >> php.ini
- echo extension=php_openssl.dll >> php.ini
- cd c:\projects\sentry-php
- IF NOT EXIST composer.phar (appveyor DownloadFile https://github.com/composer/composer/releases/download/1.7.1/composer.phar)
- php composer.phar self-update
- php composer.phar update --no-progress --no-suggest --ansi

test_script:
- cd c:\projects\sentry-php
- vendor\bin\phpunit.bat
2 changes: 1 addition & 1 deletion src/Context/ServerOsContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public function setKernelVersion(string $kernelVersion): void
private function configureOptions(OptionsResolver $resolver): void
{
$resolver->setDefaults([
'name' => PHP_OS,
'name' => php_uname('s'),
'version' => php_uname('r'),
'build' => php_uname('v'),
'kernel_version' => php_uname('a'),
Expand Down
8 changes: 0 additions & 8 deletions src/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -720,14 +720,6 @@ private function normalizeAbsolutePath($value)
$path = $value;
}

if (
\DIRECTORY_SEPARATOR === substr($path, 0, 1)
&& \DIRECTORY_SEPARATOR !== substr($path, -1)
&& '.php' !== substr($path, -4)
) {
$path .= \DIRECTORY_SEPARATOR;
}

return $path;
}

Expand Down
5 changes: 4 additions & 1 deletion tests/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,14 @@ public function testCaptureLastErrorDoesNothingWhenThereIsNoError(): void
$client->captureLastError();
}

/**
* @requires OSFAMILY Linux
*/
public function testAppPathLinux(): void
{
$client = ClientBuilder::create(['project_root' => '/foo/bar'])->getClient();

$this->assertEquals('/foo/bar/', $client->getOptions()->getProjectRoot());
$this->assertEquals('/foo/bar', $client->getOptions()->getProjectRoot());

$client->getOptions()->setProjectRoot('/foo/baz/');

Expand Down
5 changes: 4 additions & 1 deletion tests/EventFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ public function testCreateWithStacktrace(): void
/** @var Frame $lastFrame */
$lastFrame = array_reverse($stacktrace->getFrames())[0];

$this->assertSame('src/EventFactory.php', $lastFrame->getFile());
$this->assertSame(
'src' . \DIRECTORY_SEPARATOR . 'EventFactory.php',
ltrim($lastFrame->getFile(), \DIRECTORY_SEPARATOR)
);
}
}
2 changes: 1 addition & 1 deletion tests/OptionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public function excludedPathProviders()
return [
['some/path', 'some/path'],
['some/specific/file.php', 'some/specific/file.php'],
[__DIR__, __DIR__ . '/'],
[__DIR__, __DIR__],
[__FILE__, __FILE__],
];
}
Expand Down

0 comments on commit a78a4b1

Please sign in to comment.