-
Notifications
You must be signed in to change notification settings - Fork 56
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
Add compatibility test #337
Merged
+83
−0
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Copyright (c) 2024 Contributors to COVESA | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Mozilla Public License 2.0 which is available at | ||
# https://www.mozilla.org/en-US/MPL/2.0/ | ||
# | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
import pytest | ||
import os | ||
|
||
|
||
@pytest.fixture | ||
def change_test_dir(request, monkeypatch): | ||
# To make sure we run from test directory | ||
monkeypatch.chdir(request.fspath.dirname) | ||
|
||
|
||
# Test all VSS versions we support | ||
# | ||
# Intended workflow: | ||
# | ||
# ---------- After a new VSS release ----------------- | ||
# | ||
# * Add the new tag to this test case | ||
# * Update compatibility section in README | ||
# | ||
# ----------- If this test case fails ----------------- | ||
# | ||
# * Check if we can add backward compatibility with limited effort | ||
# * If not add limitation to compatibility section in README and remove ' | ||
# unsupported versions from the test case | ||
# | ||
@pytest.mark.parametrize("tag", | ||
[ | ||
'v4', | ||
'v4.0', | ||
'v4.1']) | ||
def test_compatibility(tag, change_test_dir): | ||
""" | ||
Test that we still can analyze wanted versions without error | ||
""" | ||
|
||
os.system("rm -rf vehicle_signal_specification") | ||
os.system("git clone --depth 1 --branch " + tag + | ||
" https://github.com/COVESA/vehicle_signal_specification") | ||
|
||
result = os.system("../../vspec2json.py --json-pretty " | ||
"vehicle_signal_specification/spec/VehicleSignalSpecification.vspec " | ||
"out.json 1>out.txt 2>&1") | ||
os.system("cat out.txt") | ||
assert os.WIFEXITED(result) | ||
assert os.WEXITSTATUS(result) == 0 | ||
|
||
os.system("cd ..") | ||
os.system("rm -rf vehicle_signal_specification") |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we remember to come update this for every release?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What we could do is to mention it in:
https://github.com/COVESA/vss-tools/wiki/Release-Instructions-and-Checklist
https://github.com/COVESA/vehicle_signal_specification/wiki/Release-Instructions-and-Checklist
I.e. update it as part of release preparation.