Skip to content

Commit 7ea7d8f

Browse files
authored
[pdh] use libs provided in toolkit (#3691)
* [pdh] use wheel for shared PDH module * [travis] pull core to build wheel * [appveyor] pull integrations-core for PDH/WMI testing if necessary * [win32] its better if we import the right class * [appveyor] dos2unix yaml * [travis] add note regarding imminent name change for datadog-checks-base * [ci] datadog-checks-base renamed to datadog_checks_base * [gitignore] adding rbenv to gitignore * [ci][skip ci] restoring integrations-core branch to `master`
1 parent cb3e576 commit 7ea7d8f

File tree

9 files changed

+67
-423
lines changed

9 files changed

+67
-423
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ tests/core/fixtures/flare/dd*
3939
.python-version
4040
.ropeproject
4141
.bundle
42+
.rbenv*
4243
.idea
4344
tags
4445

.travis.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ cache:
1414
- $HOME/virtualenv/python$TRAVIS_PYTHON_VERSION.9
1515
- vendor/cache
1616
- $HOME/embedded
17+
- $HOME/integrations-core
1718

1819
matrix:
1920
fast_finish: true
@@ -27,6 +28,7 @@ env:
2728
- PIP_CACHE=$HOME/.cache/pip
2829
- VOLATILE_DIR=/tmp
2930
- DD_CASHER_DIR=/tmp/casher
31+
- INTEGRATIONS_CORE_BRANCH=master
3032
matrix:
3133
- TRAVIS_FLAVOR=default
3234
- TRAVIS_FLAVOR=checks_mock
@@ -42,8 +44,10 @@ matrix:
4244
# Override travis defaults with empty jobs
4345
before_install:
4446
- rvm install 2.1.5
45-
# before_install: echo "OVERRIDING TRAVIS STEPS"
46-
install: echo "OVERRIDING TRAVIS STEPS"
47+
48+
install:
49+
- git -C $HOME/integrations-core pull || git clone -b $INTEGRATIONS_CORE_BRANCH --depth 1 https://github.com/DataDog/integrations-core.git $HOME/integrations-core
50+
- cd $HOME/integrations-core/datadog_checks_base && python setup.py bdist_wheel && pip install . && cd -
4751
before_script: echo "OVERRIDING TRAVIS STEPS"
4852

4953
script:

appveyor.yml

Lines changed: 57 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,57 @@
1-
version: '{branch}.{build}'
2-
shallow_clone: true
3-
environment:
4-
TRAVIS_BUILD_DIR: c:\projects\dd-agent
5-
INTEGRATIONS_DIR: c:\projects\dd-agent\embedded
6-
CHECKSD_OVERRIDE: c:\projects\dd-agent\tests\checks\fixtures\checks
7-
PIP_CACHE: c:\projects\dd-agent\.cache\pip
8-
VOLATILE_DIR: c:\projects
9-
NOSE_FILTER: not unix and not fixme
10-
PYWIN_PATH: C:\projects\dd-agent\.cache\pywin32-py2.7.exe
11-
SKIP_LINT: true
12-
matrix:
13-
- PYTHON: C:\\Python27
14-
PYTHON_VERSION: 2.7.9
15-
PYTHON_ARCH: 32
16-
PYWIN32_URL: https://downloads.sourceforge.net/project/pywin32/pywin32/Build%20219/pywin32-219.win32-py2.7.exe
17-
PYWIN32_INSTALL_DIR: pywin32-219-py2.7-win32.egg
18-
- PYTHON: C:\\Python27-x64
19-
PYTHON_VERSION: 2.7.9
20-
PYTHON_ARCH: 64
21-
PYWIN32_URL: http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/pywin32-219.win-amd64-py2.7.exe/download
22-
PYWIN32_INSTALL_DIR: pywin32-219-py2.7-win-amd64.egg
23-
cache:
24-
- C:\projects\dd-agent\.cache
25-
- C:\projects\dd-agent\vendor\cache
26-
- C:\projects\dd-agent\embedded
27-
services:
28-
- iis
29-
# - mssql2008r2sp2 # FIXME: re-enable when we can launch multiple mssql instances at once
30-
- mssql2012sp1
31-
# - mssql2014 # FIXME: re-enable when we can launch multiple mssql instances at once
32-
install:
33-
# Use the 64-bit ruby so that all the Powershell classes are accessible when running shell commands from ruby
34-
- set PATH=C:\Ruby22-x64\bin;%PATH%
35-
# If bundler is already install '--conservative' will avoid upgrading gems who already meet the version requirement (and avoid conflicts)
36-
- gem install bundler --conservative --quiet --no-ri --no-rdoc
37-
- bundle install
38-
- bundle package
39-
- if not exist %PIP_CACHE% mkdir %PIP_CACHE%
40-
- ps: If (-Not (Test-Path $env:PYWIN_PATH)) {(new-object net.webclient).DownloadFile("$env:PYWIN32_URL", "$env:PYWIN_PATH")}
41-
- "%PYTHON%/Scripts/easy_install.exe %PYWIN_PATH%"
42-
# Remove the adodbapi module shipped with pywin32: it conflicts with the pip-installed adodbapi
43-
- ps: rm $env:PYTHON/lib/site-packages/$env:PYWIN32_INSTALL_DIR/adodbapi/__init__.py
44-
- ps: rm $env:PYTHON/lib/site-packages/$env:PYWIN32_INSTALL_DIR/adodbapi/__init__.pyc
45-
build: off
46-
test_script:
47-
- set PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%
48-
- bundle exec rake ci:run[default]
49-
- bundle exec rake ci:run[core_integration]
50-
- bundle exec rake ci:run[windows]
1+
version: '{branch}.{build}'
2+
shallow_clone: true
3+
environment:
4+
TRAVIS_BUILD_DIR: c:\projects\dd-agent
5+
INTEGRATIONS_DIR: c:\projects\dd-agent\embedded
6+
CHECKSD_OVERRIDE: c:\projects\dd-agent\tests\checks\fixtures\checks
7+
PIP_CACHE: c:\projects\dd-agent\.cache\pip
8+
VOLATILE_DIR: c:\projects
9+
NOSE_FILTER: not unix and not fixme
10+
PYWIN_PATH: C:\projects\dd-agent\.cache\pywin32-py2.7.exe
11+
SKIP_LINT: true
12+
INTEGRATIONS_CORE_BRANCH: master
13+
matrix:
14+
- PYTHON: C:\\Python27
15+
PYTHON_VERSION: 2.7.9
16+
PYTHON_ARCH: 32
17+
PYWIN32_URL: https://downloads.sourceforge.net/project/pywin32/pywin32/Build%20219/pywin32-219.win32-py2.7.exe
18+
PYWIN32_INSTALL_DIR: pywin32-219-py2.7-win32.egg
19+
- PYTHON: C:\\Python27-x64
20+
PYTHON_VERSION: 2.7.9
21+
PYTHON_ARCH: 64
22+
PYWIN32_URL: http://sourceforge.net/projects/pywin32/files/pywin32/Build%20219/pywin32-219.win-amd64-py2.7.exe/download
23+
PYWIN32_INSTALL_DIR: pywin32-219-py2.7-win-amd64.egg
24+
cache:
25+
- C:\projects\dd-agent\.cache
26+
- C:\projects\dd-agent\vendor\cache
27+
- C:\projects\dd-agent\embedded
28+
services:
29+
- iis
30+
# - mssql2008r2sp2 # FIXME: re-enable when we can launch multiple mssql instances at once
31+
- mssql2012sp1
32+
# - mssql2014 # FIXME: re-enable when we can launch multiple mssql instances at once
33+
install:
34+
# Use the 64-bit ruby so that all the Powershell classes are accessible when running shell commands from ruby
35+
- set PATH=C:\Ruby22-x64\bin;%PATH%
36+
# If bundler is already install '--conservative' will avoid upgrading gems who already meet the version requirement (and avoid conflicts)
37+
- gem install bundler --conservative --quiet --no-ri --no-rdoc
38+
- bundle install
39+
- bundle package
40+
- git clone -b %INTEGRATIONS_CORE_BRANCH% https://github.com/DataDog/integrations-core.git c:\projects\integrations-core
41+
- if not exist %PIP_CACHE% mkdir %PIP_CACHE%
42+
- ps: If (-Not (Test-Path $env:PYWIN_PATH)) {(new-object net.webclient).DownloadFile("$env:PYWIN32_URL", "$env:PYWIN_PATH")}
43+
- "%PYTHON%/Scripts/easy_install.exe %PYWIN_PATH%"
44+
# Remove the adodbapi module shipped with pywin32: it conflicts with the pip-installed adodbapi
45+
- ps: rm $env:PYTHON/lib/site-packages/$env:PYWIN32_INSTALL_DIR/adodbapi/__init__.py
46+
- ps: rm $env:PYTHON/lib/site-packages/$env:PYWIN32_INSTALL_DIR/adodbapi/__init__.pyc
47+
- ps: (& "$env:PYTHON/Scripts/pip.exe" install wheel)
48+
- cd c:\projects\integrations-core\datadog_checks_base
49+
- ps: (& "$env:PYTHON/python.exe" setup.py bdist_wheel)
50+
- ps: (& "$env:PYTHON/Scripts/pip.exe" install .)
51+
- cd %TRAVIS_BUILD_DIR%
52+
build: off
53+
test_script:
54+
- set PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%
55+
- bundle exec rake ci:run[default]
56+
- bundle exec rake ci:run[core_integration]
57+
- bundle exec rake ci:run[windows]

checks/libs/win/__init__.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

checks/libs/win/pdhbasecheck.py

Lines changed: 0 additions & 149 deletions
This file was deleted.

0 commit comments

Comments
 (0)