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

test(fixtures): move certificate fixtures to source code #3554

Merged

Conversation

ReenigneArcher
Copy link
Member

Description

Fixture files are not accessible by some builds (homebrew, maybe flatpak?, maybe copr?)

Screenshot

Issues Fixed or Closed

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

Copy link

codecov bot commented Jan 18, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 12.06%. Comparing base (89f097a) to head (11e8e21).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master    #3554     +/-   ##
=========================================
  Coverage   12.06%   12.06%             
=========================================
  Files          91       91             
  Lines       16206    16206             
  Branches     7684     7684             
=========================================
  Hits         1955     1955             
+ Misses      13668    11778   -1890     
- Partials      583     2473   +1890     
Flag Coverage Δ
Linux 11.91% <ø> (ø)
Windows 13.05% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 31 files with indirect coverage changes

@ReenigneArcher
Copy link
Member Author

As an alternative to the approach in this PR, I tried doing this to keep that as separate files, but did not work.

in cmake:

foreach(file ${FIXTURE_FILES})
    file(READ ${file} CONTENTS)
    message(STATUS "Reading fixture file: ${file}")
    message(STATUS "Contents: ${CONTENTS}")
    get_filename_component(filename ${file} NAME_WE)
    string(TOUPPER ${filename} filename_upper)
    set(SUNSHINE_TEST_${filename_upper} "${CONTENTS}")

    # add the definition to the list
    list(APPEND TEST_DEFINITIONS SUNSHINE_TEST_${filename_upper}="${CONTENTS}")
endforeach()

in test:

const std::string PRIVATE_KEY = R"(${SUNSHINE_TEST_PAIRING_KEY})";
const std::string PUBLIC_CERT = R"(${SUNSHINE_TEST_PAIRING_PUBLIC})";

I renamed the files so the definition name ends up like SUNSHINE_TEST_PAIRING_KEY and SUNSHINE_TEST_PAIRING_PUBLIC.

This crashes the test binary for some reason...

@ReenigneArcher ReenigneArcher marked this pull request as ready for review January 18, 2025 15:16
@ReenigneArcher ReenigneArcher enabled auto-merge (squash) January 18, 2025 15:17
@ReenigneArcher ReenigneArcher merged commit 26566cc into master Jan 18, 2025
37 checks passed
@ReenigneArcher ReenigneArcher deleted the test/fixtures/move-certificate-fixtures-to-source-code branch January 18, 2025 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant