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

Refactor test namespaces #98

Open
wants to merge 5 commits into
base: xdmod11.0
Choose a base branch
from

Conversation

aaronweeden
Copy link
Contributor

@aaronweeden aaronweeden commented Oct 20, 2023

Description

Same as ubccr/xdmod#1789 but for the xdmod-appkernels module.

This PR also renames integration_tests to integration to be consistent with the main xdmod module.

This PR also fixes expected results from the integration tests.

Tests performed

To make sure the changes in this PR don't affect the tests that are run, I did the following in a Docker container running tools-ext-01.ccr.xdmod.org/xdmod-10.5.0-x86_64:rockylinux8.5-0.3:

  1. Run the following commands:
    export COMPOSER_ALLOW_SUPERUSER=1
    export XDMOD_REALMS='jobs,storage,cloud'
    export XDMOD_BRANCH=xdmod11.0
    export XDMOD_MODULE_NAME=appkernels
    export XDMOD_IS_CORE=yes
    export XDMOD_INSTALL_DIR=/xdmod
    export XDMOD_TEST_MODE=fresh_install
    dnf -y install --setopt=tsflags=nodocs python3
    openssl genrsa -rand /proc/cpuinfo:/proc/dma:/proc/filesystems:/proc/interrupts:/proc/ioports:/proc/uptime 2048 > /etc/pki/tls/private/localhost.key
    /usr/bin/openssl req -new -key /etc/pki/tls/private/localhost.key -x509 -sha256 -days 365 -set_serial $RANDOM -extensions v3_req -out /etc/pki/tls/certs/localhost.crt -subj "/C=XX/L=Default City/O=Default Company Ltd"
    git clone https://github.com/ubccr/xdmod-appkernels /xdmod-appkernels
    cd /xdmod-appkernels
    mkdir -p ./shippable/testresults
    export XDMOD_APPKERNELS_DIR=/xdmod-appkernels
    export XDMOD_SOURCE_DIR=/xdmod
    ./tests/runtests.sh
    cd tests/unit
    sed -i '/printerClass/d' phpunit.xml.dist
    phpunit --debug . > /unit-before.txt
    git clone https://github.com/aaronweeden/xdmod-appkernels -b refactor-test-namespaces /xdmod-appkernels-new
    rm -r /xdmod-appkernels/tests
    cp -r /xdmod-appkernels{-new,}/tests
    cd /xdmod-appkernels/tests/unit
    phpunit --debug . > /unit-after.txt
    cd ../integration
    phpunit --debug .
    
  2. Confirm that the last command ran both of these tests successfully:
IntegrationTests\REST\internal_dashboard\DashboardAppKernelTest::testResourceNullParam
IntegrationTests\REST\internal_dashboard\DashboardAppKernelTest::testKernelNullParam
  1. Compare /unit-{before,after}.txt and make sure the only differences are namespace names and amount of time the tests ran.

Types of changes

  • 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 change)

Checklist:

  • My code follows the code style of this project as found in the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@aaronweeden aaronweeden added this to the 11.0.0 milestone Oct 20, 2023
@aaronweeden aaronweeden force-pushed the refactor-test-namespaces branch 2 times, most recently from b8448a2 to 58ba43b Compare October 20, 2023 17:45
@aaronweeden aaronweeden force-pushed the refactor-test-namespaces branch 4 times, most recently from 54ae0b2 to d147ea2 Compare December 8, 2023 16:05
@aaronweeden aaronweeden force-pushed the refactor-test-namespaces branch 5 times, most recently from 9e55771 to a596514 Compare December 8, 2023 19:03
@aaronweeden aaronweeden force-pushed the refactor-test-namespaces branch 2 times, most recently from 36536fd to e7ee800 Compare December 8, 2023 19:38
@aaronweeden aaronweeden marked this pull request as ready for review December 8, 2023 22:21
@aaronweeden aaronweeden force-pushed the refactor-test-namespaces branch 2 times, most recently from b2cd96a to 0b0889b Compare January 16, 2024 19:12
@aaronweeden aaronweeden removed this from the 11.0.0 milestone Jun 18, 2024
@aaronweeden aaronweeden changed the base branch from xdmod11.0 to main October 30, 2024 16:10
@aaronweeden aaronweeden added this to the 11.0.1 milestone Dec 2, 2024
@aaronweeden aaronweeden changed the base branch from main to xdmod11.0 December 2, 2024 20:00
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