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

Add AppVeyor #758

Merged
merged 19 commits into from
Feb 4, 2019
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: 2.x-{build}
build: false
clone_depth: 2
clone_folder: c:\projects\sentry-php
skip_branch_with_pr: true
ste93cry marked this conversation as resolved.
Show resolved Hide resolved

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
ste93cry marked this conversation as resolved.
Show resolved Hide resolved
- 7z x php-7.1.3-Win32-VC14-x86.zip -y >nul
- echo memory_limit=-1 >> php.ini
- echo zend_extension=php_opcache.dll >> php.ini
Jean85 marked this conversation as resolved.
Show resolved Hide resolved
- echo extension=php_curl.dll >> php.ini
- echo extension=php_mbstring.dll >> php.ini
- echo extension=php_openssl.dll >> php.ini
- echo opcache.enable_cli=1 >> 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 @@ -696,14 +696,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;
ste93cry marked this conversation as resolved.
Show resolved Hide resolved
}

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 @@ -178,6 +178,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 @@ -238,7 +238,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