Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
Setup Azure Pipeline for validation and fixed test issues on Linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
katmsft authored and vinjiang committed Apr 25, 2019
1 parent 272dbba commit f27c5ed
Show file tree
Hide file tree
Showing 7 changed files with 545 additions and 7 deletions.
45 changes: 45 additions & 0 deletions azure-pipelines.yml
@@ -0,0 +1,45 @@
# PHP
# Test and package your PHP project.
# Add steps that run tests, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/php

pr:
- master
- dev

pool:
vmImage: 'Ubuntu-16.04'

variables:
phpVersion: 7.0

steps:
- script: |
sudo update-alternatives --set php /usr/bin/php$(phpVersion)
sudo update-alternatives --set phar /usr/bin/phar$(phpVersion)
sudo update-alternatives --set phpdbg /usr/bin/phpdbg$(phpVersion)
sudo update-alternatives --set php-cgi /usr/bin/php-cgi$(phpVersion)
sudo update-alternatives --set phar.phar /usr/bin/phar.phar$(phpVersion)
php -version
displayName: 'Use PHP version $(phpVersion)'

- script: composer install --no-interaction --prefer-dist
displayName: 'composer install'

- script: php clean_up.php
env: { AZURE_STORAGE_CONNECTION_STRING: $(AZURE_STORAGE_CONNECTION_STRING),
AZURE_STORAGE_CONNECTION_STRING_BLOB_ACCOUNT: $(AZURE_STORAGE_CONNECTION_STRING_BLOB_ACCOUNT),
AZURE_STORAGE_CONNECTION_STRING_PREMIUM_ACCOUNT: $(AZURE_STORAGE_CONNECTION_STRING_PREMIUM_ACCOUNT)}
displayName: 'clean up test environment'


- task: Ant@1
inputs:
antBuildFile: 'build.linux.xml'
options:
targets: 'full-build-parallel'
publishJUnitResults: false
env: { AZURE_STORAGE_CONNECTION_STRING: $(AZURE_STORAGE_CONNECTION_STRING),
AZURE_STORAGE_CONNECTION_STRING_BLOB_ACCOUNT: $(AZURE_STORAGE_CONNECTION_STRING_BLOB_ACCOUNT),
AZURE_STORAGE_CONNECTION_STRING_PREMIUM_ACCOUNT: $(AZURE_STORAGE_CONNECTION_STRING_PREMIUM_ACCOUNT)}

6 changes: 2 additions & 4 deletions azure-storage-table/src/Table/Models/BatchResult.php
Expand Up @@ -67,8 +67,7 @@ private static function _constructResponses($body, IMimeReaderWriter $mimeSerial
$response = new \stdClass();

// Split lines
$lines = explode("\r\n", $parts[$i]);

$lines = preg_split("/\\r\\n|\\r|\\n/", $parts[$i]);
// Version Status Reason
$statusTokens = explode(' ', $lines[0], 3);
$response->version = $statusTokens[0];
Expand All @@ -84,7 +83,7 @@ private static function _constructResponses($body, IMimeReaderWriter $mimeSerial
isset($headerTokens[1]) ? trim($headerTokens[1]) : null;
} while (Resources::EMPTY_STRING != $headerLine);
$response->headers = $headers;
$response->body = implode("\r\n", array_slice($lines, $j));
$response->body = implode(PHP_EOL, array_slice($lines, $j));
$responses[] = $response;
}

Expand Down Expand Up @@ -134,7 +133,6 @@ public static function create(
$callbackName = __CLASS__ . '::_compareUsingContentId';
$count = count($responses);
$entries = array();

// Sort $responses based on Content-ID so they match order of $operations.
uasort($responses, $callbackName);

Expand Down

0 comments on commit f27c5ed

Please sign in to comment.