Skip to content

Commit

Permalink
More CI Fixes
Browse files Browse the repository at this point in the history
Also ensures deps are installed for framework-dependant build.

Work done for #196
  • Loading branch information
atruskie committed Mar 30, 2020
1 parent 7cf239a commit fd5162f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 17 deletions.
6 changes: 3 additions & 3 deletions build/azure-pipelines-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
path: $(NUGET_PACKAGES)
displayName: Cache NuGet packages

- ${{ if startsWith(platform.rid, 'linux') }}:
- ${{ if startsWith(platform.pool, 'ubuntu') }}:
- template: azure-pipelines-dependencies-linux.yml

- pwsh: |
Expand Down Expand Up @@ -108,15 +108,15 @@ jobs:
command: build
versioningScheme: 'off'
arguments: --configuration ${{ configuration }} --no-restore $(runtimeArgument)
displayName: Build solution (${{ configuration }}, ${{ platform.rid }})
displayName: Build solution (${{ configuration }}, ${{ coalesce(platform.rid, 'any') }})

# https://github.com/microsoft/vstest/issues/2202 -- need to remove --no-build to make tests work on linux
- task: DotNetCoreCLI@2
inputs:
command: test
projects: tests/Acoustics.Test/Acoustics.Test.csproj
publishTestResults: true
testRunTitle: "Acoustics.Test for ${{ platform.rid }} ${{ configuration }}"
testRunTitle: "Acoustics.Test for ${{ coalesce(platform.rid, 'any') }} ${{ configuration }}"
arguments: >
$(runtimeArgument)
--configuration ${{ configuration }}
Expand Down
3 changes: 2 additions & 1 deletion build/azure-pipelines-dependencies-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ steps:
sudo apt-get install -y libsox-fmt-all sox
displayName: Install SoX
- script: |
sudo apt-get install -y wavpack
sudo apt-get install -y wavpack
displayName: Install WavPack
2 changes: 1 addition & 1 deletion tests/Acoustics.Test/AnalysisBase/FileSegmentTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void SecondConstructorAutomaticallyExtractsInfo()
Assert.AreEqual(null, s.SegmentEndOffset);
Assert.AreEqual(0, s.StartOffsetSeconds);
Assert.AreEqual(info.Duration.Value.TotalSeconds, s.EndOffsetSeconds, 1.0);
Assert.That.AreEqual(info.Duration.Value, s.TargetFileDuration.Value, TimeSpan.FromMilliseconds(0.1));
Assert.That.AreEqual(info.Duration.Value, s.TargetFileDuration.Value, 0.1.Seconds());
Assert.AreEqual(info.SampleRate, s.TargetFileSampleRate);
Assert.AreEqual("Currawongs_curlew_West_Knoll_Bees_20091102-183000", s.SourceMetadata.Identifier);
Assert.IsNull(s.TargetFileStartDate);
Expand Down
5 changes: 3 additions & 2 deletions tests/Acoustics.Test/Tools/AudioUtilityInfoTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace Acoustics.Test.Tools
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading;
using Acoustics.Shared;
Expand Down Expand Up @@ -221,7 +222,7 @@ public void InfoWorksSoxTool(string file)

var source = TestHelper.GetAudioFile(file);

if (util.SupportsMp3)
if (!Path.GetExtension(file).EndsWith(MediaTypes.ExtMp3) || util.SupportsMp3)
{
var info = util.Info(source);

Expand All @@ -231,7 +232,7 @@ public void InfoWorksSoxTool(string file)
}
else
{
Assert.ThrowsException<AudioFormatNotSupportedException>(
Assert.ThrowsException<NotSupportedException>(
() => util.Info(source),
"cannot be processed. Valid formats are: wav (audio/wav), flac (audio/flac).");
}
Expand Down
11 changes: 1 addition & 10 deletions tests/Acoustics.Test/Tools/AudioUtilityMp3Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@ public class AudioUtilityMp3Tests
[PlatformSpecificTestMethod(OSX)]
public void SegmentsMp3NotAvailableOnOsxWithSox()
{
var expected = new AudioUtilityInfo
{
Duration = TimeSpan.FromSeconds(30),
SampleRate = 11025,
ChannelCount = 1,
MediaType = MediaTypes.MediaTypeMp3,
BitsPerSecond = 16000,
};

var request = new AudioUtilityRequest
{
MixDownToMono = true,
Expand All @@ -41,7 +32,7 @@ public void SegmentsMp3NotAvailableOnOsxWithSox()
var source = TestHelper.GetAudioFile("Currawongs_curlew_West_Knoll_Bees_20091102-183000.mp3");
var output = PathHelper.GetTempFile(MediaTypes.ExtMp3);

Assert.ThrowsException<AudioFormatNotSupportedException>(
Assert.ThrowsException<NotSupportedException>(
() => util.Info(source),
"cannot be processed. Valid formats are: wav (audio/wav), flac (audio/flac).");

Expand Down

0 comments on commit fd5162f

Please sign in to comment.