1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-10-23 09:09:01 +03:00

spit output to stderr when extracting GPU tests for PRs (#14847)

* update

* don't use xdist during gpu tests in PRs.

* Revert "update"

This reverts commit 0906d05c8b.

* fix(ci): harden GitHub Actions workflows (#14847) (#14849)

fix(ci): harden workflow files flagged on #14847

Co-authored-by: hf-security-analysis[bot] <265538906+hf-security-analysis[bot]@users.noreply.github.com>

* redirect to stderr

---------

Co-authored-by: DN6 <dhruv.nair@gmail.com>
Co-authored-by: hf-security-analysis[bot] <265538906+hf-security-analysis[bot]@users.noreply.github.com>
This commit is contained in:
Sayak Paul
2026-09-30 10:47:09 +05:30
committed by GitHub
parent 56aa3cd669
commit 031b2798ad

View File

@@ -1,6 +1,7 @@
import argparse
import inspect
import sys
from contextlib import redirect_stdout
from pathlib import Path
from typing import List, Type
@@ -41,35 +42,36 @@ def generate_pattern_for_mixins(mixin_classes: List[Type]) -> str:
if __name__ == "__main__":
mixin_classes = []
if args.type == "pipeline":
from tests.pipelines.test_pipelines_common import PipelineTesterMixin
with redirect_stdout(sys.stderr):
mixin_classes = []
if args.type == "pipeline":
from tests.pipelines.test_pipelines_common import PipelineTesterMixin
mixin_classes = [PipelineTesterMixin]
mixin_classes = [PipelineTesterMixin]
elif args.type == "models":
# The model tester suite is split across several mixins under `tests/models/testing_utils`,
# so aggregate their test methods to reconstruct the full coverage.
from tests.models.testing_utils import (
AttentionTesterMixin,
LoraTesterMixin,
MemoryTesterMixin,
ModelTesterMixin,
TrainingTesterMixin,
)
elif args.type == "models":
# The model tester suite is split across several mixins under `tests/models/testing_utils`,
# so aggregate their test methods to reconstruct the full coverage.
from tests.models.testing_utils import (
AttentionTesterMixin,
LoraTesterMixin,
MemoryTesterMixin,
ModelTesterMixin,
TrainingTesterMixin,
)
mixin_classes = [
ModelTesterMixin,
MemoryTesterMixin,
TrainingTesterMixin,
AttentionTesterMixin,
LoraTesterMixin,
]
mixin_classes = [
ModelTesterMixin,
MemoryTesterMixin,
TrainingTesterMixin,
AttentionTesterMixin,
LoraTesterMixin,
]
elif args.type == "lora":
from tests.lora.utils import PeftLoraLoaderMixinTests
elif args.type == "lora":
from tests.lora.utils import PeftLoraLoaderMixinTests
mixin_classes = [PeftLoraLoaderMixinTests]
mixin_classes = [PeftLoraLoaderMixinTests]
pattern = generate_pattern_for_mixins(mixin_classes)
pattern = generate_pattern_for_mixins(mixin_classes)
print(pattern)