Unverified Commit 38e831ca authored by Massimiliano Pippi's avatar Massimiliano Pippi Committed by GitHub

Run tests on Appveyor (#303)

parent b257549b
......@@ -4,7 +4,7 @@ tasks:
protoc:
desc: Compile protobuf definitions
cmds:
- protoc --proto_path=rpc --go_out=plugins=grpc,paths=source_relative:rpc ./rpc/commands/*.proto
- '{{ default "protoc" .PROTOC_BINARY }} --proto_path=rpc --go_out=plugins=grpc,paths=source_relative:rpc ./rpc/commands/*.proto'
build:
desc: Build the project
......@@ -26,7 +26,7 @@ tasks:
desc: Run integration tests only
cmds:
- go test -run Integration {{ default "-v" .GOFLAGS }} -coverprofile=coverage_integ.txt {{ default .DEFAULT_TARGETS .TARGETS }} {{.TEST_LDFLAGS}}
- pytest test/
- pytest test
test-legacy:
desc: Run tests for the `legacy` package
......
build: off
deploy: off
clone_folder: C:\arduino-cli
shallow_clone: true
skip_tags: true
skip_branch_with_pr: true
environment:
GOPATH: c:\gopath
PROTOC_PATH: c:\protoc
PROTOC_BINARY: protoc.exe
# add protoc, gopath and override default Python 2.7
PATH: $(PROTOC_PATH);$(PROTOC_PATH)\bin;$(GOPATH)\bin;C:\Python37;C:\Python37\Scripts;$(PATH)
stack: go 1.12
install:
# install the task executor
- curl -o task.zip -LO https://github.com/go-task/task/releases/download/v2.6.0/task_windows_amd64.zip
- 7z e task.zip -o%GOPATH%\bin
# golang dependencies needed at test time
- go get github.com/golangci/govet
- go get golang.org/x/lint/golint
# Python dependencies needed at test time
- python -V
- pip install -r test\requirements.txt
# protobuf tooling needed at test time. We use a very old version of the compiler
# because of this: https://github.com/protocolbuffers/protobuf/issues/3957
- go get github.com/golang/protobuf/protoc-gen-go
- curl -o protoc.zip -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.4.0/protoc-3.4.0-win32.zip
- 7z e protoc.zip -o%PROTOC_PATH%
test_script:
# Check if the Go code is properly formatted and run the linter
- task.exe check
# Ensure protobufs compile
- task.exe protoc
# re-enable after fixing go tests
# - task.exe test-integration
# build the binary
- task.exe build
# run e2e tests
- pytest test
# uncomment to debug builds
# on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
\ No newline at end of file
......@@ -24,8 +24,7 @@ def data_dir(tmpdir_factory):
A tmp folder will be created before running
the tests and deleted at the end.
"""
fn = tmpdir_factory.mktemp('ArduinoTest')
return fn
return str(tmpdir_factory.mktemp('ArduinoTest'))
@pytest.fixture(scope="session")
......
......@@ -62,7 +62,10 @@ def test_command_lib_search(run_command):
assert number_of_libs == number_of_libs_from_json
@pytest.mark.skipif(os.getenv('APPVEYOR'), reason="Appveyor VMs have no serial ports")
def test_command_board_list(run_command):
result = run_command('core update-index')
assert result.ok
result = run_command('board list --format json')
assert result.ok
# check is a valid json and contains a list of ports
......@@ -73,6 +76,7 @@ def test_command_board_list(run_command):
assert 'protocol_label' in port
@pytest.mark.skipif(os.getenv('APPVEYOR'), reason="Appveyor VMs have no serial ports")
def test_command_board_listall(run_command):
result = run_command('board listall')
assert result.ok
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment