-
-
Notifications
You must be signed in to change notification settings - Fork 782
Use python imports to identify fixtures (part 4/6) #5704
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
Changes from all commits
c0a624f
e9714a2
ec78bef
8283904
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -13,4 +13,5 @@ | |||
| # limitations under the License. | ||||
| from st2tests import fixturesloader | ||||
|
|
||||
| PACK_NAME, PACK_PATH = fixturesloader.get_fixture_name_and_path(__file__) | ||||
| PACK_NAME = "dummy_pack_10_wrong_deps" | ||||
| PACK_DIR_NAME, PACK_PATH = fixturesloader.get_fixture_name_and_path(__file__) | ||||
|
Comment on lines
+16
to
+17
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -13,4 +13,5 @@ | |||
| # limitations under the License. | ||||
| from st2tests import fixturesloader | ||||
|
|
||||
| PACK_NAME, PACK_PATH = fixturesloader.get_fixture_name_and_path(__file__) | ||||
| PACK_NAME = "dummy pack 14" | ||||
| PACK_DIR_NAME, PACK_PATH = fixturesloader.get_fixture_name_and_path(__file__) | ||||
|
Comment on lines
+16
to
+17
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # Copyright 2022 The StackStorm Authors. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| from st2tests import fixturesloader | ||
|
|
||
| PACK_NAME, PACK_PATH = fixturesloader.get_fixture_name_and_path(__file__) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one did not need special vars. Instead, it needed special handling in one of the tests that counted the number of files in the pack. |
||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -13,4 +13,5 @@ | |||
| # limitations under the License. | ||||
| from st2tests import fixturesloader | ||||
|
|
||||
| PACK_NAME, PACK_PATH = fixturesloader.get_fixture_name_and_path(__file__) | ||||
| PACK_NAME = "Dummy Pack 18" | ||||
| PACK_DIR_NAME, PACK_PATH = fixturesloader.get_fixture_name_and_path(__file__) | ||||
|
Comment on lines
+16
to
+17
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -0,0 +1,17 @@ | ||||
| # Copyright 2022 The StackStorm Authors. | ||||
| # | ||||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| # you may not use this file except in compliance with the License. | ||||
| # You may obtain a copy of the License at | ||||
| # | ||||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||||
| # | ||||
| # Unless required by applicable law or agreed to in writing, software | ||||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
| # See the License for the specific language governing permissions and | ||||
| # limitations under the License. | ||||
| from st2tests import fixturesloader | ||||
|
|
||||
| PACK_NAME = "dummy_pack_7_name" | ||||
| PACK_DIR_NAME, PACK_PATH = fixturesloader.get_fixture_name_and_path(__file__) | ||||
|
Comment on lines
+16
to
+17
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -13,4 +13,5 @@ | |||
| # limitations under the License. | ||||
| from st2tests import fixturesloader | ||||
|
|
||||
| PACK_NAME, PACK_PATH = fixturesloader.get_fixture_name_and_path(__file__) | ||||
| PACK_NAME = "Dummy Pack 8 Invalid Name" | ||||
| PACK_DIR_NAME, PACK_PATH = fixturesloader.get_fixture_name_and_path(__file__) | ||||
|
Comment on lines
+16
to
+17
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -0,0 +1,17 @@ | ||||
| # Copyright 2022 The StackStorm Authors. | ||||
| # | ||||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| # you may not use this file except in compliance with the License. | ||||
| # You may obtain a copy of the License at | ||||
| # | ||||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||||
| # | ||||
| # Unless required by applicable law or agreed to in writing, software | ||||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
| # See the License for the specific language governing permissions and | ||||
| # limitations under the License. | ||||
| from st2tests import fixturesloader | ||||
|
|
||||
| PACK_NAME = "dummy_pack_9_deps" | ||||
| PACK_DIR_NAME, PACK_PATH = fixturesloader.get_fixture_name_and_path(__file__) | ||||
|
Comment on lines
+16
to
+17
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,17 @@ | ||||||
| # Copyright 2022 The StackStorm Authors. | ||||||
| # | ||||||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
| # you may not use this file except in compliance with the License. | ||||||
| # You may obtain a copy of the License at | ||||||
| # | ||||||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||||||
| # | ||||||
| # Unless required by applicable law or agreed to in writing, software | ||||||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||||||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||
| # See the License for the specific language governing permissions and | ||||||
| # limitations under the License. | ||||||
| from st2tests import fixturesloader | ||||||
|
|
||||||
| PACK_NAME = "pack_name_not_the_same_as_dir_name" | ||||||
| PACK_DIR_NAME, PACK_PATH = fixturesloader.get_fixture_name_and_path(__file__) | ||||||
|
Comment on lines
+16
to
+17
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. st2/st2tests/st2tests/fixtures/packs/pack_dir_name_doesnt_match_ref/pack.yaml Lines 1 to 2 in 6db0561
|
||||||
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 does this change?
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.
The pack in question only had
pack.yamlbefore this PR. I addedfixture.pyand__init__.py, so the file count goes up to 3.And, since there is more than one file, we can't just assume that the
resp.json[0]is thepack.yamlfile. But is it[1]or[2]? It's hard to say because the order might depend on the the filesystem. I triedresp.json[2]which on GHA was notpack.yaml, so they are not sorted alphabetically. To avoid a flaky test relying on a particular sort, I made a list of the files with[f["file_path"] for f in resp.json], and just assert thatpack.yamlis in it.