Skip to content

Conversation

@jp-pino
Copy link

@jp-pino jp-pino commented Aug 12, 2025

No description provided.

cricdecyan and others added 30 commits June 23, 2021 16:43
…oogle#983)

Add partial test record upload with a background uploader thread.

Cleanup Add missing typing.Optional type annotations to function parameters.

Fixed parsing of default arguments provided to an OpenHTF phase.

Print the OpenHTF result instead of logging it.

Replace marginal field in mfg-i facing protos with new MARGINAL_PASS test status.

Fix bug causing data to not be uploaded when a ThreadTerminationError occurs.

Marginal pass - Propagate marginal determination to the test run level.

Fix a few bugs with AllInRange and add unit tests

Fix bug with is_marginal check on AllInRange validator

Remove circular dependency between diagnoses_lib and phase_descriptor

Move check_for_duplicate_results to phase_descriptor

Fix and update type annotations in diagnoses_lib

Update protos to output marginal determination upstream and add console coloring for marginal output cases.

Add marginal measurements. See go/openhtf-marginal-pass.

Added useful debugging messages to OpenHTF unit test results when they don't pass.

Add a typing.overload to execute_phase_or_test

Move openhtf.measures to the phase_descriptor module

Added a library to convert OpenHTF objects to strings.

Update built in validators to display the spec limits in the database.

Fix bug where plugs were being updated twice, resulting in tearDown being called.

Update unit test docs to cover TestCase.execute_phase_or_test.

Retry setsockopt when starting up the multicast thread

Add a decorator-free way to write unit tests.

Add capturing of instantiated plugs as an attribute on the test case.

Add get_attachment_or_die method to TestApi

Regenerate units with the latest UNECE publication (rec20_Rev15e-2020.xls).

Raise a clear Error message when a DeviceWrappingPlug is not fully initialized

Fix DUT input phase hung w/ ctrl+c (sigint).

Timeout when getting multicast.send() responses from queue

Add force_repeat option to force a repeat of phase up to the repeat_limit.

Adding the phase name to the phase outcome logging statements.

Fix type of conf when accessed as openhtf.conf

Give 3 retries for timeout phase as default; Add repeat_on_timeout option for phase

Replace phase_group member with either phase_sequence or phases when appropriate.
Add workaround for when AbortTest plug is not initialized (this happens sometimes, but is not easily reproducible).

PiperOrigin-RevId: 381093144
…o GitHub Actions (google#1003)

* Added support for marginal test results to the protos.

* Added continuous integration and deployment via GitHub Action instead of travis-ci.org
[OpenHTF] Ignore the GitHub Actions config file in *..

[OpenHTF] Add util function for getting the phases from a list of phase nodes and phase node collections.

Cleanup (3p) LSC: Remove `Lint as` gpylint comment directives.

Cleanup (3p) LSC: Remove `Lint as` gpylint comment directives.

Support test-stopping failures with a phase-scoped option.

Add an explicit Literal annotation to test_state.INFER_MIMETYPE.

Add get_test_measurement_strict() into test api.

Cleanup Fix or silence upcoming type errors in Python 3.9.

Cleanup LSC: Remove `//net/proto2/python/public:use_pure_python` dep, migrate to protobuf

Cleanup Silence type errors generated by enabling a new pytype feature.

Cleanup Migrate away from Angular's deprecated `async` symbol to use `waitForAsync`

Cleanup Fix or ignore type errors generated by the next release of pytype.

Iteratively upload attachments in when partial uploads are in use

Give mfg_event_converter access to the existing blobref cache

Add a size attribute for Attachments

Cleanup Remove all usages of //third_party/py/enum library.

Cleanup Silence type errors generated by enabling a new pytype feature.

Migrate partial upload code from MfgInspector to *

Add a mechanism to profile unit tests.

Add case formatting options for phase names in OpenHTF Phase Options.

Cleanup Remove unused python binaries + libraries from //third_party/py (as reported dead by sensenmann)

Cleanup Fix or ignore type errors generated by the next release of pytype.

make the mfg_event_converter to handle datetime objects in JSON conversion. (see cl/396863619 for some context)

Cleanup Infer `__init__.py` attributes for Python strict deps.

validators.py: Use f-string to format Equals str representation.

Enable partial upload of attachments from in progress phases

Detect changed attachments (and skip cache) to support OpenHTF_record.json

Rollback of changelist 392091102. Reason: Rollforward of cl/391826358: Reuse existing blob refs in partial_upload by caching protos

Rollback of changelist 391826358. Reason: Seems that these blobrefs are not the correct values to be using at the moment or at least there are occasional issues. See b/197352227 for details.

Reuse existing blob refs in partial_upload by caching protos

Add alternative for conf.inject_positional_args.

Cleanup Fix or ignore type errors generated by the newest pytype release.

Move Configuration (openhtf.conf) class attributes to module attributes

Treat openhtf.util.conf as an object instead of a module

Move Configuration to its own module instead of living in conf

Update typescript web_gui files to remove deprecated bypassSecurityTrustHtml

Remove __init__.py file that was left behind in an otherwise empty package.

Add a protocol and implementation for conf.declare return value.

Cleanup Fix or ignore type errors generated by the next release of pytype.

PiperOrigin-RevId: 450548096
* Removed support for PY2.

* Resolving imports from collections.abc module.

* Use abc.ABC instead of abc.ABCMeta.

* Adding back the line that converts bytes to strings.
The actual change is a secret
* Fix regressions occuring during PY2 deprecation.

* Added parenthesis for readability.
The function docstring says `test_start` can be "Either a trigger phase for starting the test, or a function that returns a DUT ID.`

Unfortunately, when you provide the latter, Mypy is unhappy:
```
Argument "test_start" to "execute" of "Test" has incompatible type "Callable[[], str]"; expected "Union[PhaseDescriptor, Callable[..., Optional[PhaseResult]], None]"  [arg-type]
```

This commit updates the type hint of the parameter to be a Union that reflects the docstring.
…e#991)

StationServer seems to be trying to represent (as base type) phase sequences that don't yet have their plugs initialized. This causes a warning to be logged like
```
WARNING:root:Object <class 'my.custom.htf.Plug'> is not initialized, got error _asdict() missing 1 required positional argument: 'self'
```
But has no other effect.

The call stack when that warning is reached is
```
convert_to_base_types (data.py:176)
<dictcomp> (data.py:199)
convert_to_base_types (data.py:201)
<listcomp> (data.py:204)
convert_to_base_types (data.py:206)
<dictcomp> (data.py:199)
convert_to_base_types (data.py:201)
<listcomp> (station_server.py:364)
get (station_server.py:364)
_execute (web.py:1702)
_run (events.py:145)
_run_once (base_events.py:1451)
run_forever (base_events.py:438)
start (asyncio.py:199)
run (web_gui_server.py:157)
run (station_server.py:626)
_bootstrap_inner (threading.py:916)
_bootstrap (threading.py:884)
```

This PR removes that warning, behaviour remains the same.
The build is currently broken due to some incompatibilities in pyOpenSSL versions. This attempts to bump the version.
* Drop Python 3.6 support

* Removed dependency on pre 3.7 dataclasses library

* Add Python 3.10 support;

* Added Python 3.10 to the CI

* Revert upgrade of tornado

* Delete 1.hello_world.json

* Reverted Python 3.10 support due to Tornado dependency.
Bumps [shelljs](https://github.com/shelljs/shelljs) from 0.7.8 to 0.8.5.
- [Release notes](https://github.com/shelljs/shelljs/releases)
- [Changelog](https://github.com/shelljs/shelljs/blob/master/CHANGELOG.md)
- [Commits](shelljs/shelljs@v0.7.8...v0.8.5)

---
updated-dependencies:
- dependency-name: shelljs
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: cpaulin <[email protected]>
…oogle#1014)

Bumps [@angular/core](https://github.com/angular/angular/tree/HEAD/packages/core) from 4.4.6 to 11.0.5.
- [Release notes](https://github.com/angular/angular/releases)
- [Changelog](https://github.com/angular/angular/blob/main/CHANGELOG.md)
- [Commits](https://github.com/angular/angular/commits/11.0.5/packages/core)

---
updated-dependencies:
- dependency-name: "@angular/core"
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [engine.io](https://github.com/socketio/engine.io) and [karma](https://github.com/karma-runner/karma). These dependencies needed to be updated together.

Updates `engine.io` from 1.8.2 to 6.2.0
- [Release notes](https://github.com/socketio/engine.io/releases)
- [Changelog](https://github.com/socketio/engine.io/blob/main/CHANGELOG.md)
- [Commits](socketio/engine.io@1.8.2...6.2.0)

Updates `karma` from 1.4.1 to 6.4.0
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](karma-runner/karma@v1.4.1...v6.4.0)

---
updated-dependencies:
- dependency-name: engine.io
  dependency-type: indirect
- dependency-name: karma
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
By adding `skip`, `error` states and using PhaseRecord.outcome instead of checking measurement.status.

Co-authored-by: cpaulin <[email protected]>
PiperOrigin-RevId: 474850134
Oauth2client was previously used in the mfg-inspector output callback for authentication, but the library is now deprecated and replaced by the google-auth library.

This removes oauth2client and httplib2 from openhtf's output callbacks and replaces them with google-auth's oauth2 implementation using the Requests transport.

PiperOrigin-RevId: 474878614
* Add typing to ConsoleSummary

* Add typing to StationServer

* Improved typing for validators
Many dependencies are very outdated and when openhtf is combined with
or used with other projects, version conflicts become very challenging
to unwind.

NOTE: tornado is left with a '<5.0' dependency as there have been some
major API changes that require more extensive refactors to accommodate.
* Allow using a newer version of protobuf

Will require recompiling protos

* Download a newer protoc for CI
The TypeVar usage was indicating that ALL validators available in _VALIDATORS would have the same type. This update only indicates that these validators are an instance of the ValidatorBase.
* Fix missing `SafeHtml` type

* Partial revert of c7ab508

* Revert "Bump @angular/core from 4.4.6 to 11.0.5 in /openhtf/output/web_gui (google#1014)"

This reverts commit e9c7681.

* Replace uglifyjs-webpack-plugin with terser-webpack-plugin-legacy

* Rebuild web_gui

* Add CI job to check that the web_gui builds

Co-authored-by: glados-verma <[email protected]>
This replaces the need for google#1016 and more closely follows the Google style guide. In particular https://google.github.io/styleguide/pyguide.html#22-imports.

PiperOrigin-RevId: 477311168
…1024)

* Bump scss-tokenizer and node-sass in /openhtf/output/web_gui

Bumps [scss-tokenizer](https://github.com/sasstools/scss-tokenizer) and [node-sass](https://github.com/sass/node-sass). These dependencies needed to be updated together.

Updates `scss-tokenizer` from 0.2.3 to 0.4.3
- [Release notes](https://github.com/sasstools/scss-tokenizer/releases)
- [Commits](sasstools/scss-tokenizer@v0.2.3...v0.4.3)

Updates `node-sass` from 4.8.3 to 7.0.3
- [Release notes](https://github.com/sass/node-sass/releases)
- [Changelog](https://github.com/sass/node-sass/blob/master/CHANGELOG.md)
- [Commits](sass/node-sass@v4.8.3...v7.0.3)

---
updated-dependencies:
- dependency-name: scss-tokenizer
  dependency-type: indirect
- dependency-name: node-sass
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>

* Remove node version 9 restriction to allow scss and sass update

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: glados-verma <[email protected]>
glados-verma and others added 25 commits April 18, 2025 13:18
Update README.md with actual setup instructions
PiperOrigin-RevId: 758772358
… in core testing.

PiperOrigin-RevId: 759755874
This commit introduces an integration test for the `examples/hello_world.py`
script, located in `test/examples/test_hello_world.py`.

The integration test includes the following features:
- Mocks the `prompt` method of `openhtf.plugs.user_input.UserInput` to
  simulate user input for the DUT ID (using "test_dut").
- Executes the `main()` function of the `examples/hello_world.py` script.
- Verifies the successful creation of the JSON output file.
- Asserts the correctness of critical data points in the JSON output,
  including `dut_id`, `outcome`, and the measured value of
  `hello_world_measurement` ('Hello Again!').
- Implements `setUp` to initialize an instance variable for the
  expected output filename.
- Implements `tearDown` to ensure robust cleanup of the generated JSON
  output file after test execution.
- Includes a `print(output_data)` statement within the test method for
  easy inspection of the generated JSON content during debugging or
  test verification.

The `examples/hello_world.py` script itself has been updated to
explicitly set the `name` parameter to `'hello_world.py'` during the
instantiation of `htf.Test`. This test name is recorded under
`metadata.name` in the JSON output.

Imports in the test script have been formatted and ordered according to
standard Python conventions (standard library, then third-party, then
local application imports).

The test is designed to be run with `pytest` and has been verified to
pass successfully with all assertions and cleanup logic functioning
as expected.
….py`

and a shared utility function for tests.

Summary of changes:
- Created `test/examples/test_measurements.py` with a `TestMeasurements`
  class to verify the output of `examples/measurements.py`.
  - Test checks for DUT ID, overall outcome (FAIL, as expected due to
    `inline_phase`), total number of phases (7), and specific
    measurement values and outcomes for `hello_phase`, `measure_seconds`,
    `inline_phase`, and `multdim_measurements`.
  - Added assertions for `validated_measurement` as per your feedback.
  - Resolved test failures by ensuring `pandas` is available and by
    correctly identifying phase names and counts.

- Created `test/examples/test_utils.py` containing a helper function
  `get_phase_by_name(test_case, phases_data, phase_name)`.
  - This function retrieves a phase dictionary by its name from the
    test output data, making tests more robust to phase order changes.
  - It calls `test_case.fail()` if the phase is not found.

- Refactored `test/examples/test_measurements.py` to use the
  `get_phase_by_name` utility.

- Refactored `test/examples/test_hello_world.py` to use the
  `get_phase_by_name` utility.
  - Corrected the phase name used in this test to "hello_world".

The tests in `test_measurements.py` are confirmed to pass. The final
run of `test_hello_world.py` after its last correction was pending
but is expected to pass.
…ases

Add test case showing where this is useful

PiperOrigin-RevId: 761319671
…rent working directory, since it's messy to have output files show up in the source tree
…ts-and-helper

PiperOrigin-RevId: 761656356
…le `contextlib`

PiperOrigin-RevId: 767641051
This replaces a KeyError with AssertionError and better messaging

Also replace all uses of expectedfailure in test_test.py, as this is not the intended usage, and indeed it wasn't checking the right thing in some cases - fix those cases.

PiperOrigin-RevId: 767770435
@jp-pino jp-pino self-assigned this Aug 12, 2025
@jp-pino jp-pino added the enhancement New feature or request label Aug 12, 2025
@jp-pino jp-pino changed the title Sync up with master Sync up with the upstream repo Aug 12, 2025
@jp-pino
Copy link
Author

jp-pino commented Aug 12, 2025

Tests are failing because there's currently issues with GitHub. Will rerun after the issues are resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.