GithubHelp home page GithubHelp logo

edgex-taf's Introduction

TAF

GitHub Latest Dev Tag) GitHub Latest Stable Tag) GitHub License GitHub Pull Requests GitHub Contributors GitHub Committers GitHub Commit Activity

TAF stands for Test Automation Framework. It is used for automating end-to-end UI and API tests of the EdgeX services.

Those tests can separate to different suites:

  • Functional test
  • Integration test
  • Performance test

Usage

  • Users can refer to the the document to learn how to run functional test and integration test.
  • Users can refer to the the document to run performance metrics collection on local.

Community

License

Apache-2.0

edgex-taf's People

Contributors

ajcasagrande avatar beaufrusetta avatar bnevis-i avatar cherrycl avatar cloudxxx8 avatar jameskbutcher avatar jamesrgregg avatar jim-wang-intel avatar jinlinguan avatar jpwhitemn avatar juan-pablo-lopez-gutierrez avatar jumpingliu avatar lenny-goodell avatar milj19lf avatar ramya-ranganathan avatar soda480 avatar vishwassp-hcl-intel avatar weichou1229 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

edgex-taf's Issues

TAF-Demo is not able to clone

I tried to clone the demo code which described in the README, it seems need to provide the username and password.

$ git clone --recurse-submodules https://github.impcloud.net/IVS/TAF-Demo.git
Cloning into 'TAF-Demo'...
Username for 'https://github.impcloud.net': 

@ramya-ranganathan Could you help check the TAF-Demo repository?

Add edgex-taf docs

Add documents:

  • CH-Edgex-taf.rst for QA tester to implement test cases.
  • CH-Self-Assessment-DS.rst for DS developer to verify DS common behavior

Need changing modbus simulator image which is built by ourself

Currently, used modbus simulator image panterdsd/diagslave didn't support arm64, need changing it to following image.

nexus3.edgexfoundry.org:10003/edgex-devops/edgex-modbus-simulator-arm64:latest
nexus3.edgexfoundry.org:10003/edgex-devops/edgex-modbus-simulator:latest

Dockerize edgex-taf and robotframework

I saw edgex-taf invokes the robot via robot API,

            logging.info("Run test {0}".format(testfile))
            if DRY_RUN is False:
                logging.debug("Output to {0}, {1}".format(tmpOutputDir,noReport))
                if noReport:
                    kwargs["output"] = testname+".xml"
                run(testfile, **kwargs)

but we need to dockerize the edgex-taf and robotframework for running the testing on the Jenkins server.

For performance-summary-collection, we use robotframework and docker-compose docker container to execute full testing :

  1. Mount all test script to robotframework container
docker run --rm --network host -v $PWD:$PWD -w $PWD -v /var/run/docker.sock:/var/run/docker.sock  \
    iotech-releases.jfrog.io/robotframework-x86_64:1.0.0 -d report .
  1. Test script execute docker-compose command to deploy EdgeX
docker run --rm --env-file x86_64.env -v $PWD:$PWD -w $PWD -v /var/run/docker.sock:/var/run/docker.sock   \
    docker/compose:1.24.0 up -d
  1. Execute test in the robotframework container.

@juan-pablo-lopez-gutierrez
Is it possible to modify the edgex-taf to execute testing in docker container?
Because It's good to dockerize all components(edgex-taf, robot, docker-compose) to make it easy to run testing on different testing machine like gateway, raspi ...etc.

Modify 6_scheduling test script to support C DS

Scheduling001 - Test Resource and Frequency for autoEvent

This case tests the device service should execute AutoEvent correctly.

Once the device-opc-ua adds a device with AutoEvent and then the device-opc-ua will execute the AutoEvent immediately, but the device-modbus-go will wait for the frequency time.

For example, DS add a device with the auto event as the following device entity:

{
  "description": "AutoEvent-Device",
  "id": "...",
  "name": "AutoEvent-Device",
   ...
  "autoEvents": [
     {
       "frequency": "8s",
       "resource": "DeviceValue_UINT64_R"
     }
   ]
}

After 16 seconds:

The device-opc-ua generates 3 readings

The device-modbus-go generates 2 readings

Fail to run demo.robot

I follow the README instruction and it seems not work to me.
@ramya-ranganathan Could you help check this error?

$ cd TAF/testScenarios
$ python3 run.py -u UC_Color_Log_Demo/
INFO:root:Running usecase ['UC_Color_Log_Demo/']
DEBUG:root:Testing demo.robot
INFO:root:Run test demo.robot
DEBUG:root:Output to ../../testArtifacts/robot/UC_Color_Log_Demo/, True
==============================================================================
Demo                                                                          
==============================================================================
TC0001 - Read Config File                                             | FAIL |
Parent suite setup failed:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/bruce/Documents/workspace/git/edgexfoundry-holding/edgex-taf/TAF/testArtifacts/logs/UC_Color_Log_Demo.log'
------------------------------------------------------------------------------
TC0002 - Test Debug Output                                            | FAIL |
Parent suite setup failed:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/bruce/Documents/workspace/git/edgexfoundry-holding/edgex-taf/TAF/testArtifacts/logs/UC_Color_Log_Demo.log'
------------------------------------------------------------------------------
TC0003 - Test Info Output                                             | FAIL |
Parent suite setup failed:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/bruce/Documents/workspace/git/edgexfoundry-holding/edgex-taf/TAF/testArtifacts/logs/UC_Color_Log_Demo.log'
------------------------------------------------------------------------------
TC0004 - Test Warn Output                                             | FAIL |
Parent suite setup failed:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/bruce/Documents/workspace/git/edgexfoundry-holding/edgex-taf/TAF/testArtifacts/logs/UC_Color_Log_Demo.log'
------------------------------------------------------------------------------
TC0005 - Test Error Output                                            | FAIL |
Parent suite setup failed:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/bruce/Documents/workspace/git/edgexfoundry-holding/edgex-taf/TAF/testArtifacts/logs/UC_Color_Log_Demo.log'
------------------------------------------------------------------------------
TC0006 - Test Log Exception Output                                    | FAIL |
Parent suite setup failed:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/bruce/Documents/workspace/git/edgexfoundry-holding/edgex-taf/TAF/testArtifacts/logs/UC_Color_Log_Demo.log'
------------------------------------------------------------------------------
TC0007 - Test PASS Output                                             | FAIL |
Parent suite setup failed:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/bruce/Documents/workspace/git/edgexfoundry-holding/edgex-taf/TAF/testArtifacts/logs/UC_Color_Log_Demo.log'
------------------------------------------------------------------------------
TC0008 - Test Fail Output                                             | FAIL |
Parent suite setup failed:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/bruce/Documents/workspace/git/edgexfoundry-holding/edgex-taf/TAF/testArtifacts/logs/UC_Color_Log_Demo.log'
------------------------------------------------------------------------------
TC0009 - Test Heading Output                                          | FAIL |
Parent suite setup failed:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/bruce/Documents/workspace/git/edgexfoundry-holding/edgex-taf/TAF/testArtifacts/logs/UC_Color_Log_Demo.log'
------------------------------------------------------------------------------
Demo                                                                  | FAIL |
Suite setup failed:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/bruce/Documents/workspace/git/edgexfoundry-holding/edgex-taf/TAF/testArtifacts/logs/UC_Color_Log_Demo.log'

Also suite teardown failed:
AttributeError: '__SettingsInfo' object has no attribute 'TestLog'

9 critical tests, 0 passed, 9 failed
9 tests total, 0 passed, 9 failed
==============================================================================
Output:  /Users/bruce/Documents/workspace/git/edgexfoundry-holding/edgex-taf/TAF/testArtifacts/robot/UC_Color_Log_Demo/demo.xml
Log:     /Users/bruce/Documents/workspace/git/edgexfoundry-holding/edgex-taf/TAF/testArtifacts/robot/UC_Color_Log_Demo/log.html
Report:  /Users/bruce/Documents/workspace/git/edgexfoundry-holding/edgex-taf/TAF/testArtifacts/robot/UC_Color_Log_Demo/report.html
Log:     /Users/bruce/Documents/workspace/git/edgexfoundry-holding/edgex-taf/TAF/testArtifacts/robot/UC_Color_Log_Demo/_log.html
Report:  /Users/bruce/Documents/workspace/git/edgexfoundry-holding/edgex-taf/TAF/testArtifacts/robot/UC_Color_Log_Demo/_report.html

Missing BACKWARD variable in deploy-edgex.sh

Should add ${BACKWARD} in docker-compose.yaml

docker run --rm -v ${WORK_DIR}:${WORK_DIR}:rw,z -w ${WORK_DIR} -v /var/run/docker.sock:/var/run/docker.sock \
        --env WORK_DIR=${WORK_DIR} --env PROFILE=${PROFILE}  \
        --env DS_PROFILE=${DS_PROFILE} --env CONF_DIR=${CONF_DIR} --env REGISTRY_URL=${REGISTRY_URL} \
        ${COMPOSE_IMAGE} -f "${WORK_DIR}/TAF/utils/scripts/docker/docker-compose.yaml" up -d consul data metadata command logging notifications scheduler

Add test suites fot DS certification

Implement the following test suites for common device service behaviors:

  • 1_service_operation.robot
  • 2_configuration_setting.robot
  • 3_device_profile.robot
  • 4_device.robot
  • 5_data_transformation.robot
  • 6_query_commands.robot
  • 7_actuation_commands.robot

Change keyword "set environment variable" to "set test/suite variable"

If the variable only uses on suit or testcase level, please change the keyword to "set test/suite variable".

Create device
    [Arguments]  ${device_file}
    Create Session  Core Metadata  url=${coreMetadataUrl}
    ${data}=  Get File  ${WORK_DIR}/TAF/config/${PROFILE}/${device_file}  encoding=UTF-8
    ${newdata}=  replace string  ${data}   %DeviceServiceName%    ${DEVICE_SERVICE_EDGEX_NAME}
    ${headers}=  Create Dictionary  Content-Type=application/json
    ${resp}=  Post Request  Core Metadata  ${deviceUri}  data=${newdata}  headers=${headers}
    run keyword if  ${resp.status_code}!=200  log to console  ${resp.content}
    Should Be Equal As Strings  ${resp.status_code}  200
    set environment variable  deviceId   ${resp.content}

Need to set compose image to variable

There are several files contain compose image. Once the compose version changed, we have to modify several files. Set it to a variable, just modify once.

Handle float value checking properly

For C DS example, put command is

curl http://localhost:48082/api/v1/device/name/Test-Device/command/GenerateDeviceValue_FLOAT32_RW  \
  -X PUT -H 'Content-Type: application/json' \
  -d '{"DeviceValue_FLOAT32_RW":"1.4"}'

When execute read command and the result is

{
   "readings" : [
      {
         "name" : "DeviceValue_FLOAT32_RW",
         "origin" : 1582265858354364854,
         "value" : "1.39999998e+00"
      }
   ],
   "origin" : 1582265858354364854,
   "device" : "Test-Device"
}

We should handle the float value checking properly by comparing the offset.

Integration tests for Store and Forward capability

Add integration tests to cover the Store and Forward capability.

Acceptance Criteria is as follows:

  • Data is stored for later retry when export function (HTTP or MQTT) fails and persistOnFailure is true and config setting Writeable.StoreAndForward.Enable = true
  • Stored data is exported when retry occurs and connection is good just as if it was exported without error originally.
  • Stored data is cleared from the DB once successfully retried.
  • Stored data retry count is incremented each time the export retry fails and is updated in DB.
  • Stored data is cleared from the DB after the maximum configured retires. (Writeable.StoreAndForward.MaxRetries config setting)
  • Changing the function pipeline results in any data stored for that app service to be cleared on the next retry.
  • Retry loop is only run when config setting Writeable.StoreAndForward.Enabled is true
  • Retry loop interval is set by the Writeable.StoreAndForward.RetryInterval config setting
  • Export retries will resume after application service is restarted, i.e. store data is persisted between restarts of the application service.
  • RetryCount resumes after application service restart, i.e. it isn't reset.
  • Changes to Writeable.StoreAndForward values are dynamically processed without restarting the application service.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.