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

Skip integration tests in weekly workflow #9

Merged
merged 2 commits into from
May 21, 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
9 changes: 6 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ workflows:
- master
- main
jobs:
- dwave/test-linux
- dwave/test-osx
- dwave/test-win
- dwave/test-linux:
integration-tests: "canary"
- dwave/test-osx:
integration-tests: "skip"
- dwave/test-win:
integration-tests: "skip"
4 changes: 2 additions & 2 deletions demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def set_up_scenario(w, h, num_poi, num_cs):
""" Build scenario set up with specified parameters. """

G = nx.grid_2d_graph(w, h)
nodes = G.nodes()
nodes = list(G.nodes)

# Identify a fixed set of points of interest
pois = random.sample(nodes, k=num_poi)
Expand All @@ -76,7 +76,7 @@ def set_up_scenario(w, h, num_poi, num_cs):
charging_stations = random.sample(nodes, k=num_cs)

# Identify potential new charging locations
potential_new_cs_nodes = list(nodes - charging_stations)
potential_new_cs_nodes = list(G.nodes() - charging_stations)

return G, pois, charging_stations, potential_new_cs_nodes

Expand Down
11 changes: 7 additions & 4 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,23 @@
import sys
import unittest
import random
import demo

import neal
import numpy as np

project_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
import demo

class TestDemo(unittest.TestCase):
project_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

class TestSmoke(unittest.TestCase):
@unittest.skipIf(os.getenv('SKIP_INT_TESTS'), "Skipping integration test.")
def test_smoke(self):
"""run demo.py and check that nothing crashes"""
"""Run demo.py and check that nothing crashes"""

demo_file = os.path.join(project_dir, 'demo.py')
subprocess.check_output([sys.executable, demo_file])

class TestDemo(unittest.TestCase):
def test_scenario_setup(self):

w, h = random.randint(10,20), random.randint(10,20)
Expand Down