Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use mage target instead of nosetests on Windows jenkins CI #16141

Merged
merged 20 commits into from
Feb 11, 2020
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions dev-tools/jenkins_ci.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ $packages = ($packages|group|Select -ExpandProperty Name) -join ","
exec { go test -race -c -cover -covermode=atomic -coverpkg $packages } "go test -race -cover FAILURE"

if (Test-Path "tests\system") {
Set-Location -Path tests\system
exec { nosetests --with-timer --with-xunit --xunit-file=../../build/TEST-system.xml } "System test FAILURE"
echo "Running python tests"
choco install python -y -r --no-progress --version 3.8.1.20200110
refreshenv
$env:PATH = "C:\Python38;C:\Python38\Scripts;$env:PATH"
python --version
exec { mage pythonUnitTest } "System test FAILURE"
Copy link
Member Author

@jsoriano jsoriano Feb 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Command executed by pythonUnitTest is:

exec: <...>/github.com/elastic/beats/build/ve/linux/bin/nosetests --process-timeout=90 --with-timer -v --with-xunit --xunit-file=build/TEST-python-unit.xml <...>

}
3 changes: 1 addition & 2 deletions filebeat/tests/open-file-handlers/log_stdout.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from past.utils import old_div
import time
import sys

Expand All @@ -19,5 +18,5 @@
# Setup python log handler
handler = logging.handlers.RotatingFileHandler(
log_file, maxBytes=line_length * lines_per_file + 1,
backupCount=old_div(total_lines, lines_per_file) + 1)
backupCount=int(total_lines/lines_per_file) + 1)
logger.addHandler(handler)
2 changes: 1 addition & 1 deletion filebeat/tests/system/test_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ def test_utf8(self):
lambda: self.output_has(lines=1), max_timeout=10)

# Append utf-8 chars to check if it keeps reading
with codecs.open(testfile, "a") as f:
with codecs.open(testfile, "a", "utf-8") as f:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utf_8 is the name of the codec in Python. utf-8 is an alias name. I think I used utf_8 in other places. So to prevent having a mix of "utf-8" and "utf_8" can you change this to utf_8.

# write additional lines
f.write("Hello\n")
f.write("薩科Ruflin" + "\n")
Expand Down
3 changes: 1 addition & 2 deletions filebeat/tests/system/test_load.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from past.utils import old_div
from filebeat import BaseTest
import os
import logging
Expand Down Expand Up @@ -41,7 +40,7 @@ def test_no_missing_events(self):
# Setup python log handler
handler = logging.handlers.RotatingFileHandler(
log_file, maxBytes=line_length * lines_per_file + 1,
backupCount=old_div(total_lines, lines_per_file) + 1)
backupCount=int(total_lines / lines_per_file) + 1)
logger.addHandler(handler)

self.render_config_template(
Expand Down
2 changes: 2 additions & 0 deletions heartbeat/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ import (
"github.com/elastic/beats/dev-tools/mage/target/common"
// mage:import
_ "github.com/elastic/beats/dev-tools/mage/target/integtest/notests"
// mage:import
_ "github.com/elastic/beats/dev-tools/mage/target/unittest"
)

func init() {
Expand Down
2 changes: 2 additions & 0 deletions journalbeat/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ import (
"github.com/elastic/beats/dev-tools/mage/target/common"
// mage:import
_ "github.com/elastic/beats/dev-tools/mage/target/integtest/notests"
// mage:import
_ "github.com/elastic/beats/dev-tools/mage/target/unittest"
)

func init() {
Expand Down
2 changes: 2 additions & 0 deletions libbeat/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import (

// mage:import
_ "github.com/elastic/beats/dev-tools/mage/target/common"
// mage:import
_ "github.com/elastic/beats/dev-tools/mage/target/unittest"
)

// Build builds the Beat binary.
Expand Down
1 change: 0 additions & 1 deletion libbeat/tests/system/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ dockerpty==0.4.1
docopt==0.6.2
elasticsearch==7.1.0
enum34==1.1.6
future==0.18.2
idna==2.6
ipaddress==1.0.19
Jinja2==2.10.1
Expand Down
1 change: 0 additions & 1 deletion script/kibana-migration.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from past.builtins import basestring
import yaml
import glob

Expand Down
1 change: 0 additions & 1 deletion script/renamed_fields.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from past.builtins import basestring
import yaml


Expand Down
2 changes: 2 additions & 0 deletions x-pack/libbeat/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import (
_ "github.com/elastic/beats/dev-tools/mage/target/common"
// mage:import
_ "github.com/elastic/beats/dev-tools/mage/target/integtest"
// mage:import
_ "github.com/elastic/beats/dev-tools/mage/target/unittest"
)

func init() {
Expand Down