-
Notifications
You must be signed in to change notification settings - Fork 21
/
appveyor.yml
87 lines (75 loc) · 3.38 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Do not build feature branch with open Pull Requests
skip_branch_with_pr: true
environment:
TOX_ENV: pywin
erlang_download_url: https://github.com/erlang/otp/releases/download/OTP-21.3/otp_win64_21.3.exe
erlang_installer_path: C:\Users\appveyor\erlang_install.exe
rabbitmq_download_url: https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.4/rabbitmq-server-3.8.4.exe
rabbitmq_installer_path: C:\Users\appveyor\rabbitmq_install.exe
matrix:
- PYTHON: C:\Python36
cache:
- "%rabbitmq_installer_path%"
install:
#################################
# Download and install RabbitMQ
#################################
- ps: |
Write-Host "Uninstalling existing erlang installs"
Get-Package -Provider Programs -IncludeWindowsInstaller -Name '*erlang*' |% { & $_.Meta.Attributes["UninstallString"] /S }
if (-Not (Test-Path "$env:erlang_installer_path")) {
Write-Host "Downloading Erlang..."
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-RestMethod -uri "$env:erlang_download_url" -outfile "$env:erlang_installer_path"
} else {
Write-Host "Found" $env:erlang_installer_path "in cache. Not downloading Erlang."
}
Write-Host "Installing Erlang..."
Start-Process "$env:erlang_installer_path" -ArgumentList /S -NoNewWindow -Wait
- ps: |
if (-Not (Test-Path "$env:rabbitmq_installer_path")) {
Write-Host "Downloading Rabbit..."
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-RestMethod -uri "$env:rabbitmq_download_url" -outfile "$env:rabbitmq_installer_path"
} else {
Write-Host "Found" $env:rabbitmq_installer_path "in cache. Not downloading RabbitMQ."
}
Write-Host "Installing RabbitMQ..."
# Don't wait for rabbitmq installer as it seems to never return when run silently
Start-Process "$env:rabbitmq_installer_path" -ArgumentList /S,/QN -NoNewWindow
for ($attempt=1; $attempt -le 60; $attempt=$attempt+1) {
$status=(Get-Service RabbitMQ).Status
if ("$status" -eq "Running") {
Write-Host "RabbitMQ is running."
Break
} else {
if ("$status" -eq "Stopped") {
Write-Host "Saw RabbitMQ stopped, attempting to start."
Start-Service RabbitMQ
}
Write-Host "Waiting for RabbitMQ to start (Attempt: $attempt, State: $status)..."
Sleep 2
}
}
if ("$status" -ne "Running") {
Write-Host "WARNING: RabbitMQ DID NOT START"
$host.SetShouldExit(1)
}
#################################
# Configure python
#################################
- SET PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%
- python --version
- python -c "import struct; print(struct.calcsize('P') * 8)"
- echo Upgrading pip...
- python -m pip install --upgrade pip==9.0.1
- pip --version
build: false # Not a C# project, build stuff at the test step instead.
before_test:
- echo Installing dependencies
- virtualenv venv
- venv\Scripts\python.exe -m pip install -r requirements.txt
- venv\Scripts\python.exe -m pip install -r test-requirements.txt
- venv\Scripts\python.exe -m pip install -U .
test_script:
- venv\Scripts\pytest.exe -sv --run-ci-tests --run-rabbit-tests cloudify_agent\tests