Skip to content

Commit

Permalink
Merge pull request #12 from demianzhang/master
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
demianzhang authored Apr 6, 2019
2 parents ee2bc29 + 65cc094 commit 768cebf
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 6 deletions.
14 changes: 8 additions & 6 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ $install_yarn = $TRUE
$PIP_INSTALL = "python -m pip install ."

# nodejs
$nodeUrl = "https://aka.ms/nni/nodejs-download/win64"
$version = "10.15.1"
$nodeUrl = "https://nodejs.org/dist/v10.15.1/node-v10.15.1-win-x64.zip"
$yarnUrl = "https://yarnpkg.com/latest.tar.gz"
$unzipNodeDir = "node-v$version-win-x64"

$NNI_DEPENDENCY_FOLDER = "C:\tmp\$env:USERNAME"

Expand All @@ -31,7 +33,7 @@ $NNI_PKG_FOLDER = $NNI_PYTHON3 +"\nni"
if(!(Test-Path $NNI_DEPENDENCY_FOLDER)){
New-Item $NNI_DEPENDENCY_FOLDER -ItemType Directory
}
$NNI_NODE_TARBALL = $NNI_DEPENDENCY_FOLDER+"\nni-node.tar.gz"
$NNI_NODE_ZIP = $NNI_DEPENDENCY_FOLDER+"\nni-node.zip"
$NNI_NODE_FOLDER = $NNI_DEPENDENCY_FOLDER+"\nni-node"
$NNI_YARN_TARBALL = $NNI_DEPENDENCY_FOLDER+"\nni-yarn.tar.gz"
$NNI_YARN_FOLDER = $NNI_DEPENDENCY_FOLDER+"\nni-yarn"
Expand All @@ -41,7 +43,7 @@ $NNI_YARN = $NNI_YARN_FOLDER +"\bin\yarn"
$NNI_VERSION_VALUE = $(git describe --tags)
$NNI_VERSION_TEMPLATE = "999.0.0-developing"

if(!(Test-Path $NNI_NODE_TARBALL)){
if(!(Test-Path $NNI_NODE_ZIP)){
Write-Host "Downloading Node..."
(New-Object Net.WebClient).DownloadFile($nodeUrl, $NNI_NODE_ZIP)
}
Expand All @@ -56,8 +58,8 @@ if ($install_node) {
if(Test-Path $NNI_NODE_FOLDER){
Remove-Item $NNI_NODE_FOLDER -Recurse -Force
}
New-Item $NNI_NODE_FOLDER -ItemType Directory
cmd /c tar -xf $NNI_NODE_TARBALL -C $NNI_NODE_FOLDER --strip-components 1
Expand-Archive $NNI_NODE_ZIP -DestinationPath $NNI_DEPENDENCY_FOLDER
Rename-Item "$NNI_DEPENDENCY_FOLDER\$unzipNodeDir" "nni-node"

### yarn install
if(Test-Path $NNI_YARN_FOLDER){
Expand Down Expand Up @@ -122,4 +124,4 @@ $PKG_JSON = $NNI_PKG_FOLDER+"\package.json"
(Get-Content $PKG_JSON).replace($NNI_VERSION_TEMPLATE, $NNI_VERSION_VALUE) | Set-Content $PKG_JSON
cmd /c $NNI_YARN --prod --cwd $NNI_PKG_FOLDER
$NNI_PKG_FOLDER_STATIC = $NNI_PKG_FOLDER+"\static"
Copy-Item "src\webui\build" $NNI_PKG_FOLDER_STATIC -Recurse
Copy-Item "src\webui\build" $NNI_PKG_FOLDER_STATIC -Recurse
27 changes: 27 additions & 0 deletions test/unittest.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
$CWD = $PWD

# -------------For python unittest-------------

## ------Run annotation test------
echo ""
echo "===========================Testing: nni_annotation==========================="
cd $CWD/../tools/
python -m unittest -v nni_annotation/test_annotation.py

## Export certain environment variables for unittest code to work
$env:NNI_TRIAL_JOB_ID="test_trial_job_id"
$env:NNI_PLATFORM="unittest"

## ------Run sdk test------
echo ""
echo "===========================Testing: nni_sdk==========================="
cd $CWD/../src/sdk/pynni/
python -m unittest discover -v tests



# -------------For typescript unittest-------------
cd $CWD/../src/nni_manager
echo ""
echo "===========================Testing: nni_manager==========================="
npm run test

0 comments on commit 768cebf

Please sign in to comment.