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

Move windows tests from azure to github actions #3255

Merged
merged 5 commits into from
Oct 24, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
15 changes: 10 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ jobs:
- {name: Linux, python: 3.6, os: ubuntu-20.04, tox: 'py36-linux'}
- {name: Linux, python: 3.7, os: ubuntu-20.04, tox: 'py37-linux'}
- {name: Linux, python: 3.8, os: ubuntu-20.04, tox: 'py38-linux'}
- {name: Windows, python: 3.6, os: windows-2019, tox: 'py36-win'}
- {name: Windows, python: 3.7, os: windows-2019, tox: 'py37-win'}
- {name: Windows, python: 3.8, os: windows-2019, tox: 'py38-win'}
env:
TOX_PARALLEL_NO_SPINNER: 1

Expand All @@ -38,23 +41,25 @@ jobs:
# https://www.scala-sbt.org/1.x/docs/Installing-sbt-on-Linux.html
#
- name: Update sbt
if: matrix.os == 'ubuntu-20.04'
run: |
echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list
echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee /etc/apt/sources.list.d/sbt_old.list
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add
sudo apt-get update -y
sudo apt-get install -y sbt
- name: Install tox, gdb
- name: Install tox
run: pip install tox
- name: Install GDB & enable core dumps
if: matrix.os == 'ubuntu-20.04'
run: |
pip install tox
sudo apt-get update -y
sudo apt-get install -y gdb
- name: Enable core dumps
run: ulimit -c unlimited -S # enable core dumps
ulimit -c unlimited -S # enable core dumps
- name: Run tox tests
run: tox -e ${{ matrix.tox }}
- name: Collect corefile
if: ${{ failure() }}
if: ${{ failure() }} && matrix.os == 'ubuntu-20.04'
run: |
pwd
COREFILE=$(find . -maxdepth 1 -name "core*" | head -n 1)
Expand Down
32 changes: 0 additions & 32 deletions azure-pipelines.yml

This file was deleted.

20 changes: 10 additions & 10 deletions gensim/test/test_corpora.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from gensim.test.utils import datapath, get_tmpfile, common_corpus


AZURE = bool(os.environ.get('PIPELINE_WORKSPACE'))
GITHUB_ACTIONS_WINDOWS = os.environ.get('RUNNER_OS') == 'Windows'


class DummyTransformer:
Expand Down Expand Up @@ -62,7 +62,7 @@ def tearDown(self):
except OSError:
pass

@unittest.skipIf(AZURE, 'see <https://github.com/RaRe-Technologies/gensim/pull/2836>')
@unittest.skipIf(GITHUB_ACTIONS_WINDOWS, 'see <https://github.com/RaRe-Technologies/gensim/pull/2836>')
def test_load(self):
fname = datapath('testcorpus.' + self.file_extension.lstrip('.'))
corpus = self.corpus_class(fname)
Expand All @@ -71,7 +71,7 @@ def test_load(self):
# the deerwester corpus always has nine documents
self.assertEqual(len(docs), 9)

@unittest.skipIf(AZURE, 'see <https://github.com/RaRe-Technologies/gensim/pull/2836>')
@unittest.skipIf(GITHUB_ACTIONS_WINDOWS, 'see <https://github.com/RaRe-Technologies/gensim/pull/2836>')
def test_len(self):
fname = datapath('testcorpus.' + self.file_extension.lstrip('.'))
corpus = self.corpus_class(fname)
Expand All @@ -87,7 +87,7 @@ def test_len(self):

self.assertEqual(len(corpus), 9)

@unittest.skipIf(AZURE, 'see <https://github.com/RaRe-Technologies/gensim/pull/2836>')
@unittest.skipIf(GITHUB_ACTIONS_WINDOWS, 'see <https://github.com/RaRe-Technologies/gensim/pull/2836>')
def test_empty_input(self):
tmpf = get_tmpfile('gensim_corpus.tst')
with open(tmpf, 'w') as f:
Expand All @@ -102,7 +102,7 @@ def test_empty_input(self):
docs = list(corpus)
self.assertEqual(len(docs), 0)

@unittest.skipIf(AZURE, 'see <https://github.com/RaRe-Technologies/gensim/pull/2836>')
@unittest.skipIf(GITHUB_ACTIONS_WINDOWS, 'see <https://github.com/RaRe-Technologies/gensim/pull/2836>')
def test_save(self):
corpus = self.TEST_CORPUS
tmpf = get_tmpfile('gensim_corpus.tst')
Expand All @@ -114,7 +114,7 @@ def test_save(self):
corpus2 = list(self.corpus_class(tmpf))
self.assertEqual(corpus, corpus2)

@unittest.skipIf(AZURE, 'see <https://github.com/RaRe-Technologies/gensim/pull/2836>')
@unittest.skipIf(GITHUB_ACTIONS_WINDOWS, 'see <https://github.com/RaRe-Technologies/gensim/pull/2836>')
def test_serialize(self):
corpus = self.TEST_CORPUS
tmpf = get_tmpfile('gensim_corpus.tst')
Expand All @@ -136,7 +136,7 @@ def test_serialize(self):
idx = [1, 3, 5, 7]
self.assertEqual(corpus[idx], corpus2[idx])

@unittest.skipIf(AZURE, 'see <https://github.com/RaRe-Technologies/gensim/pull/2836>')
@unittest.skipIf(GITHUB_ACTIONS_WINDOWS, 'see <https://github.com/RaRe-Technologies/gensim/pull/2836>')
def test_serialize_compressed(self):
corpus = self.TEST_CORPUS
tmpf = get_tmpfile('gensim_corpus.tst')
Expand All @@ -154,7 +154,7 @@ def test_serialize_compressed(self):
for i in range(len(corpus)):
self.assertEqual(corpus[i], corpus2[i])

@unittest.skipIf(AZURE, 'see <https://github.com/RaRe-Technologies/gensim/pull/2836>')
@unittest.skipIf(GITHUB_ACTIONS_WINDOWS, 'see <https://github.com/RaRe-Technologies/gensim/pull/2836>')
def test_switch_id2word(self):
fname = datapath('testcorpus.' + self.file_extension.lstrip('.'))
corpus = self.corpus_class(fname)
Expand All @@ -172,7 +172,7 @@ def test_switch_id2word(self):
testdoc2 = set((to_unicode(corpus.id2word[x]), y) for x, y in firstdoc2)
self.assertEqual(testdoc2, {('computer', 1), ('human', 1), ('interface', 1)})

@unittest.skipIf(AZURE, 'see <https://github.com/RaRe-Technologies/gensim/pull/2836>')
@unittest.skipIf(GITHUB_ACTIONS_WINDOWS, 'see <https://github.com/RaRe-Technologies/gensim/pull/2836>')
def test_indexing(self):
fname = datapath('testcorpus.' + self.file_extension.lstrip('.'))
corpus = self.corpus_class(fname)
Expand Down Expand Up @@ -245,7 +245,7 @@ def test_closed_file_object(self):
self.assertEqual(f, 0)
self.assertEqual(s, 0)

@unittest.skipIf(AZURE, 'see <https://github.com/RaRe-Technologies/gensim/pull/2836>')
@unittest.skipIf(GITHUB_ACTIONS_WINDOWS, 'see <https://github.com/RaRe-Technologies/gensim/pull/2836>')
def test_load(self):
self.assertEqual(self.corpus.num_docs, 9)
self.assertEqual(self.corpus.num_terms, 12)
Expand Down
4 changes: 2 additions & 2 deletions gensim/test/test_ldamodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from gensim.test import basetmtests
from gensim.test.utils import datapath, get_tmpfile, common_texts

AZURE = bool(os.environ.get('PIPELINE_WORKSPACE'))
GITHUB_ACTIONS_WINDOWS = os.environ.get('RUNNER_OS') == 'Windows'

dictionary = Dictionary(common_texts)
corpus = [dictionary.doc2bow(text) for text in common_texts]
Expand Down Expand Up @@ -232,7 +232,7 @@ def test_get_topic_terms(self):
self.assertTrue(isinstance(k, numbers.Integral))
self.assertTrue(np.issubdtype(v, np.floating))

@unittest.skipIf(AZURE, 'see <https://github.com/RaRe-Technologies/gensim/pull/2836>')
@unittest.skipIf(GITHUB_ACTIONS_WINDOWS, 'see <https://github.com/RaRe-Technologies/gensim/pull/2836>')
def test_get_document_topics(self):

model = self.class_(
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ setenv =
MALLET_HOME={env:MALLET_HOME:}
SKIP_NETWORK_TESTS={env:SKIP_NETWORK_TESTS:}
BOTO_CONFIG={env:BOTO_CONFIG:}
PIPELINE_WORKSPACE={env:PIPELINE_WORKSPACE:}
RUNNER_OS={env:RUNNER_OS:}
PYTHONHASHSEED=1
TOX_PARALLEL_NO_SPINNER=1

Expand Down