<commit_before>﻿# For now, we only have one script.
$jUnit = Join-Path $env:TEMP 'self-test-junit-0.xml'

$tests = @(
  'modules - test app'
  '^assets'
  'autoupdate'
  'dynamic import'
) -Join '|'

Write-Host "Running: $tests" -ForegroundColor Yellow
Write-Host "Excluded: $env:SELF_TEST_EXCLUDE" -ForegroundColor Yellow

.\meteor.bat self-test --junit "$jUnit" "$tests" --exclude "$env:SELF_TEST_EXCLUDE" '2>&1'
$selfTestExitCode = $LASTEXITCODE

If ($selfTestExitCode -eq 0) {
  Write-Host "Success!" -ForegroundColor Green
} else {
  Write-Host "FAILURE! (Exit: $selfTestExitCode)" -ForegroundColor Red
}

Write-Host "Uploading JUnit test results..." -ForegroundColor Magenta
$wc = New-Object 'System.Net.WebClient'
Get-ChildItem $env:TEMP 'self-test-junit-*.xml' | Foreach-Object {
  Write-Host " - $($_.FullName)" -ForegroundColor Magenta
  Write-Host "   - as Artifact..." -ForegroundColor Magenta
  Push-AppveyorArtifact $_.FullName
  Write-Host "   - as Test Results..." -ForegroundColor Magenta
  $artifactPostUrl = `
    "https://ci.appveyor.com/api/testresults/junit/",
    $env:APPVEYOR_JOB_ID -Join ''
  $wc.UploadFile($artifactPostUrl, ($_.FullName))<commit_msg>Remove problematic Windows test, until it can be researched further.<commit_after>﻿# For now, we only have one script.
$jUnit = Join-Path $env:TEMP 'self-test-junit-0.xml'

$tests = @(
  '^assets'
  '^autoupdate'
  '^dynamic import'
) -Join '|'

Write-Host "Running: $tests" -ForegroundColor Yellow
Write-Host "Excluded: $env:SELF_TEST_EXCLUDE" -ForegroundColor Yellow

.\meteor.bat self-test --junit "$jUnit" "$tests" --exclude "$env:SELF_TEST_EXCLUDE" '2>&1'
$selfTestExitCode = $LASTEXITCODE

If ($selfTestExitCode -eq 0) {
  Write-Host "Success!" -ForegroundColor Green
} else {
  Write-Host "FAILURE! (Exit: $selfTestExitCode)" -ForegroundColor Red
}

Write-Host "Uploading JUnit test results..." -ForegroundColor Magenta
$wc = New-Object 'System.Net.WebClient'
Get-ChildItem $env:TEMP 'self-test-junit-*.xml' | Foreach-Object {
  Write-Host " - $($_.FullName)" -ForegroundColor Magenta
  Write-Host "   - as Artifact..." -ForegroundColor Magenta
  Push-AppveyorArtifact $_.FullName
  Write-Host "   - as Test Results..." -ForegroundColor Magenta
  $artifactPostUrl = `
    "https://ci.appveyor.com/api/testresults/junit/",
    $env:APPVEYOR_JOB_ID -Join ''
  $wc.UploadFile($artifactPostUrl, ($_.FullName))
{'fraction_non_alphanumeric': 0.15355648535564853, 'fraction_numerical': 0.0033472803347280333, 'mean_word_length': 4.289823008849558, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4492241', 'n_tokens_mistral': 855, 'n_tokens_neox': 841, 'n_words': 191}